Update to 0.19.0 Release.

This commit is contained in:
Roland Grunberg 2013-10-24 14:52:56 -04:00
parent d3195d8608
commit 8b7debaa61
7 changed files with 428 additions and 791 deletions

View File

@ -1,2 +1,2 @@
2519253ad74fd2613f1ce3250a646d8a org.eclipse.tycho-tycho-0.18.x.tar.bz2
012fd267fc85a6b3372acac6e4860e76 tycho-0.19.x.tar.bz2
42dfaf1a7768e5ddb6268ae7e4ad2e11 maven-repo.tar.xz

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From 1c9fe22c06bfa298f17e9aa35e8fffb031824a21 Mon Sep 17 00:00:00 2001
From 3db92ab9ddeecb949f0b45a4bd527a4b0b62444d Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber@redhat.com>
Date: Tue, 12 Jun 2012 09:56:38 -0400
Subject: [PATCH] Fix the Tycho build to work on Fedora.
@ -16,44 +16,26 @@ so we must provide a way to disable it. Disable by default.
Update to using Jetty 9 API.
Fix to build with Plexus Compiler 2.2 API.
Change-Id: Ic8c0514c1fa10ee53580d2654ac6a363ccd66814
---
pom.xml | 9 ++---
tycho-artifactcomparator/pom.xml | 4 +--
.../p2/target/ee/CustomEEResolutionHandler.java | 2 +-
.../org/eclipse/tycho/test/util/HttpServer.java | 8 +++--
.../tycho-bundles-external.product | 1 -
.../p2 Director.product | 1 -
tycho-compiler-jdt/pom.xml | 4 ---
.../eclipse/tycho/compiler/jdt/JDTCompiler.java | 40 ++++++++++++----------
.../apache/maven/plugin/AbstractCompilerMojo.java | 6 ++--
.../maven/plugin/CompilationFailureException.java | 4 +--
.../core/maven/TychoMavenLifecycleParticipant.java | 4 ++-
.../tycho/test/AbstractTychoIntegrationTest.java | 11 +++---
12 files changed, 45 insertions(+), 49 deletions(-)
pom.xml | 5 -----
tycho-artifactcomparator/pom.xml | 4 ++--
.../META-INF/MANIFEST.MF | 2 +-
.../org.eclipse.tycho.p2.maven.repository.tests/pom.xml | 2 +-
.../eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java | 2 +-
.../src/main/java/org/eclipse/tycho/test/util/HttpServer.java | 8 ++++++--
.../tycho-bundles-external/tycho-bundles-external.product | 1 -
.../tycho-standalone-p2-director/p2 Director.product | 1 -
tycho-compiler-jdt/pom.xml | 4 ----
.../tycho/core/maven/TychoMavenLifecycleParticipant.java | 4 +++-
.../org/eclipse/tycho/test/AbstractTychoIntegrationTest.java | 11 +++++------
11 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/pom.xml b/pom.xml
index 76d5d1d..5e398a8 100644
index 273ca9e..5587d84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -219,12 +219,12 @@ $CMD -DpomFile=org.eclipse.jdt.compiler.apt.pom \
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
- <version>1.8.1</version>
+ <version>2.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-manager</artifactId>
- <version>1.8.1</version>
+ <version>2.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.tycho</groupId>
@@ -237,11 +237,6 @@ $CMD -DpomFile=org.eclipse.jdt.compiler.apt.pom \
@@ -242,11 +242,6 @@ $CMD -DpomFile=org.eclipse.jdt.compiler.apt.pom \
<version>${jdtVersion}</version>
</dependency>
<dependency>
@ -66,7 +48,7 @@ index 76d5d1d..5e398a8 100644
<artifactId>surefire-booter</artifactId>
<version>2.10</version>
diff --git a/tycho-artifactcomparator/pom.xml b/tycho-artifactcomparator/pom.xml
index 39a45fd..d558b16 100644
index ef8182a..80c7312 100644
--- a/tycho-artifactcomparator/pom.xml
+++ b/tycho-artifactcomparator/pom.xml
@@ -24,7 +24,7 @@
@ -85,6 +67,32 @@ index 39a45fd..d558b16 100644
-</project>
\ No newline at end of file
+</project>
diff --git a/tycho-bundles/org.eclipse.tycho.p2.maven.repository.tests/META-INF/MANIFEST.MF b/tycho-bundles/org.eclipse.tycho.p2.maven.repository.tests/META-INF/MANIFEST.MF
index 1d0965a..0a01dd5 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.maven.repository.tests/META-INF/MANIFEST.MF
+++ b/tycho-bundles/org.eclipse.tycho.p2.maven.repository.tests/META-INF/MANIFEST.MF
@@ -9,7 +9,7 @@ Fragment-Host: org.eclipse.tycho.p2.maven.repository
Require-Bundle: org.junit,
org.eclipse.equinox.p2.publisher,
org.eclipse.equinox.ds,
- org.mockito
+ org.mockito.mockito-core
Import-Package: org.eclipse.tycho.locking.facade,
org.eclipse.tycho.repository.local.testutil,
org.eclipse.tycho.repository.streaming.testutil,
diff --git a/tycho-bundles/org.eclipse.tycho.p2.maven.repository.tests/pom.xml b/tycho-bundles/org.eclipse.tycho.p2.maven.repository.tests/pom.xml
index 51dba13..9b2ffca 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.maven.repository.tests/pom.xml
+++ b/tycho-bundles/org.eclipse.tycho.p2.maven.repository.tests/pom.xml
@@ -37,7 +37,7 @@
<!-- 403196 give p2 resolver a hint so that package imports of org.mockito can be resolved -->
<requirement>
<type>eclipse-plugin</type>
- <id>org.hamcrest</id>
+ <id>org.hamcrest.core</id>
<versionRange>0.0.0</versionRange>
</requirement>
</extraRequirements>
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java
index 87c9e11..927cea5 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/ee/CustomEEResolutionHandler.java
@ -127,7 +135,7 @@ index 57b4e10..47423e5 100644
jetty.addConnector(connector);
diff --git a/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product b/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product
index 9185cd4..27f16f5 100644
index 7ef22f6..d4cb907 100644
--- a/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product
+++ b/tycho-bundles/tycho-bundles-external/tycho-bundles-external.product
@@ -42,7 +42,6 @@
@ -151,7 +159,7 @@ index 62b354d..11f65fb 100644
<plugin id="org.eclipse.equinox.frameworkadmin"/>
<plugin id="org.eclipse.equinox.frameworkadmin.equinox"/>
diff --git a/tycho-compiler-jdt/pom.xml b/tycho-compiler-jdt/pom.xml
index 20671c8..a71bd8b 100644
index 790e756..9d83c7c 100644
--- a/tycho-compiler-jdt/pom.xml
+++ b/tycho-compiler-jdt/pom.xml
@@ -38,10 +38,6 @@
@ -165,197 +173,11 @@ index 20671c8..a71bd8b 100644
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-compiler-api</artifactId>
</dependency>
diff --git a/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java b/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java
index f87983d..718e2fc 100644
--- a/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java
+++ b/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java
@@ -28,9 +28,10 @@ import java.util.regex.Pattern;
import org.codehaus.plexus.compiler.AbstractCompiler;
import org.codehaus.plexus.compiler.CompilerConfiguration;
-import org.codehaus.plexus.compiler.CompilerError;
import org.codehaus.plexus.compiler.CompilerException;
+import org.codehaus.plexus.compiler.CompilerMessage;
import org.codehaus.plexus.compiler.CompilerOutputStyle;
+import org.codehaus.plexus.compiler.CompilerResult;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.CommandLineException;
@@ -69,7 +70,7 @@ public class JDTCompiler extends AbstractCompiler {
// Compiler Implementation
// ----------------------------------------------------------------------
- public List<CompilerError> compile(CompilerConfiguration config) throws CompilerException {
+ public CompilerResult performCompile(CompilerConfiguration config) throws CompilerException {
CustomCompilerConfiguration custom = new CustomCompilerConfiguration();
File destinationDir = new File(config.getOutputLocation());
@@ -81,7 +82,7 @@ public class JDTCompiler extends AbstractCompiler {
String[] sourceFiles = getSourceFiles(config);
if (sourceFiles.length == 0) {
- return Collections.emptyList();
+ return new CompilerResult();
}
getLogger().info(
@@ -94,7 +95,7 @@ public class JDTCompiler extends AbstractCompiler {
String[] args = buildCompilerArguments(config, custom, sourceFiles);
- List<CompilerError> messages;
+ CompilerResult messages;
if (config.isFork()) {
String executable = config.getExecutable();
@@ -277,10 +278,10 @@ public class JDTCompiler extends AbstractCompiler {
* name of the executable to launch
* @param args
* arguments for the executable launched
- * @return List of CompilerError objects with the errors encountered.
+ * @return List of CompilerMessage objects with the errors encountered.
* @throws CompilerException
*/
- List<CompilerError> compileOutOfProcess(File workingDirectory, String executable, String[] args)
+ CompilerResult compileOutOfProcess(File workingDirectory, String executable, String[] args)
throws CompilerException {
if (true /* fork is not supported */) {
throw new UnsupportedOperationException("compileoutOfProcess not supported");
@@ -300,7 +301,7 @@ public class JDTCompiler extends AbstractCompiler {
int returnCode;
- List<CompilerError> messages;
+ List <CompilerMessage> messages;
try {
returnCode = CommandLineUtils.executeCommandLine(cli, out, err);
@@ -314,11 +315,12 @@ public class JDTCompiler extends AbstractCompiler {
if (returnCode != 0 && messages.isEmpty()) {
// TODO: exception?
- messages.add(new CompilerError("Failure executing javac, but could not parse the error:" + EOL
+ messages.add(new CompilerMessage("Failure executing javac, but could not parse the error:" + EOL
+ err.getOutput(), true));
}
- return messages;
+ boolean success = (returnCode == 0) ? true : false;
+ return new CompilerResult(success, messages);
}
/**
@@ -327,12 +329,12 @@ public class JDTCompiler extends AbstractCompiler {
*
* @param args
* arguments for the compiler as they would be used in the command line javac
- * @return List of CompilerError objects with the errors encountered.
+ * @return List of CompilerMessage objects with the errors encountered.
* @throws CompilerException
*/
- List<CompilerError> compileInProcess(String[] args, CustomCompilerConfiguration custom) throws CompilerException {
+ CompilerResult compileInProcess(String[] args, CustomCompilerConfiguration custom) throws CompilerException {
- List<CompilerError> messages;
+ List <CompilerMessage> messages;
StringWriter out = new StringWriter();
StringWriter err = new StringWriter();
@@ -357,19 +359,19 @@ public class JDTCompiler extends AbstractCompiler {
// low-level, e.g. configuration error
throw new CompilerException(err.toString());
}
- return messages;
+ return new CompilerResult(success, messages);
}
/**
- * Parse the output from the compiler into a list of CompilerError objects
+ * Parse the output from the compiler into a list of CompilerMessage objects
*
* @param input
* The output of the compiler
- * @return List of CompilerError objects
+ * @return List of CompilerMessage objects
* @throws IOException
*/
- protected static List<CompilerError> parseModernStream(BufferedReader input) throws IOException {
- List<CompilerError> errors = new ArrayList<CompilerError>();
+ protected static List<CompilerMessage> parseModernStream(BufferedReader input) throws IOException {
+ List<CompilerMessage> errors = new ArrayList<CompilerMessage>();
String type = null;
String file = null;
int lineNr = -1;
@@ -399,9 +401,9 @@ public class JDTCompiler extends AbstractCompiler {
return errors;
}
- private static void addErrorIfFound(List<CompilerError> errors, String type, String file, int line, String message) {
+ private static void addErrorIfFound(List<CompilerMessage> errors, String type, String file, int line, String message) {
if (type != null) {
- errors.add(new CompilerError(file, "ERROR".equals(type), line, 0, line, 0, message));
+ errors.add(new CompilerMessage(file, "ERROR".equals(type), line, 0, line, 0, message));
}
}
diff --git a/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java b/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java
index 74ba22c..7b3603d 100644
--- a/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java
+++ b/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/AbstractCompilerMojo.java
@@ -29,7 +29,7 @@ import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.codehaus.plexus.compiler.Compiler;
import org.codehaus.plexus.compiler.CompilerConfiguration;
-import org.codehaus.plexus.compiler.CompilerError;
+import org.codehaus.plexus.compiler.CompilerMessage;
import org.codehaus.plexus.compiler.CompilerException;
import org.codehaus.plexus.compiler.CompilerOutputStyle;
import org.codehaus.plexus.compiler.manager.CompilerManager;
@@ -420,7 +420,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
List messages;
try {
- messages = compiler.compile(compilerConfiguration);
+ messages = compiler.performCompile(compilerConfiguration).getCompilerMessages();
} catch (Exception e) {
// TODO: don't catch Exception
throw new MojoExecutionException("Fatal error compiling", e);
@@ -429,7 +429,7 @@ public abstract class AbstractCompilerMojo extends AbstractMojo {
boolean compilationError = false;
for (Iterator i = messages.iterator(); i.hasNext();) {
- CompilerError message = (CompilerError) i.next();
+ CompilerMessage message = (CompilerMessage) i.next();
if (message.isError()) {
compilationError = true;
} else {
diff --git a/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/CompilationFailureException.java b/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/CompilationFailureException.java
index 78dc4d8..8b73147 100644
--- a/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/CompilationFailureException.java
+++ b/tycho-compiler-plugin/src/main/java/copied/org/apache/maven/plugin/CompilationFailureException.java
@@ -20,7 +20,7 @@ import java.util.Iterator;
import java.util.List;
import org.apache.maven.plugin.MojoFailureException;
-import org.codehaus.plexus.compiler.CompilerError;
+import org.codehaus.plexus.compiler.CompilerMessage;
public class CompilationFailureException extends MojoFailureException {
/**
@@ -37,7 +37,7 @@ public class CompilationFailureException extends MojoFailureException {
StringBuffer sb = new StringBuffer();
for (Iterator it = messages.iterator(); it.hasNext();) {
- CompilerError compilerError = (CompilerError) it.next();
+ CompilerMessage compilerError = (CompilerMessage) it.next();
sb.append(compilerError).append(LS);
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
index 3efb896..3568d3b 100644
index 08daf3c..d003619 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
@@ -84,7 +84,9 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
@@ -77,7 +77,9 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
}
private void validate(List<MavenProject> projects) throws MavenExecutionException {
@ -367,10 +189,10 @@ index 3efb896..3568d3b 100644
}
diff --git a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java
index df63b2f..510db0a 100644
index a8173df..cf2cf57 100644
--- a/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java
+++ b/tycho-testing-harness/src/main/java/org/eclipse/tycho/test/AbstractTychoIntegrationTest.java
@@ -97,12 +97,11 @@ public abstract class AbstractTychoIntegrationTest {
@@ -110,12 +110,11 @@ public abstract class AbstractTychoIntegrationTest {
verifier.getCliOptions().add(customOptions);
}
@ -389,5 +211,5 @@ index df63b2f..510db0a 100644
return verifier;
--
1.8.1.4
1.8.3.1

View File

@ -1,4 +1,4 @@
From cd532f2b9fede237bdd35177658f26247e282c74 Mon Sep 17 00:00:00 2001
From 1b1fb76c03a437033f69b12834a069d5684d0ac0 Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber@redhat.com>
Date: Fri, 21 Sep 2012 10:58:09 -0400
Subject: [PATCH] Resolve all necessary dependencies for Tycho Surefire.
@ -24,10 +24,10 @@ Change-Id: I9ef0239eed887fa47c380efcdce968934c788c9f
6 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF b/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF
index 35bc312..1d18a6d 100644
index 41d90f8..7a3e546 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF
+++ b/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF
@@ -6,6 +6,7 @@ Bundle-Version: 0.18.0
@@ -6,6 +6,7 @@ Bundle-Version: 0.19.0
Fragment-Host: org.eclipse.tycho.surefire.osgibooter;bundle-version="0.14.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
@ -38,7 +38,7 @@ index 35bc312..1d18a6d 100644
+ jars/common-junit3-2.15.jar
Bundle-Vendor: %providerName
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.junit/pom.xml
index 3d0f7c1..1115be2 100644
index 4022f00..f59b7a3 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit/pom.xml
+++ b/tycho-surefire/org.eclipse.tycho.surefire.junit/pom.xml
@@ -44,6 +44,11 @@
@ -54,10 +54,10 @@ index 3d0f7c1..1115be2 100644
</configuration>
</execution>
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF b/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF
index 19c7ebb..26c9084 100644
index b815348..822552a 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF
+++ b/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF
@@ -6,7 +6,9 @@ Bundle-Version: 0.18.0
@@ -6,7 +6,9 @@ Bundle-Version: 0.19.0
Fragment-Host: org.eclipse.tycho.surefire.osgibooter;bundle-version="0.14.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
@ -69,7 +69,7 @@ index 19c7ebb..26c9084 100644
org.junit;version="4.0.0",
org.junit.runner;version="4.0.0",
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit4/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.junit4/pom.xml
index caa77d2..32c45fc 100644
index 11a34d6..c2dc5e0 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit4/pom.xml
+++ b/tycho-surefire/org.eclipse.tycho.surefire.junit4/pom.xml
@@ -44,6 +44,16 @@
@ -90,7 +90,7 @@ index caa77d2..32c45fc 100644
</configuration>
</execution>
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit47/META-INF/MANIFEST.MF b/tycho-surefire/org.eclipse.tycho.surefire.junit47/META-INF/MANIFEST.MF
index 33d777b..ff58223 100644
index 978a955..6707137 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit47/META-INF/MANIFEST.MF
+++ b/tycho-surefire/org.eclipse.tycho.surefire.junit47/META-INF/MANIFEST.MF
@@ -8,7 +8,9 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
@ -105,7 +105,7 @@ index 33d777b..ff58223 100644
org.junit;version="[4.7,5)",
org.junit.runner;version="[4.7,5)",
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml
index 6a6eaa2..42135ea 100644
index 442f830..33174f3 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml
+++ b/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml
@@ -54,6 +54,16 @@
@ -126,5 +126,5 @@ index 6a6eaa2..42135ea 100644
</configuration>
</execution>
--
1.8.1.4
1.8.3.1

View File

@ -1,4 +1,4 @@
From 9fd0241b1ceb623332f8827df99270b54763efc8 Mon Sep 17 00:00:00 2001
From 6885825adb193f8d69889a0f13de8b15506753ab Mon Sep 17 00:00:00 2001
From: Jan Sievers <jan.sievers@sap.com>
Date: Tue, 4 Sep 2012 16:02:52 +0200
Subject: [PATCH] POC 386481 update maven surefire to latest version 2.15
@ -21,29 +21,25 @@ there are several new problems:
Change-Id: Ibcb439a24add880c4cdafe67b42e29ca3cb14ff1
---
.../META-INF/MANIFEST.MF | 2 +-
.../build.properties | 2 +-
.../META-INF/MANIFEST.MF | 2 +-
.../build.properties | 2 +-
.../META-INF/MANIFEST.MF | 7 +-
.../build.properties | 3 +-
.../org.eclipse.tycho.surefire.junit47/pom.xml | 10 ++
.../junitcore/OsgiEnabledJUnitCoreProvider.java | 126 ---------------------
.../junitcore/OsgiEnabledJUnitCoreRunListener.java | 100 ----------------
.../META-INF/MANIFEST.MF | 6 +-
.../org.eclipse.tycho.surefire.osgibooter/pom.xml | 10 ++
.../surefire/osgibooter/OsgiSurefireBooter.java | 36 +++---
.../osgibooter/TychoClasspathConfiguration.java | 35 ++++--
tycho-surefire/pom.xml | 2 +-
tycho-surefire/tycho-surefire-plugin/pom.xml | 5 +
.../java/org/eclipse/tycho/surefire/TestMojo.java | 29 ++++-
.../surefire/provider/impl/JUnit47Provider.java | 2 +-
17 files changed, 116 insertions(+), 263 deletions(-)
delete mode 100644 tycho-surefire/org.eclipse.tycho.surefire.junit47/src/org/apache/maven/surefire/junitcore/OsgiEnabledJUnitCoreProvider.java
delete mode 100644 tycho-surefire/org.eclipse.tycho.surefire.junit47/src/org/apache/maven/surefire/junitcore/OsgiEnabledJUnitCoreRunListener.java
.../META-INF/MANIFEST.MF | 2 +-
.../build.properties | 2 +-
.../META-INF/MANIFEST.MF | 2 +-
.../build.properties | 2 +-
.../META-INF/MANIFEST.MF | 7 +++--
.../build.properties | 3 +-
.../org.eclipse.tycho.surefire.junit47/pom.xml | 10 ++++++
.../META-INF/MANIFEST.MF | 6 ++--
.../org.eclipse.tycho.surefire.osgibooter/pom.xml | 10 ++++++
.../surefire/osgibooter/OsgiSurefireBooter.java | 36 ++++++++++++++--------
.../osgibooter/TychoClasspathConfiguration.java | 35 +++++++++++++++------
tycho-surefire/pom.xml | 2 +-
tycho-surefire/tycho-surefire-plugin/pom.xml | 5 +++
.../java/org/eclipse/tycho/surefire/TestMojo.java | 29 +++++++++++++++--
.../surefire/provider/impl/JUnit47Provider.java | 2 +-
15 files changed, 116 insertions(+), 37 deletions(-)
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF b/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF
index dbe883b..35bc312 100644
index 788207e..41d90f8 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF
+++ b/tycho-surefire/org.eclipse.tycho.surefire.junit/META-INF/MANIFEST.MF
@@ -7,5 +7,5 @@ Fragment-Host: org.eclipse.tycho.surefire.osgibooter;bundle-version="0.14.0"
@ -65,10 +61,10 @@ index 499ce76..fe88b19 100644
+ jars/,\
plugin.properties
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF b/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF
index 7498728..19c7ebb 100644
index fefa9e8..b815348 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF
+++ b/tycho-surefire/org.eclipse.tycho.surefire.junit4/META-INF/MANIFEST.MF
@@ -6,7 +6,7 @@ Bundle-Version: 0.18.0
@@ -6,7 +6,7 @@ Bundle-Version: 0.19.0
Fragment-Host: org.eclipse.tycho.surefire.osgibooter;bundle-version="0.14.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5,
JavaSE-1.6
@ -89,10 +85,10 @@ index b787149..fe88b19 100644
+ jars/,\
plugin.properties
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit47/META-INF/MANIFEST.MF b/tycho-surefire/org.eclipse.tycho.surefire.junit47/META-INF/MANIFEST.MF
index 024acb7..33d777b 100644
index 1fd1ea3..978a955 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit47/META-INF/MANIFEST.MF
+++ b/tycho-surefire/org.eclipse.tycho.surefire.junit47/META-INF/MANIFEST.MF
@@ -6,11 +6,14 @@ Bundle-Version: 0.18.0
@@ -6,11 +6,14 @@ Bundle-Version: 0.19.0
Fragment-Host: org.eclipse.tycho.surefire.osgibooter;bundle-version="0.16.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .,
@ -124,7 +120,7 @@ index 716961d..2589258 100644
about_files/
-source.. = src/
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml
index d5abf73..6a6eaa2 100644
index 7d08daf..442f830 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml
+++ b/tycho-surefire/org.eclipse.tycho.surefire.junit47/pom.xml
@@ -44,6 +44,16 @@
@ -144,246 +140,8 @@ index d5abf73..6a6eaa2 100644
</artifactItems>
</configuration>
</execution>
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit47/src/org/apache/maven/surefire/junitcore/OsgiEnabledJUnitCoreProvider.java b/tycho-surefire/org.eclipse.tycho.surefire.junit47/src/org/apache/maven/surefire/junitcore/OsgiEnabledJUnitCoreProvider.java
deleted file mode 100644
index eaa8dc4..0000000
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit47/src/org/apache/maven/surefire/junitcore/OsgiEnabledJUnitCoreProvider.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package org.apache.maven.surefire.junitcore;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.maven.surefire.common.junit4.JUnit4RunListenerFactory;
-import org.apache.maven.surefire.common.junit4.JUnit4TestChecker;
-import org.apache.maven.surefire.providerapi.AbstractProvider;
-import org.apache.maven.surefire.providerapi.ProviderParameters;
-import org.apache.maven.surefire.report.ConsoleLogger;
-import org.apache.maven.surefire.report.ConsoleOutputCapture;
-import org.apache.maven.surefire.report.ConsoleOutputReceiver;
-import org.apache.maven.surefire.report.ReporterException;
-import org.apache.maven.surefire.report.ReporterFactory;
-import org.apache.maven.surefire.report.RunListener;
-import org.apache.maven.surefire.suite.RunResult;
-import org.apache.maven.surefire.testset.TestSetFailedException;
-import org.apache.maven.surefire.util.DirectoryScanner;
-import org.apache.maven.surefire.util.ScannerFilter;
-import org.apache.maven.surefire.util.TestsToRun;
-
-/**
- * This class is a workaround for surefire bug {@link http://jira.codehaus.org/browse/SUREFIRE-876 }. It's a copy of
- * {@link JUnitCoreProvider} with the only change to use OsgiEnabledJUnitCoreRunListener instead of
- * JUnitCoreRunListener. TODO remove and use {@link JUnitCoreProvider} instead when surefire release with proposed
- * bugfix is available.
- *
- * @author Kristian Rosenvold
- * @author Jan Sievers (SAP)
- */
-public class OsgiEnabledJUnitCoreProvider
- extends AbstractProvider
-{
- private final ClassLoader testClassLoader;
-
- private final DirectoryScanner directoryScanner;
-
- private final JUnitCoreParameters jUnitCoreParameters;
-
- private final ScannerFilter scannerFilter;
-
- private final List<org.junit.runner.notification.RunListener> customRunListeners;
-
- private final ProviderParameters providerParameters;
-
- private TestsToRun testsToRun;
-
-
- public OsgiEnabledJUnitCoreProvider( ProviderParameters providerParameters )
- {
- this.providerParameters = providerParameters;
- this.testClassLoader = providerParameters.getTestClassLoader();
- this.directoryScanner = providerParameters.getDirectoryScanner();
- this.jUnitCoreParameters = new JUnitCoreParameters( providerParameters.getProviderProperties() );
- this.scannerFilter = new JUnit4TestChecker( testClassLoader );
- customRunListeners = JUnit4RunListenerFactory.
- createCustomListeners( providerParameters.getProviderProperties().getProperty( "listener" ) );
-
- }
-
- public Boolean isRunnable()
- {
- return Boolean.TRUE;
- }
-
- public Iterator getSuites()
- {
- testsToRun = scanClassPath();
- return testsToRun.iterator();
- }
-
- public RunResult invoke( Object forkTestSet )
- throws TestSetFailedException, ReporterException
- {
- final String message = "Concurrency config is " + jUnitCoreParameters.toString() + "\n";
- final ReporterFactory reporterFactory = providerParameters.getReporterFactory();
-
- final ConsoleLogger consoleLogger = providerParameters.getConsoleLogger();
- consoleLogger.info( message );
-
- if ( testsToRun == null )
- {
- testsToRun = forkTestSet == null ? scanClassPath() : TestsToRun.fromClass( (Class) forkTestSet );
- }
- final Map<String, TestSet> testSetMap = new ConcurrentHashMap<String, TestSet>();
-
- RunListener listener = ConcurrentReporterManager.createInstance( testSetMap, reporterFactory,
- jUnitCoreParameters.isParallelClasses(),
- jUnitCoreParameters.isParallelBoth(),
- consoleLogger );
-
- ConsoleOutputCapture.startCapture( (ConsoleOutputReceiver) listener );
-
- org.junit.runner.notification.RunListener jUnit4RunListener = new OsgiEnabledJUnitCoreRunListener( listener, testSetMap );
- customRunListeners.add( 0, jUnit4RunListener );
-
- JUnitCoreWrapper.execute( testsToRun, jUnitCoreParameters, customRunListeners );
- return reporterFactory.close();
- }
-
- private TestsToRun scanClassPath()
- {
- return directoryScanner.locateTestClasses( testClassLoader, scannerFilter );
- }
-}
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.junit47/src/org/apache/maven/surefire/junitcore/OsgiEnabledJUnitCoreRunListener.java b/tycho-surefire/org.eclipse.tycho.surefire.junit47/src/org/apache/maven/surefire/junitcore/OsgiEnabledJUnitCoreRunListener.java
deleted file mode 100644
index fb6bede..0000000
--- a/tycho-surefire/org.eclipse.tycho.surefire.junit47/src/org/apache/maven/surefire/junitcore/OsgiEnabledJUnitCoreRunListener.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.apache.maven.surefire.junitcore;
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.util.ArrayList;
-import java.util.Map;
-import org.apache.maven.surefire.common.junit4.JUnit4RunListener;
-import org.apache.maven.surefire.report.RunListener;
-
-import org.junit.runner.Description;
-import org.junit.runner.Result;
-
-/**
- * This class is a workaround or surefire bug
- * {@link http://jira.codehaus.org/browse/SUREFIRE-876 }
- *
- * TODO remove when surefire release with proposed bugfix is available
- */
-public class OsgiEnabledJUnitCoreRunListener
- extends JUnit4RunListener
-{
- private final Map<String, TestSet> classMethodCounts;
-
- /**
- * @param reporter the report manager to log testing events to
- * @param classMethodCounts A map of methods
- */
- public OsgiEnabledJUnitCoreRunListener( RunListener reporter, Map<String, TestSet> classMethodCounts )
- {
- super( reporter );
- this.classMethodCounts = classMethodCounts;
- }
-
- /**
- * Called right before any tests from a specific class are run.
- *
- * @see org.junit.runner.notification.RunListener#testRunStarted(org.junit.runner.Description)
- */
- public void testRunStarted( Description description )
- throws Exception
- {
- fillTestCountMap( description );
- reporter.testSetStarting( null ); // Not entirely meaningful as we can see
- }
-
- @Override
- public void testRunFinished( Result result )
- throws Exception
- {
- reporter.testSetCompleted( null );
- }
-
- private void fillTestCountMap( Description description )
- {
- final ArrayList<Description> children = description.getChildren();
-
- TestSet testSet = new TestSet( description );
- String itemTestClassName = null;
- for ( Description item : children )
- {
- if ( item.isTest() && item.getMethodName() != null )
- {
- testSet.incrementTestMethodCount();
- if ( itemTestClassName == null )
- {
- itemTestClassName = item.getClassName();
- }
- }
- else if ( item.getChildren().size() > 0 )
- {
- fillTestCountMap( item );
- }
- else
- {
- classMethodCounts.put( item.getClassName(), testSet );
- }
- }
- if ( itemTestClassName != null )
- {
- classMethodCounts.put( itemTestClassName, testSet );
- }
- }
-
-}
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF
index e75a51f..1c12e19 100644
index 09cf7bc..25e3618 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF
+++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/META-INF/MANIFEST.MF
@@ -4,8 +4,10 @@ Require-Bundle: org.eclipse.osgi;bundle-version="3.2.2",
@ -396,11 +154,11 @@ index e75a51f..1c12e19 100644
+ jars/surefire-api-2.15.jar,
+ jars/maven-surefire-common-2.15.jar,
+ jars/plexus-utils-3.0.jar
Bundle-Version: 0.18.1
Bundle-Version: 0.19.0
Bundle-Name: Tycho Surefire OSGi Booter Eclipse Application (Incubation)
Bundle-ManifestVersion: 2
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml
index 20d5b39..651282f 100644
index 6546f70..815cdee 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml
+++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml
@@ -52,6 +52,16 @@
@ -421,7 +179,7 @@ index 20d5b39..651282f 100644
</configuration>
</execution>
diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java
index 791221b..09bf329 100644
index 56b2264..1ac5599 100644
--- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java
+++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/src/main/java/org/eclipse/tycho/surefire/osgibooter/OsgiSurefireBooter.java
@@ -18,20 +18,25 @@ import java.io.IOException;
@ -452,7 +210,7 @@ index 791221b..09bf329 100644
import org.apache.maven.surefire.testset.TestRequest;
import org.apache.maven.surefire.util.RunOrder;
import org.eclipse.core.runtime.CoreException;
@@ -55,7 +60,7 @@ public class OsgiSurefireBooter {
@@ -56,7 +61,7 @@ public class OsgiSurefireBooter {
List<String> includes = getIncludesExcludes(testProps.getProperty("includes"));
List<String> excludes = getIncludesExcludes(testProps.getProperty("excludes"));
@ -461,7 +219,7 @@ index 791221b..09bf329 100644
boolean inForkedVM = true;
boolean trimStacktrace = true;
boolean useSystemClassloader = false;
@@ -64,26 +69,31 @@ public class OsgiSurefireBooter {
@@ -65,26 +70,31 @@ public class OsgiSurefireBooter {
boolean printSummary = true;
boolean disableXmlReport = false;
ClassLoader testClassLoader = getBundleClassLoader(plugin);
@ -474,8 +232,8 @@ index 791221b..09bf329 100644
- new ClassLoaderConfiguration(useSystemClassloader, useManifestOnlyJar), forkMode, inForkedVM);
+ new ClassLoaderConfiguration(useSystemClassloader, useManifestOnlyJar), forkRequested, inForkedVM);
DirectoryScannerParameters dirScannerParams = new DirectoryScannerParameters(testClassesDir, includes,
- excludes, failIfNoTests, RunOrder.FILESYSTEM);
+ excludes, Collections.emptyList(), failIfNoTests, RunOrder.FILESYSTEM.toString());
- excludes, failIfNoTests, RunOrder.valueOf(runOrder));
+ excludes, Collections.emptyList(), failIfNoTests, RunOrder.valueOf(runOrder).toString());
ReporterConfiguration reporterConfig = new ReporterConfiguration(reportsDir, trimStacktrace);
TestRequest testRequest = new TestRequest(null, testClassesDir, null);
- ProviderConfiguration providerConfiguration = new ProviderConfiguration(dirScannerParams, failIfNoTests,
@ -553,7 +311,7 @@ index c94d3ea..fc606b0 100644
}
diff --git a/tycho-surefire/pom.xml b/tycho-surefire/pom.xml
index 7dd7c41..1945406 100644
index 811dff0..843fdd4 100644
--- a/tycho-surefire/pom.xml
+++ b/tycho-surefire/pom.xml
@@ -26,7 +26,7 @@
@ -566,12 +324,12 @@ index 7dd7c41..1945406 100644
<modules>
diff --git a/tycho-surefire/tycho-surefire-plugin/pom.xml b/tycho-surefire/tycho-surefire-plugin/pom.xml
index 5d496d3..2d5d245 100644
index b6aa41b..dad6835 100644
--- a/tycho-surefire/tycho-surefire-plugin/pom.xml
+++ b/tycho-surefire/tycho-surefire-plugin/pom.xml
@@ -96,5 +96,10 @@
<artifactId>surefire-api</artifactId>
<version>${surefire-version}</version>
@@ -101,5 +101,10 @@
<artifactId>tycho-p2-facade</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.maven.surefire</groupId>
@ -581,18 +339,18 @@ index 5d496d3..2d5d245 100644
</dependencies>
</project>
diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java
index 5ac5427..340f562 100644
index ce598f5..ccdf0b2 100644
--- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java
+++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/TestMojo.java
@@ -18,6 +18,7 @@ import java.io.IOException;
import java.net.MalformedURLException;
@@ -20,6 +20,7 @@ import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -33,9 +34,10 @@ import org.apache.maven.model.Dependency;
@@ -35,9 +36,10 @@ import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
@ -604,9 +362,9 @@ index 5ac5427..340f562 100644
import org.apache.maven.toolchain.Toolchain;
import org.apache.maven.toolchain.ToolchainManager;
import org.codehaus.plexus.util.FileUtils;
@@ -737,6 +739,27 @@ public class TestMojo extends AbstractMojo {
providerProperties.put("perCoreThreadCount", String.valueOf(perCoreThreadCount));
providerProperties.put("useUnlimitedThreads", String.valueOf(useUnlimitedThreads));
@@ -905,6 +907,27 @@ public class TestMojo extends AbstractMojo {
result.put("perCoreThreadCount", String.valueOf(perCoreThreadCount));
result.put("useUnlimitedThreads", String.valueOf(useUnlimitedThreads));
}
+
+ List<String> defaultIncludes = Arrays.asList("**/Test*.class", "**/*Test.class", "**/*TestCase.class");
@ -628,11 +386,11 @@ index 5ac5427..340f562 100644
+ DirectoryScanner scanner = new DirectoryScanner(testClassesDirectory, includeList, excludes != null ? excludes
+ : defaultExcludes, Collections.<String> emptyList());
+ DefaultScanResult scanResult = scanner.scan();
+ scanResult.writeTo(providerProperties);
for (Map.Entry entry : providerProperties.entrySet()) {
surefireProps.put("__provider." + entry.getKey(), entry.getValue());
}
@@ -783,7 +806,7 @@ public class TestMojo extends AbstractMojo {
+ scanResult.writeTo(result);
return result;
}
@@ -949,7 +972,7 @@ public class TestMojo extends AbstractMojo {
case 0:
getLog().info("All tests passed!");
break;
@ -641,7 +399,7 @@ index 5ac5427..340f562 100644
String message = "No tests found.";
if (failIfNoTests) {
throw new MojoFailureException(message);
@@ -791,7 +814,7 @@ public class TestMojo extends AbstractMojo {
@@ -957,7 +980,7 @@ public class TestMojo extends AbstractMojo {
getLog().warn(message);
}
break;
@ -651,7 +409,7 @@ index 5ac5427..340f562 100644
+ " for the individual test results.";
if (testFailureIgnore) {
diff --git a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/provider/impl/JUnit47Provider.java b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/provider/impl/JUnit47Provider.java
index 8358883..625b6fc 100644
index edcc46a..5d62d3d 100644
--- a/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/provider/impl/JUnit47Provider.java
+++ b/tycho-surefire/tycho-surefire-plugin/src/main/java/org/eclipse/tycho/surefire/provider/impl/JUnit47Provider.java
@@ -44,7 +44,7 @@ public class JUnit47Provider extends AbstractJUnitProvider {
@ -664,5 +422,5 @@ index 8358883..625b6fc 100644
public Version getVersion() {
--
1.8.1.4
1.8.3.1

View File

@ -1,4 +1,4 @@
From b9f8979d98b98536679ec562e272911da287a476 Mon Sep 17 00:00:00 2001
From 8242049f30a7271ff801748976922edff03e05fe Mon Sep 17 00:00:00 2001
From: Roland Grunberg <rgrunber@redhat.com>
Date: Tue, 12 Jun 2012 10:38:51 -0400
Subject: [PATCH] Implement a custom resolver for Tycho in local mode.
@ -28,20 +28,22 @@ reactor cache, resolution should be attempted using the XMvn Resolver.
Change-Id: Ia1ece07ece2412bc4a88901631f3f651ad2b634b
---
.../tycho/p2/target/TargetDefinitionResolver.java | 11 +++--
.../tycho/p2/target/TargetPlatformBuilderImpl.java | 55 ++++++++++++++++++++--
.../tycho/p2/repository/LocalRepositoryReader.java | 31 +++++++++++-
tycho-core/pom.xml | 5 ++
.../eclipse/tycho/core/locking/FileLockerImpl.java | 24 +++++++---
.../core/maven/TychoMavenLifecycleParticipant.java | 28 +++++++++++
.../tycho/core/osgitools/AbstractTychoProject.java | 24 ++++++++++
.../tycho/core/osgitools/OsgiBundleProject.java | 29 +++++++++++-
.../p2/target/TargetPlatformBundlePublisher.java | 15 ++-----
.../tycho/p2/target/TargetPlatformFactoryImpl.java | 50 +++++++++++++++++++---
.../tycho/p2/repository/LocalRepositoryReader.java | 31 +++++++++++++-
.../facade/TargetPlatformConfigurationStub.java | 5 ++-
tycho-core/pom.xml | 5 +++
.../eclipse/tycho/core/locking/FileLockerImpl.java | 24 ++++++++---
.../core/maven/TychoMavenLifecycleParticipant.java | 29 +++++++++++++
.../tycho/core/osgitools/AbstractTychoProject.java | 24 +++++++++++
.../tycho/core/osgitools/OsgiBundleProject.java | 29 ++++++++++++-
.../DefaultTargetPlatformConfigurationReader.java | 6 ++-
.../osgi/runtime/TychoOsgiRuntimeLocator.java | 17 +++++++
.../p2/resolver/P2TargetPlatformResolver.java | 11 +++++
11 files changed, 223 insertions(+), 18 deletions(-)
.../osgi/runtime/TychoOsgiRuntimeLocator.java | 17 ++++++++
.../p2/resolver/P2TargetPlatformResolver.java | 10 +++++
13 files changed, 226 insertions(+), 30 deletions(-)
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java
index 2dc91ff..8395f82 100644
index b008768..77c1443 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetDefinitionResolver.java
@@ -23,6 +23,7 @@ import org.eclipse.core.runtime.CoreException;
@ -52,7 +54,7 @@ index 2dc91ff..8395f82 100644
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
@@ -104,9 +105,13 @@ public class TargetDefinitionResolver {
@@ -115,9 +116,13 @@ public class TargetDefinitionResolver {
List<IMetadataRepository> metadataRepositories = new ArrayList<IMetadataRepository>();
for (Repository repository : iuLocationDefinition.getRepositories()) {
@ -69,35 +71,62 @@ index 2dc91ff..8395f82 100644
}
IQueryable<IInstallableUnit> locationUnits = new CompoundQueryable<IInstallableUnit>(
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
index 5b61351..b81f6be 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBuilderImpl.java
@@ -38,6 +38,9 @@ import org.eclipse.equinox.p2.core.IProvisioningAgent;
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBundlePublisher.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBundlePublisher.java
index 5d6bc1f..8281167 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBundlePublisher.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformBundlePublisher.java
@@ -28,6 +28,7 @@ import org.eclipse.tycho.core.facade.MavenLogger;
import org.eclipse.tycho.p2.impl.publisher.MavenPropertiesAdvice;
import org.eclipse.tycho.p2.impl.publisher.repo.TransientArtifactRepository;
import org.eclipse.tycho.p2.metadata.IArtifactFacade;
+import org.eclipse.tycho.p2.repository.LocalRepositoryReader;
import org.eclipse.tycho.p2.repository.MavenRepositoryCoordinates;
import org.eclipse.tycho.repository.local.GAVArtifactDescriptor;
import org.eclipse.tycho.repository.p2base.artifact.provider.IRawArtifactFileProvider;
@@ -218,15 +219,6 @@ public class TargetPlatformBundlePublisher {
GAVArtifactDescriptor descriptorForRepository = new GAVArtifactDescriptor(baseDescriptor,
repositoryCoordinates);
- File requiredArtifactLocation = new File(getBaseDir(), descriptorForRepository.getMavenCoordinates()
- .getLocalRepositoryPath());
- File actualArtifactLocation = mavenArtifact.getLocation();
- if (!equivalentPaths(requiredArtifactLocation, actualArtifactLocation)) {
- throw new AssertionFailedException(
- "The Maven artifact to be added to the target platform is not stored at the required location on disk: required \""
- + requiredArtifactLocation + "\" but was \"" + actualArtifactLocation + "\"");
- }
-
internalAddInternalDescriptor(descriptorForRepository);
}
@@ -259,8 +251,9 @@ public class TargetPlatformBundlePublisher {
@Override
protected File internalGetArtifactStorageLocation(IArtifactDescriptor descriptor) {
- String relativePath = toInternalDescriptor(descriptor).getMavenCoordinates().getLocalRepositoryPath();
- return new File(getBaseDir(), relativePath);
+ MavenRepositoryCoordinates coord = toInternalDescriptor(descriptor).getMavenCoordinates();
+ LocalRepositoryReader reader = new LocalRepositoryReader(getBaseDir());
+ return reader.getLocalArtifactLocation(coord.getGav(), coord.getClassifier(), coord.getExtensionOrDefault());
}
private File getBaseDir() {
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformFactoryImpl.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformFactoryImpl.java
index 4677798..4ee3fb5 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformFactoryImpl.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.impl/src/main/java/org/eclipse/tycho/p2/target/TargetPlatformFactoryImpl.java
@@ -30,6 +30,9 @@ import org.eclipse.core.runtime.URIUtil;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.VersionedId;
+import org.eclipse.equinox.p2.metadata.expression.ExpressionUtil;
+import org.eclipse.equinox.p2.metadata.expression.IExpression;
+import org.eclipse.equinox.p2.query.IQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
@@ -231,6 +234,12 @@ public class TargetPlatformBuilderImpl implements TargetPlatformBuilder {
IMetadataRepository metadataRepository = null;
IArtifactRepository artifactRepository = null;
+ // We cannot resolve a non-file URI in local mode while offline
+ if (System.getProperty("TYCHO_MVN_RPMBUILD") != null && !URIUtil.isFileURI(location.getURL())) {
+ return;
+ }
+
+
try {
remoteRepositoryIdManager.addMapping(location.getId(), location.getURL());
@@ -374,12 +383,48 @@ public class TargetPlatformBuilderImpl implements TargetPlatformBuilder {
result.addAll(contentPart.getUnits());
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
@@ -271,12 +274,49 @@ public class TargetPlatformFactoryImpl implements TargetPlatformFactory {
metadataRepositories.add(localMetadataRepository);
}
- SubMonitor sub = SubMonitor.convert(monitor, metadataRepositories.size() * 200);
@ -121,7 +150,8 @@ index 5b61351..b81f6be 100644
+
+ // Create a conjunction query that negates all IUs on the local system
+ for (IInstallableUnit unit : systemLocalP2Repo.query(QueryUtil.ALL_UNITS, null).toUnmodifiableSet()) {
+ noLocalIUs = QueryUtil.createCompoundQuery(noLocalIUs, QueryUtil.createMatchQuery(notmatchIU_ID, unit.getId()), true);
+ noLocalIUs = QueryUtil.createCompoundQuery(noLocalIUs,
+ QueryUtil.createMatchQuery(notmatchIU_ID, unit.getId()), true);
+ }
+
+ SubMonitor sub = SubMonitor.convert(monitor, metadataRepositories.size() * 200);
@ -198,8 +228,24 @@ index 8d36462..4c8c582 100644
+
+ }
}
diff --git a/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java b/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java
index 0be3e6f..3fecf39 100644
--- a/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java
+++ b/tycho-bundles/org.eclipse.tycho.p2.resolver.shared/src/main/java/org/eclipse/tycho/p2/target/facade/TargetPlatformConfigurationStub.java
@@ -58,7 +58,10 @@ public class TargetPlatformConfigurationStub {
}
public void addP2Repository(MavenRepositoryLocation location) {
- this.repositories.add(location);
+ // We cannot resolve a non-file URI in local mode while offline
+ if (System.getProperty("TYCHO_MVN_RPMBUILD") == null || "file".equalsIgnoreCase(location.getURL().getScheme())) {
+ this.repositories.add(location);
+ }
}
// convenience method for tests
diff --git a/tycho-core/pom.xml b/tycho-core/pom.xml
index d1289b6..45f7ee9 100644
index 853bcf4..b29017f 100644
--- a/tycho-core/pom.xml
+++ b/tycho-core/pom.xml
@@ -146,6 +146,11 @@
@ -260,7 +306,7 @@ index 86253bd..247b2b2 100644
throw new RuntimeException(e);
} catch (IOException e) {
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
index 3568d3b..dc77848 100644
index d003619..0e08d3f 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/maven/TychoMavenLifecycleParticipant.java
@@ -11,6 +11,7 @@
@ -271,8 +317,16 @@ index 3568d3b..dc77848 100644
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -73,6 +74,33 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
registerExecutionListener(session);
@@ -29,6 +30,7 @@ import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.logging.Logger;
import org.eclipse.tycho.ReactorProject;
import org.eclipse.tycho.core.osgitools.BundleReader;
@@ -66,6 +68,33 @@ public class TychoMavenLifecycleParticipant extends AbstractMavenLifecyclePartic
validate(projects);
configureComponents(session);
+ try {
@ -359,7 +413,7 @@ index 695133d..542a0f7 100644
return (TargetPlatform) project.getContextValue(TychoConstants.CTX_TARGET_PLATFORM);
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
index ab40599..4adb5da 100644
index 57c9fcc..aa1cc83 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/OsgiBundleProject.java
@@ -45,7 +45,9 @@ import org.eclipse.tycho.core.BundleProject;
@ -372,7 +426,7 @@ index ab40599..4adb5da 100644
import org.eclipse.tycho.core.ee.shared.ExecutionEnvironment;
import org.eclipse.tycho.core.ee.shared.ExecutionEnvironmentConfiguration;
import org.eclipse.tycho.core.facade.BuildPropertiesParser;
@@ -487,6 +489,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
@@ -493,6 +495,7 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
String pdeProfile = getEclipsePluginProject(DefaultReactorProject.adapt(project)).getBuildProperties()
.getJreCompilationProfile();
if (pdeProfile != null) {
@ -380,7 +434,7 @@ index ab40599..4adb5da 100644
sink.setProfileConfiguration(pdeProfile.trim(), "build.properties");
} else {
@@ -504,7 +507,31 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
@@ -510,7 +513,31 @@ public class OsgiBundleProject extends AbstractTychoProject implements BundlePro
if (envs.isEmpty()) {
return null;
}
@ -414,7 +468,7 @@ index ab40599..4adb5da 100644
}
diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java
index edfc57b..287cbca 100644
index ed0d75a..8e39e3c 100644
--- a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java
+++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformConfigurationReader.java
@@ -64,7 +64,11 @@ public class DefaultTargetPlatformConfigurationReader {
@ -473,27 +527,26 @@ index 1e878e5..d56e395 100644
request.setArtifact(artifact);
request.setResolveRoot(true).setResolveTransitively(false);
diff --git a/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java b/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
index f6f56ac..b9b8cba 100644
index 5150a19..d0e1e68 100644
--- a/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
+++ b/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2TargetPlatformResolver.java
@@ -189,6 +189,17 @@ public class P2TargetPlatformResolver extends AbstractTargetPlatformResolver imp
tpBuilder.setProjectLocation(project.getBasedir());
tpBuilder.setIncludePackedArtifacts(configuration.isIncludePackedArtifacts());
tpBuilder.setFailOnDuplicateIUs(failOnDuplicateIUs);
+
@@ -201,6 +201,16 @@ public class P2TargetPlatformResolver extends AbstractTargetPlatformResolver imp
pomDependencies.setProjectLocation(project.getBasedir());
}
+ // Add Fedora Local P2 Repository when running in local mode
+ if (System.getProperty("TYCHO_MVN_LOCAL") != null || System.getProperty("TYCHO_MVN_RPMBUILD") != null) {
+ String uri = "file:" + System.getProperty("user.dir") + "/.m2/p2/repo";
+ try {
+ tpBuilder.addP2Repository(new MavenRepositoryLocation(uri, new URI(uri)));
+ tpConfiguration.addP2Repository(new MavenRepositoryLocation(uri, new URI(uri)));
+ } catch (URISyntaxException e) {
+ getLogger().warn("Unable to resolve repository URI : " + uri, e);
+ }
+ }
+
addThisReactorProjectToTargetPlatform(session, project, configuration, tpBuilder);
addOtherReactorProjectsToTargetPlatform(project, reactorProjects, tpBuilder);
for (ArtifactRepository repository : project.getRemoteArtifactRepositories()) {
addEntireP2RepositoryToTargetPlatform(repository, tpConfiguration, session);
}
--
1.8.3.1

View File

@ -8,15 +8,15 @@
%define __requires_exclude osgi*
Name: tycho
Version: 0.18.1
Release: 7%{?dist}
Version: 0.19.0
Release: 1%{?dist}
Summary: Plugins and extensions for building Eclipse plugins and OSGI bundles with Maven
Group: Development/Libraries
# license file is missing but all files having some licensing information are ASL 2.0
License: ASL 2.0
URL: http://tycho.sonatype.org/
Source0: http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/snapshot/org.eclipse.tycho-tycho-0.18.x.tar.bz2
Source0: http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/snapshot/tycho-0.19.x.tar.bz2
# this is a workaround for maven-plugin-plugin changes that happened after
# version 2.4.3 (impossible to have empty mojo created as aggregate). This
@ -71,6 +71,7 @@ BuildRequires: osgi(org.eclipse.jdt)
BuildRequires: %{name}
%endif
BuildRequires: maven-shared-utils
BuildRequires: mockito
Requires: jpackage-utils
Requires: decentxml
@ -135,7 +136,7 @@ Requires: jpackage-utils
This package contains the API documentation for %{name}.
%prep
%setup -q -n org.eclipse.tycho-%{name}-0.18.x
%setup -q -n %{name}-0.19.x
%patch0 -p1
%patch1 -p1
@ -207,7 +208,7 @@ mvn-rpmbuild -Dmaven.local.depmap.file=%{SOURCE2} -DskipTychoVersionCheck -Dmave
%patch4 -p1 -R
# EXACT version in reactor cache to build against (%%{version}-SNAPSHOT)
sed -i 's/<tychoBootstrapVersion>0.16.0<\/tychoBootstrapVersion>/<tychoBootstrapVersion>0.18.1-SNAPSHOT<\/tychoBootstrapVersion>/' pom.xml
sed -i 's/<tychoBootstrapVersion>0.18.1<\/tychoBootstrapVersion>/<tychoBootstrapVersion>0.19.0-SNAPSHOT<\/tychoBootstrapVersion>/' pom.xml
fi
%endif
@ -307,6 +308,9 @@ sed -i 's|<maven>|&<extension>zip</extension>|' \
%{_javadocdir}/%{name}
%changelog
* Thu Oct 24 2013 Roland Grunberg <rgrunber@redhat.com> - 0.19.0-1
- Update to 0.19.0 Release.
* Fri Oct 04 2013 Roland Grunberg <rgrunber@redhat.com> - 0.18.1-7
- Do not use XMvn internals (Bug 1015038).