Skip to content

Commit

Permalink
integration test for #1660: same target resolved multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
Bananeweizen authored and laeubi committed Nov 20, 2022
1 parent 9058b25 commit 9a9ff5c
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: bundle
Bundle-SymbolicName: bundle
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: bundle
Require-Bundle: org.apache.commons.lang3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source.. = src/
bin.includes = META-INF/,\
.
13 changes: 13 additions & 0 deletions tycho-its/projects/sameAbsoluteTarget/bundle1/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tycho-its-project</groupId>
<artifactId>sameAbsoluteTarget</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>bundle</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: bundle2
Bundle-SymbolicName: bundle2
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Automatic-Module-Name: bundle2
Require-Bundle: org.apache.commons.lang3
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source.. = src/
bin.includes = META-INF/,\
.
13 changes: 13 additions & 0 deletions tycho-its/projects/sameAbsoluteTarget/bundle2/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tycho-its-project</groupId>
<artifactId>sameAbsoluteTarget</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>bundle2</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
38 changes: 38 additions & 0 deletions tycho-its/projects/sameAbsoluteTarget/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>tycho-its-project</groupId>
<artifactId>sameAbsoluteTarget</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>bundle1</module>
<module>bundle2</module>
</modules>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>

<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>
<target>
<file>${basedir}/../target-platform/target-platform.target</file>
</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="tp">
<locations>
<location includeDependencyDepth="none" includeDependencyScopes="compile" includeSource="true" missingManifest="generate" type="Maven">
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<type>jar</type>
</dependency>
</dependencies>
</location>
</locations>
</target>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.eclipse.tycho.test.target;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;

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

public class DifferentTargetFilesSameAbsolutePathTest extends AbstractTychoIntegrationTest {

@Test
public void test() throws Exception {
Verifier verifier = getVerifier("sameAbsoluteTarget");

verifier.executeGoals(List.of("clean", "verify"));
verifier.verifyErrorFreeLog();

// 2 modules with relative path to target, but identical absolute target file
// path
assertEquals(1, Files.lines(Path.of(verifier.getBasedir(), verifier.getLogFileName()))
.filter(line -> line.contains("Resolving target definition file")).count());
}
}

0 comments on commit 9a9ff5c

Please sign in to comment.