From 4a6a02ca1da43d67c3ecc0d3492cbbb292e88c64 Mon Sep 17 00:00:00 2001 From: Ed Merks Date: Mon, 11 Dec 2023 11:16:48 +0100 Subject: [PATCH] A simple circular requirement that should be properly filtered https://github.com/eclipse-tycho/tycho/issues/3197 --- .../bundle1/META-INF/MANIFEST.MF | 7 ++ .../p2Inf.circular/bundle1/META-INF/p2.inf | 5 ++ .../p2Inf.circular/bundle1/build.properties | 2 + .../projects/p2Inf.circular/bundle1/pom.xml | 16 ++++ .../bundle2/META-INF/MANIFEST.MF | 8 ++ .../p2Inf.circular/bundle2/build.properties | 2 + .../projects/p2Inf.circular/bundle2/pom.xml | 16 ++++ tycho-its/projects/p2Inf.circular/pom.xml | 79 +++++++++++++++++++ .../tycho/test/p2Inf/CircularTest.java | 27 +++++++ 9 files changed, 162 insertions(+) create mode 100644 tycho-its/projects/p2Inf.circular/bundle1/META-INF/MANIFEST.MF create mode 100644 tycho-its/projects/p2Inf.circular/bundle1/META-INF/p2.inf create mode 100644 tycho-its/projects/p2Inf.circular/bundle1/build.properties create mode 100644 tycho-its/projects/p2Inf.circular/bundle1/pom.xml create mode 100644 tycho-its/projects/p2Inf.circular/bundle2/META-INF/MANIFEST.MF create mode 100644 tycho-its/projects/p2Inf.circular/bundle2/build.properties create mode 100644 tycho-its/projects/p2Inf.circular/bundle2/pom.xml create mode 100644 tycho-its/projects/p2Inf.circular/pom.xml create mode 100644 tycho-its/src/test/java/org/eclipse/tycho/test/p2Inf/CircularTest.java diff --git a/tycho-its/projects/p2Inf.circular/bundle1/META-INF/MANIFEST.MF b/tycho-its/projects/p2Inf.circular/bundle1/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..db43244d0c --- /dev/null +++ b/tycho-its/projects/p2Inf.circular/bundle1/META-INF/MANIFEST.MF @@ -0,0 +1,7 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: circular.bundle1 +Bundle-SymbolicName: circular.bundle1;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: TEST +Bundle-RequiredExecutionEnvironment: JavaSE-17 diff --git a/tycho-its/projects/p2Inf.circular/bundle1/META-INF/p2.inf b/tycho-its/projects/p2Inf.circular/bundle1/META-INF/p2.inf new file mode 100644 index 0000000000..9e90c837bf --- /dev/null +++ b/tycho-its/projects/p2Inf.circular/bundle1/META-INF/p2.inf @@ -0,0 +1,5 @@ +# Require build2 at runtime but not at builtime. +requires.0.namespace=org.eclipse.equinox.p2.iu +requires.0.name=circular.bundle2 +requires.0.range=0.0.0 +requires.0.filter = (!(org.eclipse.circular.buildtime=true)) diff --git a/tycho-its/projects/p2Inf.circular/bundle1/build.properties b/tycho-its/projects/p2Inf.circular/bundle1/build.properties new file mode 100644 index 0000000000..7594fab8d5 --- /dev/null +++ b/tycho-its/projects/p2Inf.circular/bundle1/build.properties @@ -0,0 +1,2 @@ +bin.includes = META-INF/,\ + . diff --git a/tycho-its/projects/p2Inf.circular/bundle1/pom.xml b/tycho-its/projects/p2Inf.circular/bundle1/pom.xml new file mode 100644 index 0000000000..fc1cc235bf --- /dev/null +++ b/tycho-its/projects/p2Inf.circular/bundle1/pom.xml @@ -0,0 +1,16 @@ + + + 4.0.0 + + + tycho-its-project.p2Inf.circular + parent + 1.0.0-SNAPSHOT + + + circular.bundle1 + eclipse-plugin + + diff --git a/tycho-its/projects/p2Inf.circular/bundle2/META-INF/MANIFEST.MF b/tycho-its/projects/p2Inf.circular/bundle2/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..61ae634ef6 --- /dev/null +++ b/tycho-its/projects/p2Inf.circular/bundle2/META-INF/MANIFEST.MF @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: circular.bundle2 +Bundle-SymbolicName: circular.bundle2;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Vendor: TEST +Bundle-RequiredExecutionEnvironment: JavaSE-17 +Require-Bundle: circular.bundle1 diff --git a/tycho-its/projects/p2Inf.circular/bundle2/build.properties b/tycho-its/projects/p2Inf.circular/bundle2/build.properties new file mode 100644 index 0000000000..7594fab8d5 --- /dev/null +++ b/tycho-its/projects/p2Inf.circular/bundle2/build.properties @@ -0,0 +1,2 @@ +bin.includes = META-INF/,\ + . diff --git a/tycho-its/projects/p2Inf.circular/bundle2/pom.xml b/tycho-its/projects/p2Inf.circular/bundle2/pom.xml new file mode 100644 index 0000000000..3866a3811c --- /dev/null +++ b/tycho-its/projects/p2Inf.circular/bundle2/pom.xml @@ -0,0 +1,16 @@ + + + 4.0.0 + + + tycho-its-project.p2Inf.circular + parent + 1.0.0-SNAPSHOT + + + circular.bundle2 + eclipse-plugin + + diff --git a/tycho-its/projects/p2Inf.circular/pom.xml b/tycho-its/projects/p2Inf.circular/pom.xml new file mode 100644 index 0000000000..ccc61a0f82 --- /dev/null +++ b/tycho-its/projects/p2Inf.circular/pom.xml @@ -0,0 +1,79 @@ + + + 4.0.0 + + tycho-its-project.p2Inf.circular + parent + 1.0.0-SNAPSHOT + pom + + + 4.0.4 + + + + bundle1 + bundle2 + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + + + + + win32 + win32 + x86_64 + + + macosx + cocoa + x86_64 + + + macosx + cocoa + aarch64 + + + linux + gtk + x86_64 + + + linux + gtk + aarch64 + + + linux + gtk + ppc64le + + + + + true + + + + + + + + diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/p2Inf/CircularTest.java b/tycho-its/src/test/java/org/eclipse/tycho/test/p2Inf/CircularTest.java new file mode 100644 index 0000000000..b649fc2a17 --- /dev/null +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/p2Inf/CircularTest.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2023 Eclipse Contributors 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.p2Inf; + +import static java.util.Arrays.asList; + +import org.apache.maven.it.Verifier; +import org.eclipse.tycho.test.AbstractTychoIntegrationTest; +import org.junit.Test; + +/** + */ +public class CircularTest extends AbstractTychoIntegrationTest { + @Test + public void testVirtualUnitRequirementDoesNotFailBuild() throws Exception { + Verifier verifier = getVerifier("/p2Inf.circular", false); + verifier.executeGoals(asList("verify")); + verifier.verifyErrorFreeLog(); + } +}