Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IT test for Issue 4653 #4688

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: dependee
Bundle-SymbolicName: dependee
Bundle-Version: 0.0.1.qualifier
Export-Package: dependee,
org.apache.commons.lang3
Bundle-ClassPath: .,
lib/commons-lang3.jar
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source.. = src/
output.. = classes/
bin.includes = META-INF/,\
.,\
lib/commons-lang3.jar
45 changes: 45 additions & 0 deletions tycho-its/projects/target.eagerResolver/dependee/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tycho-its-project.osgitools.artifactsWithKnownLocation</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dependee</artifactId>
<packaging>eclipse-plugin</packaging>
<properties>
<commons-lang3.version>3.17.0</commons-lang3.version>
</properties>
<!-- Taken and adapted from https://stackoverflow.com/questions/28542595/how-to-embed-a-library-jar-in-an-osgi-bundle-using-tycho/30872071#30872071 -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-libraries</id>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<item>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</item>
</artifactItems>
<outputDirectory>lib</outputDirectory>
<stripVersion>true</stripVersion>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* 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 dependee;
zladdi marked this conversation as resolved.
Show resolved Hide resolved

import org.apache.commons.lang3.BitField;
import org.apache.commons.lang3.StringUtils;

public class DependeeExample {

public DependeeExample() { }

public boolean isStringBlank(String s) {
return StringUtils.isBlank(s);
}

public BitField getBitField() {
return new BitField(0xFFFFFF);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: dependent
Bundle-SymbolicName: dependent
Bundle-Version: 0.0.1.qualifier
Require-Bundle: dependee
Bundle-ClassPath: .
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source.. = src/
output.. = classes/
bin.includes = META-INF/,\
.,\
11 changes: 11 additions & 0 deletions tycho-its/projects/target.eagerResolver/dependent/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tycho-its-project.osgitools.artifactsWithKnownLocation</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>dependent</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*******************************************************************************
* 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
*******************************************************************************/
import org.apache.commons.lang3.StringUtils;
zladdi marked this conversation as resolved.
Show resolved Hide resolved
import dependee.DependeeExample;

public class DependentExample {

public static void main(String[] args) {
DependeeExample dependeeEx = new DependeeExample();
String s = " ";
boolean sIsBlank = StringUtils.isBlank(s);

System.out.println("s is blank: " + sIsBlank);
System.out.println("bitfield is: " + dependeeEx.getBitField());
}
}
33 changes: 33 additions & 0 deletions tycho-its/projects/target.eagerResolver/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>tycho-its-project.osgitools.artifactsWithKnownLocation</groupId>
<artifactId>parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>dependee</module>
<module>dependent</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<requireEagerResolve>true</requireEagerResolve>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* 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.target;
zladdi marked this conversation as resolved.
Show resolved Hide resolved

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.junit.Test;

import java.util.List;

// See issue https://github.com/eclipse-tycho/tycho/issues/4653
public class TargetPlatformEagerResolverTest extends AbstractTychoIntegrationTest {
@Test
public void testTargetPlatformForJUnit5() throws Exception {
Verifier verifier = getVerifier("target.eagerResolver", false, true);
verifier.executeGoals(List.of("clean", "verify"));
verifier.verifyErrorFreeLog();
}
}
Loading