Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2015-03-03 15:07:07 +0000
committerPascal Rapicault2015-03-04 17:09:46 +0000
commit1b96ce896c49151b0e20fa49ba680d08415cca8f (patch)
treec7e1ac5374f0b10a82cc8d8ba057d957f91811b8 /bundles/org.eclipse.equinox.p2.publisher.eclipse
parent66c9297a230aeb57eb49d07f77eebf9c68d5b9ad (diff)
downloadrt.equinox.p2-1b96ce896c49151b0e20fa49ba680d08415cca8f.tar.gz
rt.equinox.p2-1b96ce896c49151b0e20fa49ba680d08415cca8f.tar.xz
rt.equinox.p2-1b96ce896c49151b0e20fa49ba680d08415cca8f.zip
Bug 431116 - Releases for Mac OS X should be bundled as a proper "Mac
App" and/or "Library" Change-Id: I2bdcc86960361f8268964b4e95bf0eb960dc3cd6 Signed-off-by: Pascal Rapicault <pascal@rapicorp.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.publisher.eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/BrandingIron.java86
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/InfoPListEditor.java189
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/EquinoxExecutableAction.java43
4 files changed, 235 insertions, 85 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 1bf34b7cd..ee15884af 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
@@ -7,7 +7,7 @@ Bundle-Activator: org.eclipse.pde.internal.publishing.Activator
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.eclipse.equinox.app;version="[1.0.0,2.0.0)",
org.eclipse.equinox.frameworkadmin;version="[2.0.0,3.0.0)",
org.eclipse.equinox.internal.frameworkadmin.equinox,
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/BrandingIron.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/BrandingIron.java
index 3cf2fe1b6..609e89aba 100644
--- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/BrandingIron.java
+++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/BrandingIron.java
@@ -12,6 +12,8 @@
package org.eclipse.equinox.internal.p2.publisher.eclipse;
import java.io.*;
+import java.util.List;
+import javax.xml.transform.TransformerException;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.pde.internal.publishing.Utils;
import org.eclipse.pde.internal.swt.tools.IconExe;
@@ -20,18 +22,6 @@ import org.eclipse.pde.internal.swt.tools.IconExe;
*
*/
public class BrandingIron {
- private static final String MARKER_NAME = "%EXECUTABLE_NAME%"; //$NON-NLS-1$
- private static final String BUNDLE_NAME = "%BUNDLE_NAME%"; //$NON-NLS-1$
- private static final String ICON_NAME = "%ICON_NAME%"; //$NON-NLS-1$
- private static final String MARKER_KEY = "<key>CFBundleExecutable</key>"; //$NON-NLS-1$
- private static final String BUNDLE_KEY = "<key>CFBundleName</key>"; //$NON-NLS-1$
- private static final String BUNDLE_ID_KEY = "<key>CFBundleIdentifier</key>"; //$NON-NLS-1$
- private static final String BUNDLE_INFO_KEY = "<key>CFBundleGetInfoString</key>"; //$NON-NLS-1$
- private static final String BUNDLE_VERSION_KEY = "<key>CFBundleVersion</key>"; //$NON-NLS-1$
- private static final String BUNDLE_SHORT_VERSION_KEY = "<key>CFBundleShortVersionString</key>"; //$NON-NLS-1$
- private static final String ICON_KEY = "<key>CFBundleIconFile</key>"; //$NON-NLS-1$
- private static final String STRING_START = "<string>"; //$NON-NLS-1$
- private static final String STRING_END = "</string>"; //$NON-NLS-1$
private static final String XDOC_ICON = "-Xdock:icon=../Resources/Eclipse.icns"; //$NON-NLS-1$
private static final String XDOC_ICON_PREFIX = "-Xdock:icon=../Resources/"; //$NON-NLS-1$
@@ -186,7 +176,7 @@ public class BrandingIron {
//Initialize the target folders
File root = descriptor.getLocation();
- File target = new File(root, applicationName + ".app/Contents"); //$NON-NLS-1$
+ File target = root;
target.mkdirs();
new File(target, "MacOS").mkdirs(); //$NON-NLS-1$
new File(target, "Resources").mkdirs(); //$NON-NLS-1$
@@ -505,29 +495,21 @@ public class BrandingIron {
private void modifyInfoPListFile(ExecutablesDescriptor descriptor, File initialRoot, File targetRoot, String iconName) {
File infoPList = new File(initialRoot, "Info.plist"); //$NON-NLS-1$
- StringBuffer buffer;
+ InfoPListEditor infoPListEditor = null;
try {
- buffer = readFile(infoPList);
+ infoPListEditor = InfoPListEditor.loadPListEditor(infoPList);
} catch (IOException e) {
- System.out.println("Impossible to brand info.plist file"); //$NON-NLS-1$
+ System.out.println("Impossible to create info.plist editor for " + infoPList.getAbsolutePath() + ". Caused by " + e.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
- int exePos = scan(buffer, 0, MARKER_NAME);
- if (exePos != -1)
- buffer.replace(exePos, exePos + MARKER_NAME.length(), name);
- else {
- replacePlistValue(buffer, MARKER_KEY, name);
- }
- int bundlePos = scan(buffer, 0, BUNDLE_NAME);
- if (bundlePos != -1)
- buffer.replace(bundlePos, bundlePos + BUNDLE_NAME.length(), name);
- else {
- replacePlistValue(buffer, BUNDLE_KEY, name);
- }
+ //Deal with error case
+ infoPListEditor.setKey(InfoPListEditor.MARKER_KEY, name);
+ infoPListEditor.setKey(InfoPListEditor.BUNDLE_KEY, name);
+ infoPListEditor.setKey(InfoPListEditor.BUNDLE_ID_KEY, id);
+ if (description != null)
+ infoPListEditor.setKey(InfoPListEditor.BUNDLE_INFO_KEY, description);
- replacePlistValue(buffer, BUNDLE_ID_KEY, id);
- replacePlistValue(buffer, BUNDLE_INFO_KEY, description);
if (version != null) {
// CFBundleShortVersionString is to be 3 segments only
// http://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-111349
@@ -536,28 +518,21 @@ public class BrandingIron {
sv.append(version.getSegmentCount() > 1 ? version.getSegment(1).toString() : "0"); //$NON-NLS-1$
sv.append('.');
sv.append(version.getSegmentCount() > 2 ? version.getSegment(2).toString() : "0"); //$NON-NLS-1$
- replacePlistValue(buffer, BUNDLE_VERSION_KEY, version.toString());
- replacePlistValue(buffer, BUNDLE_SHORT_VERSION_KEY, sv.toString());
+ infoPListEditor.setKey(InfoPListEditor.BUNDLE_VERSION_KEY, version.toString());
+ infoPListEditor.setKey(InfoPListEditor.BUNDLE_SHORT_VERSION_KEY, sv.toString());
}
if (iconName.length() > 0) {
- int iconPos = scan(buffer, 0, ICON_NAME);
- if (iconPos != -1) {
- buffer.replace(iconPos, iconPos + ICON_NAME.length(), iconName);
- } else {
- replacePlistValue(buffer, ICON_KEY, iconName);
- }
+ infoPListEditor.setKey(InfoPListEditor.ICON_KEY, iconName);
}
+ insertLauncherIni(infoPListEditor, descriptor.getExecutableName());
File target = new File(targetRoot, "Info.plist"); //$NON-NLS-1$;
try {
target.getParentFile().mkdirs();
- transferStreams(new ByteArrayInputStream(buffer.toString().getBytes()), new FileOutputStream(target));
- } catch (FileNotFoundException e) {
- System.out.println("Impossible to brand info.plist file"); //$NON-NLS-1$
- return;
- } catch (IOException e) {
- System.out.println("Impossible to brand info.plist file"); //$NON-NLS-1$
+ infoPListEditor.save(target);
+ } catch (TransformerException e) {
+ System.out.println("Impossible to save info.plist file " + target.getAbsolutePath()); //$NON-NLS-1$
return;
}
try {
@@ -569,18 +544,17 @@ public class BrandingIron {
descriptor.replace(infoPList, target);
}
- private void replacePlistValue(StringBuffer buffer, String key, String value) {
- if (value == null) {
- return;
- }
- int exePos = scan(buffer, 0, key);
- if (exePos != -1) {
- int start = scan(buffer, exePos + key.length(), STRING_START);
- int end = scan(buffer, start + STRING_START.length(), STRING_END);
- if (start > -1 && end > start) {
- buffer.replace(start + STRING_START.length(), end, value);
- }
- }
+ private void insertLauncherIni(InfoPListEditor infoPListEditor, String launcher) {
+ final String LAUNCHER_INI = "--launcher.ini"; //$NON-NLS-1$
+ List<String> args = infoPListEditor.getEclipseArguments();
+ int match = args.indexOf(LAUNCHER_INI);
+ if (match != -1) {
+ args.remove(LAUNCHER_INI);
+ args.remove(match + 1);
+ }
+ args.add(LAUNCHER_INI);
+ args.add("$APP_PACKAGE/Contents/Eclipse/" + launcher + ".ini"); //$NON-NLS-1$//$NON-NLS-2$
+ infoPListEditor.setEclipseArguments(args);
}
private int scan(StringBuffer buf, int start, String targetName) {
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/InfoPListEditor.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/InfoPListEditor.java
new file mode 100644
index 000000000..72c8885f4
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/InfoPListEditor.java
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Rapicorp, Inc 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:
+ * Rapicorp, Inc. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.publisher.eclipse;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.parsers.*;
+import javax.xml.transform.*;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.xpath.*;
+import org.w3c.dom.*;
+import org.xml.sax.SAXException;
+
+public class InfoPListEditor {
+ public static final String MARKER_KEY = "CFBundleExecutable"; //$NON-NLS-1$
+ public static final String BUNDLE_KEY = "CFBundleName"; //$NON-NLS-1$
+ public static final String BUNDLE_ID_KEY = "CFBundleIdentifier"; //$NON-NLS-1$
+ public static final String BUNDLE_INFO_KEY = "CFBundleGetInfoString"; //$NON-NLS-1$
+ public static final String BUNDLE_VERSION_KEY = "CFBundleVersion"; //$NON-NLS-1$
+ public static final String BUNDLE_SHORT_VERSION_KEY = "CFBundleShortVersionString"; //$NON-NLS-1$
+ public static final String ICON_KEY = "CFBundleIconFile"; //$NON-NLS-1$
+
+ private final Element infoPList;
+ private XPath xPathTool;
+ private final Document document;
+
+ private InfoPListEditor(Document doc) {
+ document = doc;
+ infoPList = document.getDocumentElement();
+ }
+
+ public static InfoPListEditor loadPListEditor(File file) throws IOException {
+ if (!file.exists()) {
+ throw new IOException("No file at " + file.getAbsoluteFile()); //$NON-NLS-1$
+ }
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder;
+ Exception exception;
+ try {
+ factory.setValidating(false);
+ factory.setNamespaceAware(true);
+ //These setFeature calls are necessary to disable the validation of the DTD in the info.plist
+ factory.setFeature("http://xml.org/sax/features/namespaces", false); //$NON-NLS-1$
+ factory.setFeature("http://xml.org/sax/features/validation", false); //$NON-NLS-1$
+ factory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false); //$NON-NLS-1$
+ factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); //$NON-NLS-1$
+ builder = factory.newDocumentBuilder();
+ return new InfoPListEditor(builder.parse(file));
+ } catch (ParserConfigurationException e) {
+ exception = e;
+ } catch (SAXException e) {
+ exception = e;
+ } catch (IOException e) {
+ exception = e;
+ }
+ throw new IOException("Problem parsing " + file.getAbsolutePath(), exception); //$NON-NLS-1$
+ }
+
+ public void save(File file) throws TransformerException {
+ final TransformerFactory transformerFactory = TransformerFactory.newInstance();
+ final Transformer transformer = transformerFactory.newTransformer();
+ final DOMSource toSerialize = new DOMSource(document);
+
+ final StreamResult output = new StreamResult(file);
+ transformer.setOutputProperty(OutputKeys.VERSION, "1.0"); //$NON-NLS-1$
+ transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
+ transformer.setOutputProperty(OutputKeys.STANDALONE, "yes"); //$NON-NLS-1$
+
+ transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
+ transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); //$NON-NLS-1$//$NON-NLS-2$
+
+ transformer.transform(toSerialize, output);
+ }
+
+ private Node getNode(Node node, String expression) throws XPathExpressionException {
+ return (Node) getXPathTool().evaluate(expression, node, XPathConstants.NODE);
+ }
+
+ public void setKey(String key, String value) {
+ if (key == null)
+ throw new IllegalArgumentException("Key can't be null"); //$NON-NLS-1$
+ if (value == null)
+ throw new IllegalArgumentException("Value can't be null"); //$NON-NLS-1$
+
+ String expression = String.format("/plist/dict/key[text() = '%s']/following-sibling::string[1]", key); //$NON-NLS-1$
+ Node node;
+ try {
+ node = getNode(infoPList, expression);
+ if (node != null)
+ node.getFirstChild().setNodeValue(value);
+ else
+ addKey(key, value);
+ } catch (XPathExpressionException e) {
+ //Can't happen since we craft the expression carefully
+ }
+ }
+
+ private void addKey(String key, String value) throws DOMException, XPathExpressionException {
+ Element keyNode = document.createElement("key"); //$NON-NLS-1$
+ Text keyName = document.createTextNode(key);
+ keyNode.appendChild(keyName);
+
+ Element stringNode = document.createElement("string"); //$NON-NLS-1$
+ Text stringValue = document.createTextNode(value);
+ stringNode.appendChild(stringValue);
+ getNode(infoPList, "/plist/dict").appendChild(keyNode); //$NON-NLS-1$
+ getNode(infoPList, "/plist/dict").appendChild(stringNode); //$NON-NLS-1$
+ }
+
+ private XPath getXPathTool() {
+ if (xPathTool == null) {
+ xPathTool = XPathFactory.newInstance().newXPath();
+ }
+ return xPathTool;
+ }
+
+ public void setEclipseArgument(String key, String value) {
+ if (key == null)
+ throw new IllegalArgumentException("Key can't be null"); //$NON-NLS-1$
+
+ String expression = "/plist/dict/key[text() = 'Eclipse']/following-sibling::array[1]/string[text() = -keyring'"; //$NON-NLS-1$
+ Node node;
+ try {
+ node = getNode(infoPList, expression);
+ if (node != null)
+ node.getFirstChild().setNodeValue(value);
+ else
+ addKey(key, value);
+ } catch (XPathExpressionException e) {
+ //Can't happen since we craft the expression carefully
+ }
+
+ }
+
+ private List<String> getValues(Object startingPoint, String expression) throws XPathExpressionException {
+ NodeList nodeList = (NodeList) getXPathTool().evaluate(expression, startingPoint, XPathConstants.NODESET);
+
+ List<String> result = new ArrayList<String>(nodeList.getLength());
+ for (int ix = 0; ix < nodeList.getLength(); ++ix) {
+ result.add(nodeList.item(ix).getNodeValue());
+ }
+ return result;
+ }
+
+ private List<Node> removeNodes(Object startingPoint, String expression) throws XPathExpressionException {
+ NodeList nodeList = (NodeList) getXPathTool().evaluate(expression, startingPoint, XPathConstants.NODESET);
+
+ List<Node> result = new ArrayList<Node>(nodeList.getLength());
+ for (int ix = 0; ix < nodeList.getLength(); ++ix) {
+ result.add(nodeList.item(ix).getParentNode().removeChild(nodeList.item(ix)));
+ }
+ return result;
+ }
+
+ public List<String> getEclipseArguments() {
+ try {
+ return getValues(infoPList, "/plist/dict/key[text() = 'Eclipse']/following-sibling::array[1]/string/text()"); //$NON-NLS-1$
+ } catch (XPathExpressionException e) {
+ //Can't happen the expression is carefully crafted
+ return null;
+ }
+ }
+
+ public void setEclipseArguments(List<String> arguments) {
+ try {
+ removeNodes(infoPList, "/plist/dict/key[text() = 'Eclipse']/following-sibling::array[1]/string"); //$NON-NLS-1$
+ for (String arg : arguments) {
+ Element stringNode = document.createElement("string"); //$NON-NLS-1$
+ Text stringName = document.createTextNode(arg);
+ stringNode.appendChild(stringName);
+ Node toAppendTo = getNode(infoPList, "/plist/dict/key[text() = 'Eclipse']/following-sibling::array[1]"); //$NON-NLS-1$
+ toAppendTo.appendChild(stringNode);
+ }
+ } catch (XPathExpressionException e) {
+ //can't happen
+ }
+ }
+} \ No newline at end of file
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..fdd0fbd44 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
@@ -15,7 +15,6 @@ 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.*;
@@ -158,10 +157,6 @@ public class EquinoxExecutableAction extends AbstractPublisherAction {
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);
@@ -182,32 +177,13 @@ public class EquinoxExecutableAction extends AbstractPublisherAction {
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));
- return MetadataFactory.createInstallableUnit(cu);
- }
-
private Map<String, String> computeInstallActions(ExecutablesDescriptor execDescriptor, String os) {
+ if (Constants.OS_MACOSX.equals(os))
+ return computeMacInstallActions(execDescriptor);
+
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)) {
- 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$
- } else if (!Constants.OS_WIN32.equals(os)) {
+ 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();
for (int i = 0; i < fileList.length; i++)
@@ -219,6 +195,17 @@ public class EquinoxExecutableAction extends AbstractPublisherAction {
return touchpointData;
}
+ private Map<String, String> computeMacInstallActions(ExecutablesDescriptor execDescriptor) {
+ Map<String, String> touchpointData = new HashMap<String, String>();
+ String configurationData = "unzip(source:@artifact, target:${installFolder}/../);"; //$NON-NLS-1$
+ String execName = execDescriptor.getExecutableName();
+ configurationData += " chmod(targetDir:${installFolder}/../MacOS/, targetFile:" + execName + ", permissions:755);"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ touchpointData.put("install", configurationData); //$NON-NLS-1$
+ String unConfigurationData = "cleanupzip(source:@artifact, target:${installFolder}/../);"; //$NON-NLS-1$
+ touchpointData.put("uninstall", unConfigurationData); //$NON-NLS-1$
+ return touchpointData;
+ }
+
private String guessMacAppName(String execName) {
// magic moved here from BrandingIron.brandMac for bug 342550; PDE build requires appName == execName
// TODO the application name for Mac really should be a parameter of the product configuration

Back to the top