Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherParser.java10
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/ParserUtils.java2
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup.java2
3 files changed, 11 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherParser.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherParser.java
index 021af389f..2d12eeb92 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherParser.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherParser.java
@@ -23,6 +23,7 @@ import org.eclipse.osgi.util.NLS;
import org.osgi.service.log.LogService;
public class EclipseLauncherParser {
+ private static final String MAC_OS_APP_FOLDER = ".app/Contents/MacOS"; //$NON-NLS-1$
private static final String CONFIGURATION_FOLDER = "configuration"; //$NON-NLS-1$
//this figures out the location of the data area on partial data read from the <eclipse>.ini
@@ -38,7 +39,12 @@ public class EclipseLauncherParser {
ParserUtils.removeArgument(EquinoxConstants.OPTION_INSTALL, lines);
return;
}
- if (!launcherData.getFwJar().getParentFile().equals(launcherFolder)) {
+ String launcherString = launcherFolder.getAbsolutePath().replace('\\', '/');
+ if (launcherString.endsWith(MAC_OS_APP_FOLDER)) {
+ //We can do 3 calls to getParentFile without checking because
+ launcherFolder = launcherFolder.getParentFile().getParentFile().getParentFile();
+ }
+ if (!ParserUtils.fromOSGiJarToOSGiInstallArea(launcherData.getFwJar().getParentFile().getAbsolutePath()).equals(launcherFolder)) {
ParserUtils.setValueForArgument(EquinoxConstants.OPTION_INSTALL, launcherFolder.getAbsolutePath(), lines);
}
}
@@ -51,7 +57,7 @@ public class EclipseLauncherParser {
URI launcherFolder = launcherData.getLauncher().getParentFile().toURI();
getStartup(lines, launcherFolder);
- // getFrameworkJar(lines, launcherFolder, launcherData);
+ // getFrameworkJar(lines, launcherFolder, laubncherData);
URI osgiInstallArea = getOSGiInstallArea(lines, launcherFolder);
if (osgiInstallArea == null) {
osgiInstallArea = launcherData.getFwJar() != null ? launcherData.getFwJar().getParentFile().toURI() : launcherFolder;
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/ParserUtils.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/ParserUtils.java
index 93efb3a0d..93adb059a 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/ParserUtils.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/ParserUtils.java
@@ -93,7 +93,7 @@ public class ParserUtils {
return null;
}
- private static File fromOSGiJarToOSGiInstallArea(String path) {
+ public static File fromOSGiJarToOSGiInstallArea(String path) {
IPath parentFolder = new Path(path).removeLastSegments(1);
if (parentFolder.lastSegment().equalsIgnoreCase("plugins")) //$NON-NLS-1$
return parentFolder.removeLastSegments(1).toFile();
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup.java
index 0f45c5572..74ecfe7dc 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup.java
@@ -52,6 +52,8 @@ public class MacOSLikeSetup extends FwkAdminAndSimpleConfiguratorTest {
manipulator.getLauncherData().addProgramArg(EquinoxConstants.OPTION_STARTUP);
manipulator.getLauncherData().addProgramArg(launcherJar.toURI().toString());
+ manipulator.getLauncherData().setFwJar(osgiJar);
+
try {
manipulator.save(false);
} catch (IllegalStateException e) {

Back to the top