diff options
7 files changed, 128 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/IProductDescriptor.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/IProductDescriptor.java index 56b46abab..d37be68f6 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/IProductDescriptor.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/IProductDescriptor.java @@ -119,6 +119,11 @@ public interface IProductDescriptor { public File getLocation(); /** + * Determines if the launchers should be included in the published product + */ + public boolean includeLaunchers(); + + /** * Returns the license URL for this product */ public String getLicenseURL(); diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java index 6fac40d04..546cf305c 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java @@ -35,6 +35,7 @@ public class ProductFile extends DefaultHandler implements IProductDescriptor { private static final String ATTRIBUTE_ICON = "icon"; //$NON-NLS-1$ protected static final String ATTRIBUTE_FRAGMENT = "fragment"; //$NON-NLS-1$ private static final String ATTRIBUTE_APPLICATION = "application"; //$NON-NLS-1$ + private static final String ATTRIBUTE_INCLUDE_LAUNCHERS = "includeLaunchers"; //$NON-NLS-1$ private static final String ATTRIBUTE_NAME = "name"; //$NON-NLS-1$ private static final String ATTRIBUTE_VALUE = "value"; //$NON-NLS-1$ private static final String ATTRIBUTE_LOCATION = "location"; //$NON-NLS-1$ @@ -140,6 +141,7 @@ public class ProductFile extends DefaultHandler implements IProductDescriptor { private File location; private List<BundleInfo> bundleInfos; private Map<String, String> properties; + private boolean includeLaunchers = true; private String licenseURL; private String licenseText = null; @@ -320,6 +322,10 @@ public class ProductFile extends DefaultHandler implements IProductDescriptor { return (version == null || version.length() == 0) ? "0.0.0" : version; //$NON-NLS-1$ } + public boolean includeLaunchers() { + return includeLaunchers; + } + /** * Returns the VM arguments for a specific platform. * If the empty string is used for the OS, this returns @@ -664,6 +670,8 @@ public class ProductFile extends DefaultHandler implements IProductDescriptor { uid = attributes.getValue(ATTRIBUTE_UID); productName = attributes.getValue(ATTRIBUTE_NAME); application = attributes.getValue(ATTRIBUTE_APPLICATION); + if (attributes.getIndex(ATTRIBUTE_INCLUDE_LAUNCHERS) >= 0) + includeLaunchers = Boolean.parseBoolean(attributes.getValue(ATTRIBUTE_INCLUDE_LAUNCHERS)); String use = attributes.getValue("useFeatures"); //$NON-NLS-1$ if (use != null) useFeatures = Boolean.valueOf(use).booleanValue(); diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java index 2f803f4c0..a5ad2675c 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/ProductAction.java @@ -48,7 +48,7 @@ public class ProductAction extends AbstractPublisherAction { // create all the actions needed to publish a product ArrayList<IPublisherAction> actions = new ArrayList<IPublisherAction>(); // products include the executable so add actions to publish them - if (getExecutablesLocation() != null) + if (getExecutablesLocation() != null && this.product.includeLaunchers()) actions.add(createApplicationExecutableAction(info.getConfigurations())); // add the actions that just configure things. actions.add(createConfigCUsAction()); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileTest.java index 246485315..0c16c79e4 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/publisher/actions/ProductFileTest.java @@ -25,6 +25,9 @@ public class ProductFileTest extends TestCase { String productFileLocation = null; ProductFile productFile = null; + ProductFile noLauncherFlag = null; + ProductFile falseLauncherFlag = null; + ProductFile trueLauncherFlag = null; String configFile = "/org.eclipse.equinox.p2.tests/testData/ProductActionTest/productWithConfig/config.ini"; private String uidProductFileLocation; @@ -32,6 +35,9 @@ public class ProductFileTest extends TestCase { protected void setUp() throws Exception { productFileLocation = TestData.getFile("ProductActionTest/productWithConfig", "sample.product").toString(); + noLauncherFlag = new ProductFile(TestData.getFile("ProductActionTest/launcherFlags", "noLauncherFlag.product").toString()); + falseLauncherFlag = new ProductFile(TestData.getFile("ProductActionTest/launcherFlags", "falseLauncherFlag.product").toString()); + trueLauncherFlag = new ProductFile(TestData.getFile("ProductActionTest/launcherFlags", "trueLauncherFlag.product").toString()); productFile = new ProductFile(productFileLocation); uidProductFileLocation = TestData.getFile("ProductActionTest/productWithConfig", "uidproduct.product").toString(); uidProductFile = new ProductFile(uidProductFileLocation); @@ -186,6 +192,12 @@ public class ProductFileTest extends TestCase { assertEquals("1.1", "vmArg -Dfoo=\"b a r\"", vmArguments); } + public void testIncludeLaunchers() { + assertEquals("1.0", true, noLauncherFlag.includeLaunchers()); + assertEquals("1.1", false, falseLauncherFlag.includeLaunchers()); + assertEquals("1.2", true, trueLauncherFlag.includeLaunchers()); + } + /** * Test method for {@link org.eclipse.equinox.internal.p2.publisher.eclipse.ProductFile#getProgramArguments(java.lang.String)}. */ diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/launcherFlags/falseLauncherFlag.product b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/launcherFlags/falseLauncherFlag.product new file mode 100644 index 000000000..e2499ceb8 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/launcherFlags/falseLauncherFlag.product @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="SampleProduct" version="1.0.0" useFeatures="false" includeLaunchers="false">
+
+ <configIni use="">
+ </configIni>
+
+ <launcherArgs>
+ </launcherArgs>
+
+ <windowImages/>
+
+ <launcher>
+ <solaris/>
+ <win useIco="false">
+ <bmp
+ winSmallLow="icon.bmp"/>
+ </win>
+ </launcher>
+
+ <vm>
+ </vm>
+
+ <plugins>
+ <plugin id="org.eclipse.core.commands" version="5.0.0"/>
+ </plugins>
+
+ <configurations>
+ <plugin id="org.eclipse.core.commands" autoStart="false" startLevel="2" />
+ </configurations>
+
+</product>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/launcherFlags/noLauncherFlag.product b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/launcherFlags/noLauncherFlag.product new file mode 100644 index 000000000..bfcb55b5a --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/launcherFlags/noLauncherFlag.product @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="SampleProduct" version="1.0.0" useFeatures="false">
+
+
+ <configIni>
+ </configIni>
+
+ <launcherArgs>
+ </launcherArgs>
+
+ <windowImages/>
+
+
+ <launcher>
+ <solaris/>
+ <win useIco="false">
+ <bmp
+ winSmallLow="icon.bmp"/>
+ </win>
+ </launcher>
+
+
+ <vm>
+ </vm>
+
+ <plugins>
+ <plugin id="org.eclipse.core.commands" version="5.0.0"/>
+ </plugins>
+
+ <configurations>
+ <plugin id="org.eclipse.core.commands" autoStart="false" startLevel="2" />
+ </configurations>
+
+</product>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/launcherFlags/trueLauncherFlag.product b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/launcherFlags/trueLauncherFlag.product new file mode 100644 index 000000000..5238f30b6 --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.tests/testData/ProductActionTest/launcherFlags/trueLauncherFlag.product @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="SampleProduct" version="1.0.0" useFeatures="false" includeLaunchers="true">
+
+ <configIni use="">
+ </configIni>
+
+ <launcherArgs>
+ </launcherArgs>
+
+ <windowImages/>
+
+ <launcher>
+ <solaris/>
+ <win useIco="false">
+ <bmp
+ winSmallLow="icon.bmp"/>
+ </win>
+ </launcher>
+
+ <vm>
+ </vm>
+
+ <plugins>
+ <plugin id="org.eclipse.core.commands" version="5.0.0"/>
+ </plugins>
+
+ <configurations>
+ <plugin id="org.eclipse.core.commands" autoStart="false" startLevel="2" />
+ </configurations>
+
+</product>
|