Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Oberlies2012-03-02 17:52:47 +0000
committerTobias Oberlies2012-03-02 17:52:47 +0000
commitd798afdcc111e6169095fb291e4925490d3880b2 (patch)
tree5afb3c85a98e48990b1b3c65bd537632198c917f
parent91384a5355b53e448aa8e09b48800f10e6e49f36 (diff)
downloadrt.equinox.p2-d798afdcc111e6169095fb291e4925490d3880b2.tar.gz
rt.equinox.p2-d798afdcc111e6169095fb291e4925490d3880b2.tar.xz
rt.equinox.p2-d798afdcc111e6169095fb291e4925490d3880b2.zip
342550 Remove MacOS application folder name magic from BrandingIron
- In p2, we magically rename the application folder to "Eclipse.app" if the executable is "eclipse". PDE build, who are reusing the BrandingIron, however expect an "eclipse.app" folder. With this change, the rename magic is moved out of BrandingIron into the only user on the p2 side. - This should fix the PDE build test failure described reported as bug 368246. Bug: 342550 Follow-up: consolidate copies of ProductFile and BrandingIron Bug: 368246 Test failures in official build
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/BrandingIron.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/EquinoxExecutableAction.java5
2 files changed, 17 insertions, 10 deletions
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 6622fa176..90b967386 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -37,6 +37,8 @@ public class BrandingIron {
private String[] icons = null;
private String name;
+ private String applicationName;
+
private String description;
private String os = "win32"; //$NON-NLS-1$
private boolean brandIcons = true;
@@ -48,6 +50,16 @@ public class BrandingIron {
public void setName(String value) {
name = value;
+ if (applicationName == null) {
+ applicationName = value;
+ }
+ }
+
+ /**
+ * Sets the name for the MacOS "<i>ProductName</i>.app" folder.
+ */
+ public void setApplicationName(String value) {
+ applicationName = value;
}
public void setIcons(String[] value) {
@@ -172,15 +184,9 @@ public class BrandingIron {
//Because java does not support the rename of a folder, files are copied.
//Initialize the target folders
- String appName = name;
- if (appName.equals("eclipse")) //$NON-NLS-1$
- appName = "Eclipse"; //$NON-NLS-1$
- else if (appName.equals("launcher")) //$NON-NLS-1$
- appName = "Launcher"; //$NON-NLS-1$
-
File root = descriptor.getLocation();
- File target = new File(root, appName + ".app/Contents"); //$NON-NLS-1$
+ File target = new File(root, applicationName + ".app/Contents"); //$NON-NLS-1$
target.mkdirs();
new File(target, "MacOS").mkdirs(); //$NON-NLS-1$
new File(target, "Resources").mkdirs(); //$NON-NLS-1$
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 459d53105..9f71043e7 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Code 9 and others. All rights reserved. This
+ * Copyright (c) 2008, 2012 Code 9 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
@@ -190,7 +190,7 @@ public class EquinoxExecutableAction extends AbstractPublisherAction {
}
private String guessMacAppName(String execName) {
- // repeat magic from org.eclipse.equinox.internal.p2.publisher.eclipse.BrandingIron.brandMac to fix bug 352457
+ // 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
String appName = execName;
if (appName.equals("eclipse")) //$NON-NLS-1$
@@ -237,6 +237,7 @@ public class EquinoxExecutableAction extends AbstractPublisherAction {
if (name == null)
name = "eclipse"; //$NON-NLS-1$
iron.setName(name);
+ iron.setApplicationName(guessMacAppName(name));
iron.setOS(advice.getOS());
// FIXME: use product's aboutText as description?
// iron.setDescription(advice.getAboutText());

Back to the top