From 5b7fb9dccb8417e2efc7217f9d0db20e70afde36 Mon Sep 17 00:00:00 2001 From: Chris Lake Date: Fri, 19 Apr 2024 13:07:17 +1000 Subject: [PATCH 1/4] Issue 477 Tests created to test the need for the 'flavor' option within the tycho-p2-publisher-plugin --- .../nostart.product | 32 +++++ .../eclipse-repository-noconfig/pom.xml | 52 ++++++++ .../eclipse-repository-start4/pom.xml | 52 ++++++++ .../eclipse-repository-start4/start4.product | 33 +++++ .../eclipse-repository-start6/pom.xml | 52 ++++++++ .../eclipse-repository-start6/start6.product | 33 +++++ .../product-flavor/eclipserun.flavor/pom.xml | 125 ++++++++++++++++++ .../example-bundle/META-INF/MANIFEST.MF | 8 ++ .../example-bundle/build.properties | 14 ++ .../product-flavor/example-bundle/pom.xml | 17 +++ .../src/example/bundle/Activator.java | 41 ++++++ .../example-feature/build.properties | 11 ++ .../example-feature/feature.xml | 30 +++++ .../product-flavor/example-feature/pom.xml | 17 +++ .../product-flavor/pom.xml | 53 ++++++++ .../target-definition/flavor.target | 12 ++ .../product-flavor/target-definition/pom.xml | 16 +++ .../tycho/test/product/ProductFlavorTest.java | 83 ++++++++++++ 18 files changed, 681 insertions(+) create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/nostart.product create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/pom.xml create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/pom.xml create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/start4.product create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/pom.xml create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/start6.product create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipserun.flavor/pom.xml create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/META-INF/MANIFEST.MF create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/build.properties create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/pom.xml create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/src/example/bundle/Activator.java create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/build.properties create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/feature.xml create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/pom.xml create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/pom.xml create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/flavor.target create mode 100644 tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/pom.xml create mode 100644 tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/nostart.product b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/nostart.product new file mode 100644 index 0000000000..86f1244b14 --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/nostart.product @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/pom.xml b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/pom.xml new file mode 100644 index 0000000000..28a5ffbe05 --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + + tycho-its-project.product-flavor + product-flavor.parent + 1.0.0-SNAPSHOT + + + flavor.product.noconfig + eclipse-repository + + + + + + org.eclipse.tycho + tycho-p2-director-plugin + ${tycho-version} + + + + noconfig.product.id + noconfig + + + ConfiguredDefaultProfileName + + + + org.eclipse.tycho + tycho-p2-repository-plugin + ${tycho-version} + + ${basedir}/../repository + false + + + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/pom.xml b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/pom.xml new file mode 100644 index 0000000000..8c97f26aca --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + + tycho-its-project.product-flavor + product-flavor.parent + 1.0.0-SNAPSHOT + + + flavor.product.start4 + eclipse-repository + + + + + + org.eclipse.tycho + tycho-p2-director-plugin + ${tycho-version} + + + + start4.product.id + start4 + + + ConfiguredDefaultProfileName + + + + org.eclipse.tycho + tycho-p2-repository-plugin + ${tycho-version} + + ${basedir}/../repository + false + + + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/start4.product b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/start4.product new file mode 100644 index 0000000000..e73a4efe10 --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/start4.product @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/pom.xml b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/pom.xml new file mode 100644 index 0000000000..14e0c1e130 --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + + tycho-its-project.product-flavor + product-flavor.parent + 1.0.0-SNAPSHOT + + + flavor.product.start6 + eclipse-repository + + + + + + org.eclipse.tycho + tycho-p2-director-plugin + ${tycho-version} + + + + start6.product.id + start6 + + + ConfiguredDefaultProfileName + + + + org.eclipse.tycho + tycho-p2-repository-plugin + ${tycho-version} + + ${basedir}/../repository + false + + + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/start6.product b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/start6.product new file mode 100644 index 0000000000..66f28fbd86 --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/start6.product @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipserun.flavor/pom.xml b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipserun.flavor/pom.xml new file mode 100644 index 0000000000..3c9589de5b --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipserun.flavor/pom.xml @@ -0,0 +1,125 @@ + + + + 4.0.0 + + tycho-its-project.product-flavor.eclipserun + flavor-startlevel + 1.0.0-SNAPSHOT + pom + + + + org.eclipse.tycho.extras + tycho-eclipserun-plugin + ${tycho-version} + + + + eclipse-run + + compile + + + -application + org.eclipse.equinox.p2.director + -nosplash + -consoleLog + -flavor + ${env.PRODUCT_FLAVOR} + -destination + ${env.PRODUCT_DESTINATION} + -installIU + ${env.PRODUCT_INSTALLIU} + -repository + ${env.PRODUCT_REPOSITORY} + + + + + + + + 4.23 + p2 + https://download.eclipse.org/eclipse/updates/4.23/ + + + + + org.eclipse.ant.core + eclipse-plugin + + + org.apache.ant + eclipse-plugin + + + org.eclipse.core.net + eclipse-plugin + + + org.eclipse.core.net.win32.x86_64 + eclipse-plugin + + + org.eclipse.pde.core + eclipse-plugin + + + org.eclipse.ecf.filetransfer + eclipse-plugin + + + org.eclipse.ecf.provider.filetransfer + eclipse-plugin + + + org.eclipse.ecf.provider.filetransfer.httpclient5 + eclipse-plugin + + + org.eclipse.ecf.provider.filetransfer.httpclient5.win32 + eclipse-plugin + + + org.eclipse.ecf.provider.filetransfer.ssl + eclipse-plugin + + + org.eclipse.ecf.ssl + eclipse-plugin + + + org.eclipse.equinox.p2.touchpoint.natives + eclipse-plugin + + + org.eclipse.equinox.p2.transport.ecf + eclipse-plugin + + + org.eclipse.osgi.services + eclipse-plugin + + + org.eclipse.osgi.compatibility.state + eclipse-plugin + + + + + + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/META-INF/MANIFEST.MF b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..5c1a311b9a --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/META-INF/MANIFEST.MF @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Bundle +Bundle-SymbolicName: flavor.example.bundle +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: example.bundle.Activator +Bundle-ActivationPolicy: lazy +Import-Package: org.osgi.framework;version="1.3.0" diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/build.properties b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/build.properties new file mode 100644 index 0000000000..a3fce8d935 --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/build.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 2010, 2011 SAP AG 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 +# https://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# SAP AG - initial API and implementation +############################################################################### +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/pom.xml b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/pom.xml new file mode 100644 index 0000000000..77d2828f7c --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + + tycho-its-project.product-flavor + product-flavor.parent + 1.0.0-SNAPSHOT + + + flavor.example.bundle + eclipse-plugin + Example Bundle + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/src/example/bundle/Activator.java b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/src/example/bundle/Activator.java new file mode 100644 index 0000000000..eed844bd1a --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/src/example/bundle/Activator.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 SAP AG and others. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * SAP AG - initial API and implementation + *******************************************************************************/ +package example.bundle; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator + implements BundleActivator +{ + + private static BundleContext context; + + static BundleContext getContext() + { + return context; + } + + public void start( BundleContext bundleContext ) + throws Exception + { + Activator.context = bundleContext; + } + + public void stop( BundleContext bundleContext ) + throws Exception + { + Activator.context = null; + } + +} diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/build.properties b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/build.properties new file mode 100644 index 0000000000..0b6dc2b511 --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/build.properties @@ -0,0 +1,11 @@ +############################################################################### +# Copyright (c) 2010, 2011 SAP AG 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 +# https://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# SAP AG - initial API and implementation +############################################################################### +bin.includes = feature.xml diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/feature.xml b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/feature.xml new file mode 100644 index 0000000000..28ceb53578 --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/feature.xml @@ -0,0 +1,30 @@ + + + + + A description of an example feature + + + + [Enter Copyright Description here.] + + + + [Enter License Description here.] + + + + + + + + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/pom.xml b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/pom.xml new file mode 100644 index 0000000000..0dea4a132d --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + + tycho-its-project.product-flavor + product-flavor.parent + 1.0.0-SNAPSHOT + + + flavor.example.feature + eclipse-feature + Example Feature + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/pom.xml b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/pom.xml new file mode 100644 index 0000000000..e45f34a7b7 --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + tycho-its-project.product-flavor + product-flavor.parent + 1.0.0-SNAPSHOT + pom + + + eclipse-repository-start6 + eclipse-repository-start4 + eclipse-repository-noconfig + target-definition + example-bundle + example-feature + + + + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + JavaSE-11 + p2 + + + ${project.groupId} + flavor.target-definition + ${project.version} + + + true + + + win32 + win32 + x86_64 + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/flavor.target b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/flavor.target new file mode 100644 index 0000000000..347c334e1a --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/flavor.target @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/pom.xml b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/pom.xml new file mode 100644 index 0000000000..77a999031f --- /dev/null +++ b/tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/pom.xml @@ -0,0 +1,16 @@ + + + 4.0.0 + + + tycho-its-project.product-flavor + product-flavor.parent + 1.0.0-SNAPSHOT + + + flavor.target-definition + eclipse-target-definition + Example Target Definition + + diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java new file mode 100644 index 0000000000..fce78329ca --- /dev/null +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2022 Red Hat Inc. and others. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +package org.eclipse.tycho.test.product; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +import java.io.File; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; + +import org.apache.maven.it.Verifier; +import org.eclipse.tycho.test.AbstractTychoIntegrationTest; +import org.junit.BeforeClass; +import org.junit.Test; + +public class ProductFlavorTest extends AbstractTychoIntegrationTest { + + private static Verifier verifier; + + @BeforeClass + public static void buildProduct() throws Exception { + verifier = new ProductFlavorTest().getVerifier("tycho-p2-director-plugin/product-flavor", false); + + verifier.executeGoals(Arrays.asList("clean", "install")); + verifier.verifyErrorFreeLog(); + } + + @Test + public void testProductStart6() throws Exception { + runTest("start6", "6", "true"); + } + + @Test + public void testProductStart4() throws Exception { + runTest("start4", "4", "true"); + } + + @Test + public void testProductNoConfig() throws Exception { + runTest("noconfig", "4", "false"); + } + + private void runTest(String name, String startLevel, String autoStart) throws Exception { + Path repoBaseDir = Path.of(verifier.getBasedir()); + Path repoPath = repoBaseDir.resolve("repository"); + + Verifier testVerifier = getVerifier("tycho-p2-director-plugin/product-flavor/eclipserun.flavor", false); + // testVerifier.setEnvironmentVariable("PRODUCT_FLAVOR", name); + testVerifier.setEnvironmentVariable("PRODUCT_FLAVOR", "tooling"); + testVerifier.setEnvironmentVariable("PRODUCT_DESTINATION", name); + testVerifier.setEnvironmentVariable("PRODUCT_INSTALLIU", name + ".product.id"); + testVerifier.setEnvironmentVariable("PRODUCT_REPOSITORY", repoPath.toUri().toString()); + testVerifier.executeGoal("package"); + testVerifier.verifyErrorFreeLog(); + + Path baseDir = Path.of(testVerifier.getBasedir()); + File configFile = baseDir.resolve(name).resolve("configuration/org.eclipse.equinox.simpleconfigurator") + .toFile(); + + File[] bundleInfoFiles = assertFileExists(configFile, "bundles.info"); + for (String bundleInfo : Files.readAllLines(bundleInfoFiles[0].toPath(), StandardCharsets.UTF_8)) { + String[] parts = bundleInfo.split(","); + if (parts.length == 5 && "flavor.example.bundle".equals(parts[0])) { + assertEquals("Start level of example.bundle in product '" + name + "' does not match", startLevel, + parts[3]); + assertEquals("Autostart of example.bundle in product '" + name + "' does not match", autoStart, + parts[4]); + return; + } + } + fail("'example.bundle' was not found in product '" + name + "' in simpleconfigurator bundles.info"); + } +} From 21440bbef3f6dc1362aaf6fd6952e264df8aa040 Mon Sep 17 00:00:00 2001 From: Chris Lake Date: Fri, 19 Apr 2024 13:18:37 +1000 Subject: [PATCH 2/4] Issue 477 Relocate tests --- .../eclipse-repository-noconfig/nostart.product | 0 .../eclipse-repository-noconfig/pom.xml | 0 .../eclipse-repository-start4/pom.xml | 0 .../eclipse-repository-start4/start4.product | 0 .../eclipse-repository-start6/pom.xml | 0 .../eclipse-repository-start6/start6.product | 0 .../eclipserun}/pom.xml | 0 .../example-bundle/META-INF/MANIFEST.MF | 0 .../example-bundle/build.properties | 0 .../example-bundle/pom.xml | 0 .../example-bundle/src/example/bundle/Activator.java | 0 .../example-feature/build.properties | 0 .../example-feature/feature.xml | 0 .../example-feature/pom.xml | 0 .../product-flavor => eclipserun.flavor}/pom.xml | 0 .../target-definition/flavor.target | 0 .../target-definition/pom.xml | 0 .../org/eclipse/tycho/test/product/ProductFlavorTest.java | 4 ++-- 18 files changed, 2 insertions(+), 2 deletions(-) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/eclipse-repository-noconfig/nostart.product (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/eclipse-repository-noconfig/pom.xml (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/eclipse-repository-start4/pom.xml (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/eclipse-repository-start4/start4.product (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/eclipse-repository-start6/pom.xml (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/eclipse-repository-start6/start6.product (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor/eclipserun.flavor => eclipserun.flavor/eclipserun}/pom.xml (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/example-bundle/META-INF/MANIFEST.MF (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/example-bundle/build.properties (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/example-bundle/pom.xml (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/example-bundle/src/example/bundle/Activator.java (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/example-feature/build.properties (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/example-feature/feature.xml (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/example-feature/pom.xml (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/pom.xml (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/target-definition/flavor.target (100%) rename tycho-its/projects/{tycho-p2-director-plugin/product-flavor => eclipserun.flavor}/target-definition/pom.xml (100%) diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/nostart.product b/tycho-its/projects/eclipserun.flavor/eclipse-repository-noconfig/nostart.product similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/nostart.product rename to tycho-its/projects/eclipserun.flavor/eclipse-repository-noconfig/nostart.product diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/pom.xml b/tycho-its/projects/eclipserun.flavor/eclipse-repository-noconfig/pom.xml similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-noconfig/pom.xml rename to tycho-its/projects/eclipserun.flavor/eclipse-repository-noconfig/pom.xml diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/pom.xml b/tycho-its/projects/eclipserun.flavor/eclipse-repository-start4/pom.xml similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/pom.xml rename to tycho-its/projects/eclipserun.flavor/eclipse-repository-start4/pom.xml diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/start4.product b/tycho-its/projects/eclipserun.flavor/eclipse-repository-start4/start4.product similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start4/start4.product rename to tycho-its/projects/eclipserun.flavor/eclipse-repository-start4/start4.product diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/pom.xml b/tycho-its/projects/eclipserun.flavor/eclipse-repository-start6/pom.xml similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/pom.xml rename to tycho-its/projects/eclipserun.flavor/eclipse-repository-start6/pom.xml diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/start6.product b/tycho-its/projects/eclipserun.flavor/eclipse-repository-start6/start6.product similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipse-repository-start6/start6.product rename to tycho-its/projects/eclipserun.flavor/eclipse-repository-start6/start6.product diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipserun.flavor/pom.xml b/tycho-its/projects/eclipserun.flavor/eclipserun/pom.xml similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/eclipserun.flavor/pom.xml rename to tycho-its/projects/eclipserun.flavor/eclipserun/pom.xml diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/META-INF/MANIFEST.MF b/tycho-its/projects/eclipserun.flavor/example-bundle/META-INF/MANIFEST.MF similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/META-INF/MANIFEST.MF rename to tycho-its/projects/eclipserun.flavor/example-bundle/META-INF/MANIFEST.MF diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/build.properties b/tycho-its/projects/eclipserun.flavor/example-bundle/build.properties similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/build.properties rename to tycho-its/projects/eclipserun.flavor/example-bundle/build.properties diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/pom.xml b/tycho-its/projects/eclipserun.flavor/example-bundle/pom.xml similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/pom.xml rename to tycho-its/projects/eclipserun.flavor/example-bundle/pom.xml diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/src/example/bundle/Activator.java b/tycho-its/projects/eclipserun.flavor/example-bundle/src/example/bundle/Activator.java similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-bundle/src/example/bundle/Activator.java rename to tycho-its/projects/eclipserun.flavor/example-bundle/src/example/bundle/Activator.java diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/build.properties b/tycho-its/projects/eclipserun.flavor/example-feature/build.properties similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/build.properties rename to tycho-its/projects/eclipserun.flavor/example-feature/build.properties diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/feature.xml b/tycho-its/projects/eclipserun.flavor/example-feature/feature.xml similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/feature.xml rename to tycho-its/projects/eclipserun.flavor/example-feature/feature.xml diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/pom.xml b/tycho-its/projects/eclipserun.flavor/example-feature/pom.xml similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/example-feature/pom.xml rename to tycho-its/projects/eclipserun.flavor/example-feature/pom.xml diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/pom.xml b/tycho-its/projects/eclipserun.flavor/pom.xml similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/pom.xml rename to tycho-its/projects/eclipserun.flavor/pom.xml diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/flavor.target b/tycho-its/projects/eclipserun.flavor/target-definition/flavor.target similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/flavor.target rename to tycho-its/projects/eclipserun.flavor/target-definition/flavor.target diff --git a/tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/pom.xml b/tycho-its/projects/eclipserun.flavor/target-definition/pom.xml similarity index 100% rename from tycho-its/projects/tycho-p2-director-plugin/product-flavor/target-definition/pom.xml rename to tycho-its/projects/eclipserun.flavor/target-definition/pom.xml diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java index fce78329ca..1a75845a4f 100644 --- a/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java @@ -29,7 +29,7 @@ public class ProductFlavorTest extends AbstractTychoIntegrationTest { @BeforeClass public static void buildProduct() throws Exception { - verifier = new ProductFlavorTest().getVerifier("tycho-p2-director-plugin/product-flavor", false); + verifier = new ProductFlavorTest().getVerifier("eclipserun.flavor", false); verifier.executeGoals(Arrays.asList("clean", "install")); verifier.verifyErrorFreeLog(); @@ -54,7 +54,7 @@ private void runTest(String name, String startLevel, String autoStart) throws Ex Path repoBaseDir = Path.of(verifier.getBasedir()); Path repoPath = repoBaseDir.resolve("repository"); - Verifier testVerifier = getVerifier("tycho-p2-director-plugin/product-flavor/eclipserun.flavor", false); + Verifier testVerifier = getVerifier("eclipserun.flavor/eclipserun", false); // testVerifier.setEnvironmentVariable("PRODUCT_FLAVOR", name); testVerifier.setEnvironmentVariable("PRODUCT_FLAVOR", "tooling"); testVerifier.setEnvironmentVariable("PRODUCT_DESTINATION", name); From d45a5fb9a3e68a5fcf0def9372de47f0cb2532fb Mon Sep 17 00:00:00 2001 From: Chris Lake Date: Fri, 19 Apr 2024 13:20:26 +1000 Subject: [PATCH 3/4] Issue 477 Tycho renamed the plugin in v5 Apply fix --- .../eclipse-repository-noconfig/pom.xml | 10 ---------- .../eclipse-repository-start4/pom.xml | 2 -- .../eclipse-repository-start6/pom.xml | 2 -- .../projects/eclipserun.flavor/eclipserun/pom.xml | 4 ++-- .../tycho/test/product/ProductFlavorTest.java | 3 +-- .../plugins/p2/publisher/PublishProductMojo.java | 13 ++++++++++--- 6 files changed, 13 insertions(+), 21 deletions(-) diff --git a/tycho-its/projects/eclipserun.flavor/eclipse-repository-noconfig/pom.xml b/tycho-its/projects/eclipserun.flavor/eclipse-repository-noconfig/pom.xml index 28a5ffbe05..65a27213cf 100644 --- a/tycho-its/projects/eclipserun.flavor/eclipse-repository-noconfig/pom.xml +++ b/tycho-its/projects/eclipserun.flavor/eclipse-repository-noconfig/pom.xml @@ -14,16 +14,6 @@ - org.eclipse.tycho tycho-p2-director-plugin diff --git a/tycho-its/projects/eclipserun.flavor/eclipse-repository-start4/pom.xml b/tycho-its/projects/eclipserun.flavor/eclipse-repository-start4/pom.xml index 8c97f26aca..9a4d381418 100644 --- a/tycho-its/projects/eclipserun.flavor/eclipse-repository-start4/pom.xml +++ b/tycho-its/projects/eclipserun.flavor/eclipse-repository-start4/pom.xml @@ -14,7 +14,6 @@ - org.eclipse.tycho tycho-p2-director-plugin diff --git a/tycho-its/projects/eclipserun.flavor/eclipse-repository-start6/pom.xml b/tycho-its/projects/eclipserun.flavor/eclipse-repository-start6/pom.xml index 14e0c1e130..a3d5500249 100644 --- a/tycho-its/projects/eclipserun.flavor/eclipse-repository-start6/pom.xml +++ b/tycho-its/projects/eclipserun.flavor/eclipse-repository-start6/pom.xml @@ -14,7 +14,6 @@ - org.eclipse.tycho tycho-p2-director-plugin diff --git a/tycho-its/projects/eclipserun.flavor/eclipserun/pom.xml b/tycho-its/projects/eclipserun.flavor/eclipserun/pom.xml index 3c9589de5b..f5eedc80ad 100644 --- a/tycho-its/projects/eclipserun.flavor/eclipserun/pom.xml +++ b/tycho-its/projects/eclipserun.flavor/eclipserun/pom.xml @@ -20,8 +20,8 @@ - org.eclipse.tycho.extras - tycho-eclipserun-plugin + org.eclipse.tycho + tycho-eclipse-plugin ${tycho-version} diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java index 1a75845a4f..598875f873 100644 --- a/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/product/ProductFlavorTest.java @@ -55,8 +55,7 @@ private void runTest(String name, String startLevel, String autoStart) throws Ex Path repoPath = repoBaseDir.resolve("repository"); Verifier testVerifier = getVerifier("eclipserun.flavor/eclipserun", false); - // testVerifier.setEnvironmentVariable("PRODUCT_FLAVOR", name); - testVerifier.setEnvironmentVariable("PRODUCT_FLAVOR", "tooling"); + testVerifier.setEnvironmentVariable("PRODUCT_FLAVOR", name); testVerifier.setEnvironmentVariable("PRODUCT_DESTINATION", name); testVerifier.setEnvironmentVariable("PRODUCT_INSTALLIU", name + ".product.id"); testVerifier.setEnvironmentVariable("PRODUCT_REPOSITORY", repoPath.toUri().toString()); diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java index 33665bacbb..30e18bc7ff 100644 --- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java +++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java @@ -80,9 +80,16 @@ public final class PublishProductMojo extends AbstractPublishMojo { private static final Version LUNA_SR2_EXECUTABLE_FEATURE_VERSION = Version.parseVersion("3.6.102.v20150204-1316"); /** - * The name of the p2 installation flavor to create. "tooling" in all uses of p2. + *

