Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2012-04-28 01:10:50 +0000
committerPascal Rapicault2012-04-28 01:17:44 +0000
commit3ae7052955faa45c91b29e331a7e221cdd15562c (patch)
tree558db68be6e6064208881bf91f94fa7b78c5f2ed /bundles/org.eclipse.equinox.p2.publisher.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.publisher.eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/META-INF/MANIFEST.MF1
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/EquinoxExecutableAction.java41
2 files changed, 36 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.publisher.eclipse/META-INF/MANIFEST.MF
index 941497863..2884ece1d 100644
--- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/META-INF/MANIFEST.MF
@@ -19,6 +19,7 @@ Import-Package: org.eclipse.equinox.app;version="[1.0.0,2.0.0)",
org.eclipse.equinox.internal.p2.publisher,
org.eclipse.equinox.internal.provisional.frameworkadmin,
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.metadata;version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.metadata.expression;version="[2.0.0,3.0.0)",
org.eclipse.equinox.p2.publisher,
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 9cd4e3517..423ec92e0 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
@@ -7,6 +7,7 @@
* Contributors:
* Code 9 - initial API and implementation
* IBM - ongoing development
+ * Pascal Rapicault - Support for bundled macosx http://bugs.eclipse.org/57349
******************************************************************************/
package org.eclipse.equinox.p2.publisher.eclipse;
@@ -14,6 +15,7 @@ import java.io.File;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
+import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
import org.eclipse.equinox.internal.p2.publisher.eclipse.BrandingIron;
import org.eclipse.equinox.internal.p2.publisher.eclipse.ExecutablesDescriptor;
import org.eclipse.equinox.p2.metadata.*;
@@ -151,6 +153,21 @@ public class EquinoxExecutableAction extends AbstractPublisherAction {
// Create the CU that installs (e.g., unzips) the executable
private void publishExecutableCU(ExecutablesDescriptor execDescriptor, IPublisherResult result) {
+ InstallableUnitFragmentDescription cu = createSkeletonExecutableCU(execDescriptor);
+ String[] config = parseConfigSpec(configSpec);
+ String os = config[1];
+ Map<String, String> touchpointData = computeInstallActions(execDescriptor, os);
+ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData));
+ if (Constants.OS_MACOSX.equals(os)) {
+ result.addIU(createBundledMacIU(execDescriptor), IPublisherResult.ROOT);
+ cu.setFilter(InstallableUnit.parseFilter("(& (!(macosx-bundled=*)) " + createLDAPString(configSpec) + ")")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ IInstallableUnit unit = MetadataFactory.createInstallableUnit(cu);
+ result.addIU(unit, IPublisherResult.ROOT);
+
+ }
+
+ private InstallableUnitFragmentDescription createSkeletonExecutableCU(ExecutablesDescriptor execDescriptor) {
InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription();
String id = createCUIdString(idBase, TYPE, flavor, configSpec);
cu.setId(id);
@@ -162,18 +179,30 @@ public class EquinoxExecutableAction extends AbstractPublisherAction {
//TODO bug 218890, would like the fragment to provide the launcher capability as well, but can't right now.
cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(id, version)});
cu.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE);
- String[] config = parseConfigSpec(configSpec);
- String os = config[1];
- Map<String, String> touchpointData = computeInstallActions(execDescriptor, os);
+ return cu;
+ }
+
+ private IInstallableUnit createBundledMacIU(ExecutablesDescriptor execDescriptor) {
+ InstallableUnitFragmentDescription cu = createSkeletonExecutableCU(execDescriptor);
+ String baseId = createCUIdString(idBase, TYPE, flavor, configSpec);
+ String id = baseId + "-bundled"; //$NON-NLS-1$
+ cu.setId(id);
+ cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(baseId, version), MetadataFactory.createProvidedCapability(IInstallableUnit.NAMESPACE_IU_ID, id, version)});
+ cu.setFilter(InstallableUnit.parseFilter("(&(macosx-bundled=true)" + createLDAPString(configSpec) + ")")); //$NON-NLS-1$//$NON-NLS-2$
+ Map<String, String> touchpointData = computeInstallActions(execDescriptor, org.eclipse.equinox.p2.core.spi.Constants.MACOSX_BUNDLED);
cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData));
- IInstallableUnit unit = MetadataFactory.createInstallableUnit(cu);
- result.addIU(unit, IPublisherResult.ROOT);
+ return MetadataFactory.createInstallableUnit(cu);
}
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 (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$

Back to the top