diff options
author | Pascal Rapicault | 2015-02-16 22:10:56 +0000 |
---|---|---|
committer | Pascal Rapicault | 2015-02-16 22:11:19 +0000 |
commit | 0fdb03cf79ad3493245ba7f37b6fda5775dbd836 (patch) | |
tree | f2f90ee3ae1d2e8dd5cb23ce4b2fe50a396570cf /bundles/org.eclipse.equinox.p2.touchpoint.eclipse | |
parent | 585bbff7bc8689575c8bed80a66fabf174159ce9 (diff) | |
download | rt.equinox.p2-0fdb03cf79ad3493245ba7f37b6fda5775dbd836.tar.gz rt.equinox.p2-0fdb03cf79ad3493245ba7f37b6fda5775dbd836.tar.xz rt.equinox.p2-0fdb03cf79ad3493245ba7f37b6fda5775dbd836.zip |
WIP mac
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.touchpoint.eclipse')
2 files changed, 13 insertions, 44 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/LazyManipulator.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/LazyManipulator.java index 4e8857043..6a6bad74d 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/LazyManipulator.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/LazyManipulator.java @@ -48,7 +48,7 @@ public class LazyManipulator implements Manipulator { launcherData.setFwConfigLocation(Util.getConfigurationFolder(profile)); launcherData.setLauncher(Util.getLauncherPath(profile)); launcherData.setLauncherConfigLocation(Util.getLauncherConfigLocation(profile)); - launcherData.setOS(Util.isMacOSBundled(profile) ? org.eclipse.equinox.p2.core.spi.Constants.MACOSX_BUNDLED : Util.getOSFromProfile(profile)); + launcherData.setOS(Util.getOSFromProfile(profile)); launcherData.setHome(Util.getInstallFolder(profile)); try { diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java index dc85fe237..a5a6d8971 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java @@ -15,7 +15,6 @@ package org.eclipse.equinox.internal.p2.touchpoint.eclipse; import java.io.File; -import java.io.IOException; import java.net.*; import java.util.*; import org.eclipse.core.runtime.*; @@ -23,7 +22,6 @@ import org.eclipse.equinox.frameworkadmin.BundleInfo; import org.eclipse.equinox.internal.p2.core.helpers.*; import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability; import org.eclipse.equinox.p2.core.*; -import org.eclipse.equinox.p2.core.spi.Constants; import org.eclipse.equinox.p2.engine.IProfile; import org.eclipse.equinox.p2.metadata.*; import org.eclipse.equinox.p2.repository.IRepository; @@ -271,23 +269,23 @@ public class Util { String name = profile.getProperty(EclipseTouchpoint.PROFILE_PROP_LAUNCHER_NAME); if (name == null || name.length() == 0) name = "eclipse"; //$NON-NLS-1$ - String launcherName = getLauncherName(name, (isMacOSBundled(profile) ? Constants.MACOSX_BUNDLED : getOSFromProfile(profile)), getInstallFolder(profile)); - return launcherName == null ? null : new File(getInstallFolder(profile), launcherName); + String relativePath = getLauncherRelativePath(name, getOSFromProfile(profile), getInstallFolder(profile)); + return relativePath == null ? null : new File(getInstallFolder(profile), relativePath); } - public static boolean isMacOSBundled(IProfile profile) { - String environments = profile.getProperty(IProfile.PROP_ENVIRONMENTS); - if (environments == null) - return false; - if (environments.indexOf(Constants.MACOSX_BUNDLED + "=true") != -1) //$NON-NLS-1$ - return true; - return false; - } + // public static boolean isMacOSBundled(IProfile profile) { + // String environments = profile.getProperty(IProfile.PROP_ENVIRONMENTS); + // if (environments == null) + // return false; + // if (environments.indexOf(Constants.MACOSX_BUNDLED + "=true") != -1) //$NON-NLS-1$ + // return true; + // return false; + // } /** * Returns the name of the Eclipse application launcher. */ - private static String getLauncherName(String name, String os, File installFolder) { + private static String getLauncherRelativePath(String name, String os, File installFolder) { if (os == null) { EnvironmentInfo info = (EnvironmentInfo) ServiceHelper.getService(Activator.getContext(), EnvironmentInfo.class.getName()); if (info == null) @@ -301,38 +299,9 @@ public class Util { return name; return name + ".exe"; //$NON-NLS-1$ } - if (os.equals(Constants.MACOSX_BUNDLED)) { - return "/Contents/MacOS/" + name; //$NON-NLS-1$ - } if (os.equals(org.eclipse.osgi.service.environment.Constants.OS_MACOSX)) { - IPath path = new Path(name); - if (path.segment(0).endsWith(".app")) //$NON-NLS-1$ - return name; - - String appName = null; - if (installFolder != null) { - File appFolder = new File(installFolder, name + ".app"); //$NON-NLS-1$ - if (appFolder.exists()) { - try { - appName = appFolder.getCanonicalFile().getName(); - } catch (IOException e) { - appName = appFolder.getName(); - } - } - } - - StringBuffer buffer = new StringBuffer(); - if (appName != null) { - buffer.append(appName); - } else { - buffer.append(name.substring(0, 1).toUpperCase()); - buffer.append(name.substring(1)); - buffer.append(".app"); //$NON-NLS-1$ - } - buffer.append("/Contents/MacOS/"); //$NON-NLS-1$ - buffer.append(name); - return buffer.toString(); + return "../MacOS/" + name; } return name; } |