+ * The name of the p2 installation flavor to create. De facto, this parameter is set to + * "tooling" in all uses of p2. + *

+ * + * @deprecated This parameter has no useful effect and may be removed in a future version of + * Tycho. */ - private static final String FLAVOR = "tooling"; + @Parameter(defaultValue = "tooling") + private String flavor; @Component(role = UnArchiver.class, hint = "zip") private UnArchiver deflater; @@ -126,7 +133,7 @@ protected Collection publishContent(PublisherServiceFactory publ boolean includeLaunchers = productConfiguration.includeLaunchers(); seeds.addAll(publisher.publishProduct(productFile, - includeLaunchers ? getExpandedLauncherBinaries() : null, FLAVOR)); + includeLaunchers ? getExpandedLauncherBinaries() : null, flavor)); hasLaunchers |= includeLaunchers; } catch (IOException e) { throw new MojoExecutionException( From 81c8f25994985f7f1f21c308f0ee471b366fa942 Mon Sep 17 00:00:00 2001 From: Chris Lake Date: Fri, 19 Apr 2024 13:56:54 +1000 Subject: [PATCH 4/4] Issue 477 Remove deprectated tag --- .../eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java index 30e18bc7ff..66cc81b00b 100644 --- a/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java +++ b/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java @@ -84,9 +84,6 @@ public final class PublishProductMojo extends AbstractPublishMojo { * The name of the p2 installation flavor to create. De facto, this parameter is set to * "tooling" in all uses of p2. *

- * - * @deprecated This parameter has no useful effect and may be removed in a future version of - * Tycho. */ @Parameter(defaultValue = "tooling") private String flavor;