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 | |
parent | 585bbff7bc8689575c8bed80a66fabf174159ce9 (diff) | |
download | rt.equinox.p2-0fdb03cf79ad3493245ba7f37b6fda5775dbd836.tar.gz rt.equinox.p2-0fdb03cf79ad3493245ba7f37b6fda5775dbd836.tar.xz rt.equinox.p2-0fdb03cf79ad3493245ba7f37b6fda5775dbd836.zip |
WIP mac
19 files changed, 134 insertions, 85 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); diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/configuration/config.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/configuration/config.ini new file mode 100644 index 000000000..da41313b8 --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/configuration/config.ini @@ -0,0 +1,13 @@ +#This configuration file was written by: org.eclipse.equinox.internal.frameworkadmin.equinox.EquinoxFwConfigFileParser +#Thu Sep 25 06:00:00 EDT 2014 +org.eclipse.update.reconcile=false +eclipse.p2.profile=SDKProfile +osgi.instance.area.default=@user.home/Documents/workspace +osgi.framework=file\:plugins/org.eclipse.osgi.jar +osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator.jar@1\:start +org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info +eclipse.product=org.eclipse.platform.ide +osgi.splashPath=platform\:/base/plugins/org.eclipse.platform +eclipse.application=org.eclipse.ui.ide.workbench +eclipse.p2.data.area=@config.dir/../p2 +osgi.bundles.defaultStartLevel=4 diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/eclipse.ini b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/eclipse.ini new file mode 100644 index 000000000..2bdaa3b24 --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/eclipse.ini @@ -0,0 +1,14 @@ +-startup +../Eclipse/plugins/org.eclipse.equinox.launcher.jar +-showsplash +org.eclipse.platform +--launcher.XXMaxPermSize +256m +--launcher.defaultAction +openFile +--launcher.appendVmargs +-vmargs +-Xms40m +-Xdock:icon=../Resources/Eclipse.icns +-XstartOnFirstThread +-Dorg.eclipse.swt.internal.carbon.smallFonts
\ No newline at end of file diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/org.eclipse.equinox.simpleconfigurator/.baseBundlesInfoTimestamp b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/org.eclipse.equinox.simpleconfigurator/.baseBundlesInfoTimestamp new file mode 100644 index 000000000..8f71a23b8 --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/org.eclipse.equinox.simpleconfigurator/.baseBundlesInfoTimestamp @@ -0,0 +1,4 @@ +#Written by class org.eclipse.equinox.internal.simpleconfigurator.manipulator.SimpleConfiguratorManipulatorImpl +#Thu Sep 25 06:00:00 EDT 2014 +bundlesInfoTimestamp=1411639200000 +extTimestamp=-1 diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/org.eclipse.equinox.simpleconfigurator/bundles.info b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/org.eclipse.equinox.simpleconfigurator/bundles.info new file mode 100644 index 000000000..45b3c31e2 --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/org.eclipse.equinox.simpleconfigurator/bundles.info @@ -0,0 +1,4 @@ +#version=1 +org.eclipse.equinox.simpleconfigurator,0.1.0.200710172125,plugins/org.eclipse.equinox.simpleconfigurator.jar,1,true +org.eclipse.osgi,3.3.1.R33x_v20070828,plugins/org.eclipse.osgi.jar,-1,true +org.eclipse.equinox.launcher,1.0.200.v20081124-1800,plugins/org.eclipse.equinox.launcher.jar,4,false diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.equinox.launcher.jar b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.equinox.launcher.jar Binary files differnew file mode 100644 index 000000000..5947c8dee --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.equinox.launcher.jar diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.equinox.simpleconfigurator.jar b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.equinox.simpleconfigurator.jar Binary files differnew file mode 100644 index 000000000..8a631d83a --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.equinox.simpleconfigurator.jar diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.osgi.jar b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.osgi.jar Binary files differnew file mode 100644 index 000000000..20ca2696d --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.osgi.jar diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/MacOS/eclipse b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/MacOS/eclipse new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/MacOS/eclipse diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FwkAdminAndSimpleConfiguratorTest.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FwkAdminAndSimpleConfiguratorTest.java index a571c74cc..73334fe84 100644 --- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FwkAdminAndSimpleConfiguratorTest.java +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/FwkAdminAndSimpleConfiguratorTest.java @@ -47,7 +47,7 @@ public abstract class FwkAdminAndSimpleConfiguratorTest extends AbstractFwkAdmin configurationFolder = new File(installFolder, "configuration"); launcherName = "eclipse"; - boolean isMacOS = Constants.OS_MACOSX.equals(os) || EclipseLauncherParser.MACOSX_BUNDLED.equals(os); + boolean isMacOS = Constants.OS_MACOSX.equals(os); launcherPath = isMacOS ? new Path("Eclipse" + EclipseLauncherParser.MAC_OS_APP_FOLDER).append(launcherName) : new Path(launcherName); LauncherData launcherData = manipulator.getLauncherData(); diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup2.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup2.java new file mode 100644 index 000000000..58e6a5f58 --- /dev/null +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/MacOSLikeSetup2.java @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2008, 2010 IBM Corporation and others. All rights reserved. This + * program and the accompanying materials are made available under the terms of + * the Eclipse Public License v1.0 which accompanies this distribution, and is + * available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: IBM Corporation - initial API and implementation + ******************************************************************************/ +package org.eclipse.equinox.frameworkadmin.tests; + +import java.io.File; +import java.io.IOException; +import org.eclipse.equinox.internal.provisional.frameworkadmin.*; +import org.eclipse.osgi.service.environment.Constants; +import org.osgi.framework.BundleException; + +public class MacOSLikeSetup2 extends FwkAdminAndSimpleConfiguratorTest { + + public MacOSLikeSetup2(String name) { + super(name); + } + + public void testMacOSSetup() throws FrameworkAdminRuntimeException, IOException, BundleException { + FrameworkAdmin fwkAdmin = getEquinoxFrameworkAdmin(); + Manipulator manipulator = fwkAdmin.getManipulator(); + + File installFolder = new File("/home/pascal/git/rt.equinox.p2/bundles/org.eclipse.equinox.frameworkadmin.test/dataFile/mac/Eclipse.app/Contents/Eclipse"); + File configurationFolder = new File(installFolder, "configuration"); + File launcherFolder = new File(installFolder, "../MacOS/"); + File launcherName = new File(launcherFolder, "eclipse"); + + LauncherData launcherData = manipulator.getLauncherData(); + launcherData.setFwConfigLocation(configurationFolder); + launcherData.setLauncher(launcherName); +// launcherData.setLauncherConfigLocation(new File(installFolder, "eclipse.ini")); + launcherData.setOS(Constants.OS_MACOSX); + + manipulator.load(); + + assertTrue(manipulator.getLauncherData().getJvmArgs().length > 0); + } +} diff --git a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestVMArg.java b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestVMArg.java index d1a011457..536fe2924 100644 --- a/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestVMArg.java +++ b/bundles/org.eclipse.equinox.frameworkadmin.test/src/org/eclipse/equinox/frameworkadmin/tests/TestVMArg.java @@ -64,19 +64,19 @@ public class TestVMArg extends FwkAdminAndSimpleConfiguratorTest { assertContent("Relative JRE path must be present in " + launcherConfigFile, launcherConfigFile, expectedRelativePath); } - public void testVMInsideInstall_MacOS_BundledLayout() throws Exception { - m = createMinimalConfiguration(TestEclipseDataArea.class.getName(), EclipseLauncherParser.MACOSX_BUNDLED); - // note the difference the traditional layout: one segment less - final String expectedRelativePath = "../../jre"; - - File jreLocation = new File(m.getLauncherData().getLauncher().getParentFile(), expectedRelativePath); - m.getLauncherData().setJvm(jreLocation); - m.save(false); - - File launcherConfigFile = getLauncherConfigFile(); - assertNotContent("No absolute JRE path must be present in " + launcherConfigFile, launcherConfigFile, jreLocation.getAbsolutePath()); - assertContent("Relative JRE path must be present in " + launcherConfigFile, launcherConfigFile, expectedRelativePath); - } +// public void testVMInsideInstall_MacOS_BundledLayout() throws Exception { +// m = createMinimalConfiguration(TestEclipseDataArea.class.getName(), EclipseLauncherParser.MACOSX_BUNDLED); +// // note the difference the traditional layout: one segment less +// final String expectedRelativePath = "../../jre"; +// +// File jreLocation = new File(m.getLauncherData().getLauncher().getParentFile(), expectedRelativePath); +// m.getLauncherData().setJvm(jreLocation); +// m.save(false); +// +// File launcherConfigFile = getLauncherConfigFile(); +// assertNotContent("No absolute JRE path must be present in " + launcherConfigFile, launcherConfigFile, jreLocation.getAbsolutePath()); +// assertContent("Relative JRE path must be present in " + launcherConfigFile, launcherConfigFile, expectedRelativePath); +// } public void testVMOutsideInstall() throws FrameworkAdminRuntimeException, IOException { //Test VM path in the install folder diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/EquinoxExecutableAction.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/EquinoxExecutableAction.java index 423ec92e0..a8e6ca090 100644 --- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/EquinoxExecutableAction.java +++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/EquinoxExecutableAction.java @@ -197,16 +197,16 @@ public class EquinoxExecutableAction extends AbstractPublisherAction { private Map<String, String> computeInstallActions(ExecutablesDescriptor execDescriptor, String os) { Map<String, String> touchpointData = new HashMap<String, String>(); String configurationData = "unzip(source:@artifact, target:${installFolder});"; //$NON-NLS-1$ - if (org.eclipse.equinox.p2.core.spi.Constants.MACOSX_BUNDLED.equals(os)) { - String execName = execDescriptor.getExecutableName(); - String appName = guessMacAppName(execName); - configurationData = "unzip(source:@artifact, target:${installFolder}, path:" + appName + ".app);"; //$NON-NLS-1$ //$NON-NLS-2$ - configurationData += " chmod(targetDir:${installFolder}/Contents/MacOS/, targetFile:" + execName + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ - } else if (Constants.OS_MACOSX.equals(os)) { + // if (org.eclipse.equinox.p2.core.spi.Constants.MACOSX_BUNDLED.equals(os)) { + // String execName = execDescriptor.getExecutableName(); + // String appName = guessMacAppName(execName); + // configurationData = "unzip(source:@artifact, target:${installFolder}, path:" + appName + ".app);"; //$NON-NLS-1$ //$NON-NLS-2$ + // configurationData += " chmod(targetDir:${installFolder}/Contents/MacOS/, targetFile:" + execName + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ + // } else + if (Constants.OS_MACOSX.equals(os)) { String execName = execDescriptor.getExecutableName(); String appName = guessMacAppName(execName); - configurationData += " chmod(targetDir:${installFolder}/" + appName + ".app/Contents/MacOS/, targetFile:" + execName + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - configurationData += " ln(targetDir:${installFolder}, linkTarget:" + appName + ".app/Contents/MacOS/" + execName + ", linkName:" + execName + ");"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + configurationData += " chmod(targetDir:${installFolder}/../MacOS/, targetFile:" + execName + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } else if (!Constants.OS_WIN32.equals(os)) { // We are on linux/unix. by default set all of the files to be executable. File[] fileList = execDescriptor.getFiles(); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractSharedBundleProductTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractSharedBundleProductTest.java index 7ae4307d5..f2e886134 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractSharedBundleProductTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AbstractSharedBundleProductTest.java @@ -68,7 +68,6 @@ public class AbstractSharedBundleProductTest extends AbstractReconcilerTest { "org.eclipse.equinox.p2.metadata", // "org.eclipse.equinox.p2.metadata.repository", // "org.eclipse.equinox.p2.publisher", // - "org.eclipse.equinox.p2.ql", // "org.eclipse.equinox.p2.reconciler.dropins", // "org.eclipse.equinox.p2.repository", // "org.eclipse.equinox.p2.touchpoint.eclipse", // 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; } |