Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2015-02-16 17:10:56 -0500
committerPascal Rapicault2015-02-16 17:11:19 -0500
commit0fdb03cf79ad3493245ba7f37b6fda5775dbd836 (patch)
treef2f90ee3ae1d2e8dd5cb23ce4b2fe50a396570cf /bundles/org.eclipse.equinox.frameworkadmin.equinox
parent585bbff7bc8689575c8bed80a66fabf174159ce9 (diff)
downloadrt.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.frameworkadmin.equinox')
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EclipseLauncherParser.java15
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java5
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/ParserUtils.java12
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/utils/FileUtils.java8
4 files changed, 22 insertions, 18 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 1154b6bbb..89f486dd4 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
@@ -27,7 +27,8 @@ import org.osgi.service.log.LogService;
public class EclipseLauncherParser {
public static final String MAC_OS_APP_FOLDER = ".app/Contents/MacOS"; //$NON-NLS-1$
private static final String CONFIGURATION_FOLDER = "configuration"; //$NON-NLS-1$
- public static final String MACOSX_BUNDLED = "macosx-bundled"; //$NON-NLS-1$
+
+ // public static final String MACOSX_BUNDLED = "macosx-bundled"; //$NON-NLS-1$
//this figures out the location of the data area on partial data read from the <eclipse>.ini
private URI getOSGiInstallArea(List<String> lines, URI base, LauncherData launcherData) {
@@ -48,12 +49,12 @@ public class EclipseLauncherParser {
return;
}
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();
- if (!launcherData.getOS().endsWith(MACOSX_BUNDLED))
- launcherFolder = launcherFolder.getParentFile();
- }
+ // if (launcherString.endsWith(MAC_OS_APP_FOLDER)) {
+ // //We can do 3 calls to getParentFile without checking because
+ // launcherFolder = launcherFolder.getParentFile().getParentFile();
+ // if (!launcherData.getOS().endsWith(MACOSX_BUNDLED))
+ // launcherFolder = launcherFolder.getParentFile();
+ // }
if (!ParserUtils.fromOSGiJarToOSGiInstallArea(launcherData.getFwJar().getAbsolutePath()).equals(launcherFolder)) {
ParserUtils.setValueForArgument(EquinoxConstants.OPTION_INSTALL, launcherFolder.getAbsolutePath().replace('\\', '/'), lines);
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java
index f516d4da7..baf343caf 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/EquinoxManipulatorImpl.java
@@ -93,7 +93,10 @@ public class EquinoxManipulatorImpl implements Manipulator {
int dotLocation = launcherName.lastIndexOf('.');
if (dotLocation != -1)
launcherName = launcherName.substring(0, dotLocation);
- File result = new File(launcher.getParentFile(), launcherName + EquinoxConstants.INI_EXTENSION);
+ File launcherFolder = launcher.getParentFile();
+ if (org.eclipse.osgi.service.environment.Constants.OS_MACOSX.equals(launcherData.getOS()))
+ launcherFolder = new File(launcherData.getFwConfigLocation(), "../");
+ File result = new File(launcherFolder, launcherName + EquinoxConstants.INI_EXTENSION);
return result;
}
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 4080ffcb6..0279d4ac5 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
@@ -48,19 +48,19 @@ public class ParserUtils {
File launcherFile = launcherData.getLauncher();
if (launcherFile != null) {
- if (Constants.OS_MACOSX.equals(launcherData.getOS())) {
+ if (Constants.OS_MACOSX.equals(launcherData.getOS())) { //
//the equinox launcher will look 3 levels up on the mac when going from executable to launcher.jar
//see org.eclipse.equinox.executable/library/eclipse.c : findStartupJar();
IPath launcherPath = new Path(launcherFile.getAbsolutePath());
- if (launcherPath.segmentCount() > 4) {
+ if (launcherPath.segmentCount() > 1) {
//removing "Eclipse.app/Contents/MacOS/eclipse"
- launcherPath = launcherPath.removeLastSegments(4);
+ launcherPath = launcherPath.removeLastSegments(1).append("Eclipse"); //$NON-NLS-1$
return launcherPath.toFile();
}
}
- if (EclipseLauncherParser.MACOSX_BUNDLED.equals(launcherData.getOS())) {
- Log.log(LogService.LOG_WARNING, "Problem figuring out the osgi install area. The bundled mode of macosx requires a -startup argument to be specified."); //$NON-NLS-1$
- }
+ // if (EclipseLauncherParser.MACOSX_BUNDLED.equals(launcherData.getOS())) {
+ // Log.log(LogService.LOG_WARNING, "Problem figuring out the osgi install area. The bundled mode of macosx requires a -startup argument to be specified."); //$NON-NLS-1$
+ // }
return launcherFile.getParentFile();
}
return null;
diff --git a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/utils/FileUtils.java b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/utils/FileUtils.java
index 7eed2d207..481714f1e 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/utils/FileUtils.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin.equinox/src/org/eclipse/equinox/internal/frameworkadmin/equinox/utils/FileUtils.java
@@ -15,12 +15,12 @@ import java.io.*;
import java.net.*;
import java.util.*;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.frameworkadmin.equinox.*;
+import org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxConstants;
+import org.eclipse.equinox.internal.frameworkadmin.equinox.ParserUtils;
import org.eclipse.equinox.internal.provisional.frameworkadmin.LauncherData;
import org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator;
import org.eclipse.osgi.service.environment.Constants;
import org.osgi.framework.Version;
-import org.osgi.service.log.LogService;
public class FileUtils {
private static String FILE_SCHEME = "file"; //$NON-NLS-1$
@@ -80,8 +80,8 @@ public class FileUtils {
launcherPath = launcherPath.removeLastSegments(4);
launcherDir = launcherPath.toFile();
}
- } else if (EclipseLauncherParser.MACOSX_BUNDLED.equals(launcherData.getOS())) {
- Log.log(LogService.LOG_WARNING, "Problem figuring out the osgi install area. The bundled mode of macosx requires a -startup argument to be specified."); //$NON-NLS-1$
+ //} //else if (EclipseLauncherParser.MACOSX_BUNDLED.equals(launcherData.getOS())) {
+ // Log.log(LogService.LOG_WARNING, "Problem figuring out the osgi install area. The bundled mode of macosx requires a -startup argument to be specified."); //$NON-NLS-1$
} else
launcherDir = launcherData.getLauncher().getParentFile();
pluginsDir = new File(launcherDir, EquinoxConstants.PLUGINS_DIR);

Back to the top