Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2012-04-27 21:10:50 -0400
committerPascal Rapicault2012-04-27 21:17:44 -0400
commit3ae7052955faa45c91b29e331a7e221cdd15562c (patch)
tree558db68be6e6064208881bf91f94fa7b78c5f2ed /bundles/org.eclipse.equinox.p2.touchpoint.eclipse
parent5f304d6941d7ccfa810a553d41d3900c77784a8e (diff)
downloadrt.equinox.p2-3ae7052955faa45c91b29e331a7e221cdd15562c.tar.gz
rt.equinox.p2-3ae7052955faa45c91b29e331a7e221cdd15562c.tar.xz
rt.equinox.p2-3ae7052955faa45c91b29e331a7e221cdd15562c.zip
Support for bundled macosx - http://bugs.eclipse.org/57349v20120428-0117
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.touchpoint.eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/LazyManipulator.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Messages.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java19
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/messages.properties4
6 files changed, 36 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF
index b3489952f..49a5fba04 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF
@@ -25,6 +25,7 @@ Import-Package: javax.xml.parsers,
org.eclipse.equinox.internal.provisional.p2.repository,
org.eclipse.equinox.internal.simpleconfigurator.manipulator,
org.eclipse.equinox.p2.core;version="[2.0.0,3.0.0)",
+ org.eclipse.equinox.p2.core.spi;version="[2.1.0,3.0.0)",
org.eclipse.equinox.p2.engine;version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.engine.spi;version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.metadata;version="[2.0.0,3.0.0)",
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 cafd922c4..4e8857043 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2012 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Pascal Rapicault - Support for bundled macosx http://bugs.eclipse.org/57349
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse;
@@ -47,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.getOSFromProfile(profile));
+ launcherData.setOS(Util.isMacOSBundled(profile) ? org.eclipse.equinox.p2.core.spi.Constants.MACOSX_BUNDLED : 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/Messages.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Messages.java
index 22f91b576..7af3b4186 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Messages.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Messages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 2012 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Pascal Rapicault - Support for bundled macosx http://bugs.eclipse.org/57349
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse;
@@ -33,6 +34,7 @@ public class Messages extends NLS {
public static String platform_config_unavailable;
public static String unexpected_prepareiu_error;
public static String error_validating_profile;
+ public static String invalid_macox_bundled_setup;
static {
// load message values from bundle file and assign to fields below
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java
index 6554a21b7..93578df48 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PlatformConfigurationWrapper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2012 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Pascal Rapicault - Support for bundled macosx http://bugs.eclipse.org/57349
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse;
@@ -15,6 +16,7 @@ import java.net.*;
import java.util.List;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.frameworkadmin.BundleInfo;
+import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.p2.update.*;
import org.eclipse.equinox.internal.provisional.frameworkadmin.LauncherData;
import org.eclipse.equinox.internal.provisional.frameworkadmin.Manipulator;
@@ -87,6 +89,12 @@ public class PlatformConfigurationWrapper {
}
}
}
+ if (org.eclipse.equinox.p2.core.spi.Constants.MACOSX_BUNDLED.equals(launcherData.getOS())) {
+ //We are in a situation where the launcher path is not set in the launcher file.
+ //The laid out installation is not going to work because the macos launcher looks 3 levels up for the launcher jars (see previous if).
+ //Log this fact and move on. Though we should probably fail.
+ LogHelper.log(Util.createError(Messages.invalid_macox_bundled_setup));
+ }
try {
return launcherFile.getParentFile().toURI().toURL();
} catch (MalformedURLException e) {
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 982e90f21..da9d01141 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2012 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
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Red Hat Incorporated - fix for bug 225145
* Code 9 - ongoing development
+ * Pascal Rapicault - Support for bundled macosx http://bugs.eclipse.org/57349
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse;
@@ -21,6 +22,7 @@ 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;
@@ -250,10 +252,19 @@ 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, getOSFromProfile(profile), getInstallFolder(profile));
+ String launcherName = getLauncherName(name, (isMacOSBundled(profile) ? Constants.MACOSX_BUNDLED : getOSFromProfile(profile)), getInstallFolder(profile));
return launcherName == null ? null : new File(getInstallFolder(profile), launcherName);
}
+ 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.
*/
@@ -271,6 +282,10 @@ 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$
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/messages.properties b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/messages.properties
index 81f1ab022..02939593a 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/messages.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2008, 2009 IBM Corporation and others.
+# Copyright (c) 2008, 2012 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
@@ -7,6 +7,7 @@
#
# Contributors:
# IBM Corporation - initial API and implementation
+# Pascal Rapicault - Support for bundled macosx http://bugs.eclipse.org/57349
###############################################################################
error_loading_manipulator=Error while loading manipulator.
@@ -28,3 +29,4 @@ platform_config_unavailable=Platform configuration not available.
unexpected_prepareiu_error=Unexpected state: prepareIU
error_validating_profile=Error validating profile {0}.
iu_contains_no_arifacts=Installable unit contains no artifacts: {0}.
+invalid_macox_bundled_setup=This macos bundled application is not setup correctly and will not start because of missing arguments in the eclipse.ini. Please review your p2 metadata in order to have the '-startup' argument be generated.

Back to the top