aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Sievers2012-01-31 10:55:49 (EST)
committerJan Sievers2012-01-31 11:37:40 (EST)
commitad06d9f10a7ca0dc380848a084ac25d4183c7c75 (patch)
treeea862520730d4fa8154a73c5794125725388bacc
parent1a043f098ced2f6f1e1a532f836b0db68bc4f397 (diff)
downloadorg.eclipse.tycho-ad06d9f10a7ca0dc380848a084ac25d4183c7c75.zip
org.eclipse.tycho-ad06d9f10a7ca0dc380848a084ac25d4183c7c75.tar.gz
org.eclipse.tycho-ad06d9f10a7ca0dc380848a084ac25d4183c7c75.tar.bz2
368083 Remove usePdeSourceRoots mojo parameters
- Remove usePdeSourceRoots parameter in tycho compiler mojo; adapt test pom.xml's - Also remove getConfiguredCompileSourceRoots() and corresponding compileSourceRoots read-only mojo parameter as this was only used if usePdeSourceRoots == false - Remove getConfiguredOutputDirectory() and corresponding read-only mojo parameter outputDirectory (method was unused) - Remove unused field outputFolders - Remove usePdeSourceRoots mojo parameter from osgi source mojo
-rw-r--r--tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java51
-rw-r--r--tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/OsgiCompilerMojo.java29
-rw-r--r--tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/OsgiTestCompilerMojo.java29
-rw-r--r--tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java3
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/accessrules/p001/pom.xml4
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/accessrules/p002/pom.xml4
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/accessrules/p003/pom.xml4
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/accessrules/p004/pom.xml4
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/bootclasspath-accessrules/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/classpath/p005/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/compilermessages/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/embedednonclasspath/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p001/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p002/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p003/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p005/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/A/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/B/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/C/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/multijar/pom.xml1
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/multisource/p001/pom.xml5
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/multisource/p002/pom.xml2
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/resources/p001/pom.xml2
-rw-r--r--tycho-compiler-plugin/src/test/resources/projects/resources/p002/pom.xml2
-rw-r--r--tycho-source-plugin/src/main/java/org/eclipse/tycho/source/OsgiSourceMojo.java65
26 files changed, 35 insertions, 182 deletions
diff --git a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java
index 2523750..6787fbe 100644
--- a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java
+++ b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java
@@ -21,7 +21,6 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
-import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -87,17 +86,6 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
private MavenProject project;
/**
- * If set to true, compiler will use source folders defined in build.properties file and will
- * ignore ${project.compileSourceRoots}/${project.testCompileSourceRoots}.
- *
- * Compilation will fail with an error, if this parameter is set to true but the project does
- * not have valid build.properties file.
- *
- * @parameter default-value="true"
- */
- private boolean usePdeSourceRoots;
-
- /**
* Transitively add specified maven artifacts to compile classpath in addition to elements
* calculated according to OSGi rules. All packages from additional entries will be accessible
* at compile time.
@@ -175,17 +163,12 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
*/
private BuildOutputJar outputJar;
- private final Set<File> outputFolders = new LinkedHashSet<File>();
-
/**
* @component role="org.eclipse.tycho.core.TychoProject"
*/
private Map<String, TychoProject> projectTypes;
public void execute() throws MojoExecutionException, CompilationFailureException {
- if (usePdeSourceRoots) {
- getLog().info("Using compile source roots from build.properties");
- }
for (BuildOutputJar jar : getEclipsePluginProject().getOutputJars()) {
this.outputJar = jar;
this.outputJar.getOutputDirectory().mkdirs();
@@ -285,7 +268,15 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
}
protected final List<String> getCompileSourceRoots() throws MojoExecutionException {
- return usePdeSourceRoots ? getPdeCompileSourceRoots() : getConfiguredCompileSourceRoots();
+ ArrayList<String> roots = new ArrayList<String>();
+ for (File folder : outputJar.getSourceFolders()) {
+ try {
+ roots.add(folder.getCanonicalPath());
+ } catch (IOException e) {
+ throw new MojoExecutionException("Unexpected IOException", e);
+ }
+ }
+ return roots;
}
public List<SourcepathEntry> getSourcepath() throws MojoExecutionException {
@@ -316,8 +307,6 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
return entries;
}
- protected abstract List<String> getConfiguredCompileSourceRoots();
-
protected SourceInclusionScanner getSourceInclusionScanner(int staleMillis) {
SourceInclusionScanner scanner = null;
@@ -348,28 +337,14 @@ public abstract class AbstractOsgiCompilerMojo extends AbstractCompilerMojo impl
return scanner;
}
- protected List<String> getPdeCompileSourceRoots() throws MojoExecutionException {
- ArrayList<String> roots = new ArrayList<String>();
- for (File folder : outputJar.getSourceFolders()) {
- try {
- roots.add(folder.getCanonicalPath());
- } catch (IOException e) {
- throw new MojoExecutionException("Unexpected IOException", e);
- }
- }
- return roots;
- }
-
@Override
protected CompilerConfiguration getCompilerConfiguration(List<String> compileSourceRoots)
throws MojoExecutionException {
CompilerConfiguration compilerConfiguration = super.getCompilerConfiguration(compileSourceRoots);
- if (usePdeSourceRoots) {
- String encoding = getEclipsePluginProject().getBuildProperties().getJarToJavacDefaultEncodingMap()
- .get(outputJar.getName());
- if (encoding != null) {
- compilerConfiguration.setSourceEncoding(encoding);
- }
+ String encoding = getEclipsePluginProject().getBuildProperties().getJarToJavacDefaultEncodingMap()
+ .get(outputJar.getName());
+ if (encoding != null) {
+ compilerConfiguration.setSourceEncoding(encoding);
}
configureSourceAndTargetLevel(compilerConfiguration);
configureJavaHome(compilerConfiguration);
diff --git a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/OsgiCompilerMojo.java b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/OsgiCompilerMojo.java
index ba8b231..97cf911 100644
--- a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/OsgiCompilerMojo.java
+++ b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/OsgiCompilerMojo.java
@@ -16,8 +16,6 @@
package org.eclipse.tycho.compiler;
-import java.io.File;
-import java.util.List;
/**
* @goal compile
@@ -27,31 +25,4 @@ import java.util.List;
*/
public class OsgiCompilerMojo extends AbstractOsgiCompilerMojo {
- /**
- * The source directories containing the test-source to be compiled.
- *
- * @parameter expression="${project.compileSourceRoots}"
- * @required
- * @readonly
- */
- private List<String> compileSourceRoots;
-
- /**
- * The directory where compiled test classes go.
- *
- * @parameter expression="${project.build.outputDirectory}"
- * @required
- * @readonly
- */
- private File outputDirectory;
-
- @Override
- protected List<String> getConfiguredCompileSourceRoots() {
- return compileSourceRoots;
- }
-
- protected File getConfiguredOutputDirectory() {
- return outputDirectory;
- }
-
}
diff --git a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/OsgiTestCompilerMojo.java b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/OsgiTestCompilerMojo.java
index 18459f8..ea2cc9e 100644
--- a/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/OsgiTestCompilerMojo.java
+++ b/tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/OsgiTestCompilerMojo.java
@@ -30,24 +30,6 @@ import org.apache.maven.plugin.MojoExecutionException;
public class OsgiTestCompilerMojo extends AbstractOsgiCompilerMojo {
/**
- * The source directories containing the test-source to be compiled.
- *
- * @parameter expression="${project.testCompileSourceRoots}"
- * @required
- * @readonly
- */
- private List<String> compileSourceRoots;
-
- /**
- * The directory where compiled test classes go.
- *
- * @parameter expression="${project.build.testOutputDirectory}"
- * @required
- * @readonly
- */
- private File testOutputDirectory;
-
- /**
* The directory where compiled test classes go.
*
* @parameter expression="${project.build.outputDirectory}"
@@ -57,17 +39,6 @@ public class OsgiTestCompilerMojo extends AbstractOsgiCompilerMojo {
private File outputDirectory;
@Override
- protected List<String> getConfiguredCompileSourceRoots() {
- return compileSourceRoots;
- }
-
- /**
- * output directory for this compile - the test output directory
- */
- protected File getConfiguredOutputDirectory() {
- return testOutputDirectory;
- }
-
public List getClasspathElements() throws MojoExecutionException {
List result = super.getClasspathElements();
result.add(0, outputDirectory.getAbsolutePath() + "[+**/*]");
diff --git a/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java b/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
index 8b759a4..fe40b80 100644
--- a/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
+++ b/tycho-compiler-plugin/src/test/java/org/eclipse/tycho/osgicompiler/test/OsgiCompilerTest.java
@@ -43,9 +43,6 @@ public class OsgiCompilerTest extends AbstractTychoMojoTestCase {
private AbstractOsgiCompilerMojo getMojo(List<MavenProject> projects, MavenProject project) throws Exception {
AbstractOsgiCompilerMojo mojo = (AbstractOsgiCompilerMojo) lookupMojo("compile", project.getFile());
setVariableValueToObject(mojo, "project", project);
-// setVariableValueToObject(mojo, "storage", storage);
- setVariableValueToObject(mojo, "outputDirectory",
- new File(project.getBuild().getOutputDirectory()).getAbsoluteFile());
setVariableValueToObject(mojo, "session", newMavenSession(project, projects));
// tycho-compiler-jdt does not support forked compilation
diff --git a/tycho-compiler-plugin/src/test/resources/projects/accessrules/p001/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/accessrules/p001/pom.xml
index a382bb2..833669b 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/accessrules/p001/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/accessrules/p001/pom.xml
@@ -19,11 +19,7 @@
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
- <compileSourceRoots>
- <compileSourceRoot>target/projects/accessrules/p001/src</compileSourceRoot>
- </compileSourceRoots>
<compilerId>jdt</compilerId>
- <outputDirectory>target/projects/p001/accessrules/target/classes</outputDirectory>
<buildDirectory>target/projects/p001/accessrules/target</buildDirectory>
</configuration>
</plugin>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/accessrules/p002/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/accessrules/p002/pom.xml
index 4b86996..6f0a616 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/accessrules/p002/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/accessrules/p002/pom.xml
@@ -18,11 +18,7 @@
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
- <compileSourceRoots>
- <compileSourceRoot>target/projects/accessrules/p002/src</compileSourceRoot>
- </compileSourceRoots>
<compilerId>jdt</compilerId>
- <outputDirectory>target/projects/p002/accessrules/target/classes</outputDirectory>
<buildDirectory>target/projects/p002/accessrules/target</buildDirectory>
</configuration>
</plugin>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/accessrules/p003/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/accessrules/p003/pom.xml
index 4463793..1af24e0 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/accessrules/p003/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/accessrules/p003/pom.xml
@@ -19,11 +19,7 @@
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
- <compileSourceRoots>
- <compileSourceRoot>target/projects/accessrules/p001/src</compileSourceRoot>
- </compileSourceRoots>
<compilerId>jdt</compilerId>
- <outputDirectory>target/projects/p003/accessrules/target/classes</outputDirectory>
<buildDirectory>target/projects/p003/accessrules/target</buildDirectory>
</configuration>
</plugin>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/accessrules/p004/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/accessrules/p004/pom.xml
index 2238306..7975c61 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/accessrules/p004/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/accessrules/p004/pom.xml
@@ -19,11 +19,7 @@
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
- <compileSourceRoots>
- <compileSourceRoot>target/projects/accessrules/p001/src</compileSourceRoot>
- </compileSourceRoots>
<compilerId>jdt</compilerId>
- <outputDirectory>target/projects/p003/accessrules/target/classes</outputDirectory>
<buildDirectory>target/projects/p003/accessrules/target</buildDirectory>
</configuration>
</plugin>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/bootclasspath-accessrules/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/bootclasspath-accessrules/pom.xml
index 93f975f..6f9a9a5 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/bootclasspath-accessrules/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/bootclasspath-accessrules/pom.xml
@@ -16,7 +16,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
<buildDirectory>target/projects/bootclasspath-accessrules/target</buildDirectory>
</configuration>
</plugin>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/classpath/p005/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/classpath/p005/pom.xml
index bff2790..6719849 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/classpath/p005/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/classpath/p005/pom.xml
@@ -19,7 +19,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
</plugins>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/compilermessages/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/compilermessages/pom.xml
index 47880e4..64b2d72 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/compilermessages/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/compilermessages/pom.xml
@@ -14,7 +14,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/embedednonclasspath/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/embedednonclasspath/pom.xml
index c4568bc..837c082 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/embedednonclasspath/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/embedednonclasspath/pom.xml
@@ -14,7 +14,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
</plugins>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p001/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p001/pom.xml
index 0133545..57eb2b0 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p001/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p001/pom.xml
@@ -19,7 +19,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
</plugins>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p002/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p002/pom.xml
index 1b2b4ce..3058a35 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p002/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p002/pom.xml
@@ -19,7 +19,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
</plugins>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p003/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p003/pom.xml
index 281c878..8b1aebe 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p003/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p003/pom.xml
@@ -19,7 +19,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
<source>1.5</source>
<target>jsr14</target>
</configuration>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/pom.xml
index 118804d..f0c3966 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p004/pom.xml
@@ -19,7 +19,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
<plugin>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p005/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p005/pom.xml
index 9a52b80..817960b 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p005/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/executionEnvironment/p005/pom.xml
@@ -19,7 +19,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
</plugins>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/A/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/A/pom.xml
index 6647c9d..6edbe3d 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/A/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/A/pom.xml
@@ -18,7 +18,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
</plugins>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/B/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/B/pom.xml
index f53e418..a4bafa0 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/B/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/B/pom.xml
@@ -18,7 +18,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
</plugins>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/C/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/C/pom.xml
index 7679aa1..443f522 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/C/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/indirectDependencies/C/pom.xml
@@ -18,7 +18,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
</plugins>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/multijar/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/multijar/pom.xml
index 6c0f02b..8afe555 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/multijar/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/multijar/pom.xml
@@ -14,7 +14,6 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
</plugins>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/multisource/p001/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/multisource/p001/pom.xml
index 78cf741..5197881 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/multisource/p001/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/multisource/p001/pom.xml
@@ -14,12 +14,7 @@
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
- <compileSourceRoots>
- <compileSourceRoot>target/projects/multisource/p001/src</compileSourceRoot>
- <compileSourceRoot>target/projects/multisource/p001/src2</compileSourceRoot>
- </compileSourceRoots>
<compilerId>jdt</compilerId>
- <outputDirectory>target/projects/multisource/p001/target/classes</outputDirectory>
<buildDirectory>target/projects/multisource/p001/target</buildDirectory>
</configuration>
</plugin>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/multisource/p002/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/multisource/p002/pom.xml
index 7742e54..9e18a3d 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/multisource/p002/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/multisource/p002/pom.xml
@@ -14,9 +14,7 @@
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
- <usePdeSourceRoots>true</usePdeSourceRoots>
<compilerId>jdt</compilerId>
- <outputDirectory>target/projects/multisource/p002/target/classes</outputDirectory>
<buildDirectory>target/projects/multisource/p002/target</buildDirectory>
</configuration>
</plugin>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/resources/p001/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/resources/p001/pom.xml
index 8994e12..8b521db 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/resources/p001/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/resources/p001/pom.xml
@@ -15,9 +15,7 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <outputDirectory>target/projects/resources/p001/target/classes</outputDirectory>
<buildDirectory>target/projects/resources/p001/target</buildDirectory>
- <usePdeSourceRoots>true</usePdeSourceRoots>
</configuration>
</plugin>
</plugins>
diff --git a/tycho-compiler-plugin/src/test/resources/projects/resources/p002/pom.xml b/tycho-compiler-plugin/src/test/resources/projects/resources/p002/pom.xml
index b250a92..913b4d1 100644
--- a/tycho-compiler-plugin/src/test/resources/projects/resources/p002/pom.xml
+++ b/tycho-compiler-plugin/src/test/resources/projects/resources/p002/pom.xml
@@ -15,9 +15,7 @@
<version>${tycho-version}</version>
<configuration>
<compilerId>jdt</compilerId>
- <outputDirectory>target/projects/resources/p002/target/classes</outputDirectory>
<buildDirectory>target/projects/resources/p002/target</buildDirectory>
- <usePdeSourceRoots>true</usePdeSourceRoots>
<!-- as an example for non-java source files, AspectJ files should not be
copied to the target folder as resources -->
<excludeResources>
diff --git a/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/OsgiSourceMojo.java b/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/OsgiSourceMojo.java
index 079c84a..63433b2 100644
--- a/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/OsgiSourceMojo.java
+++ b/tycho-source-plugin/src/main/java/org/eclipse/tycho/source/OsgiSourceMojo.java
@@ -52,17 +52,6 @@ public class OsgiSourceMojo extends AbstractSourceJarMojo {
private static final String VERSION_QUALIFIER = "qualifier";
/**
- * If set to true, compiler will use source folders defined in build.properties file and will
- * ignore ${project.compileSourceRoots}/${project.testCompileSourceRoots}.
- *
- * Compilation will fail with an error, if this parameter is set to true but the project does
- * not have valid build.properties file.
- *
- * @parameter default-value="true"
- */
- private boolean usePdeSourceRoots;
-
- /**
* Whether the source jar should be an Eclipse source bundle.
*
* @parameter default-value="true"
@@ -114,26 +103,22 @@ public class OsgiSourceMojo extends AbstractSourceJarMojo {
/** {@inheritDoc} */
protected List<String> getSources(MavenProject p) throws MojoExecutionException {
- return getSources(project, usePdeSourceRoots, requireSourceRoots, buildPropertiesParser);
+ return getSources(project, requireSourceRoots, buildPropertiesParser);
}
- protected static List<String> getSources(MavenProject p, boolean usePdeSourceRoots, boolean requireSourceRoots,
+ protected static List<String> getSources(MavenProject p, boolean requireSourceRoots,
BuildPropertiesParser buildPropertiesParser) throws MojoExecutionException {
- if (usePdeSourceRoots) {
- List<String> sources = new ArrayList<String>();
- for (List<String> sourceFolderList : buildPropertiesParser.parse(p.getBasedir()).getJarToSourceFolderMap()
- .values()) {
- for (String sourceFolder : sourceFolderList) {
- sources.add(new File(p.getBasedir(), sourceFolder).getAbsolutePath());
- }
+ List<String> sources = new ArrayList<String>();
+ for (List<String> sourceFolderList : buildPropertiesParser.parse(p.getBasedir()).getJarToSourceFolderMap()
+ .values()) {
+ for (String sourceFolder : sourceFolderList) {
+ sources.add(new File(p.getBasedir(), sourceFolder).getAbsolutePath());
}
- if (requireSourceRoots && sources.isEmpty()) {
- throw new MojoExecutionException("no source folders found in build.properties");
- }
- return sources;
- } else {
- return p.getCompileSourceRoots();
}
+ if (requireSourceRoots && sources.isEmpty()) {
+ throw new MojoExecutionException("no source folders found in build.properties");
+ }
+ return sources;
}
/** {@inheritDoc} */
@@ -141,21 +126,17 @@ public class OsgiSourceMojo extends AbstractSourceJarMojo {
if (excludeResources) {
return Collections.emptyList();
}
- if (usePdeSourceRoots) {
- BuildProperties buildProperties = buildPropertiesParser.parse(p.getBasedir());
- List<String> srcIncludesList = buildProperties.getSourceIncludes();
- if (srcIncludesList.isEmpty()) {
- return Collections.emptyList();
- }
- checkSourceIncludesExist(p, buildProperties);
- Resource resource = new Resource();
- resource.setDirectory(project.getBasedir().getAbsolutePath());
- resource.setExcludes(buildProperties.getSourceExcludes());
- resource.setIncludes(srcIncludesList);
- return Collections.singletonList(resource);
+ BuildProperties buildProperties = buildPropertiesParser.parse(p.getBasedir());
+ List<String> srcIncludesList = buildProperties.getSourceIncludes();
+ if (srcIncludesList.isEmpty()) {
+ return Collections.emptyList();
}
-
- return p.getResources();
+ checkSourceIncludesExist(p, buildProperties);
+ Resource resource = new Resource();
+ resource.setDirectory(project.getBasedir().getAbsolutePath());
+ resource.setExcludes(buildProperties.getSourceExcludes());
+ resource.setIncludes(srcIncludesList);
+ return Collections.singletonList(resource);
}
/** {@inheritDoc} */
@@ -230,10 +211,8 @@ public class OsgiSourceMojo extends AbstractSourceJarMojo {
if (requireSourceRoots) {
return true;
}
- boolean usePdeSourceRoots = Boolean.parseBoolean(getParameterValue(execution, "usePdeSourceRoots",
- "true"));
try {
- if (!getSources(project, usePdeSourceRoots, requireSourceRoots, buildPropertiesParser).isEmpty()) {
+ if (!getSources(project, requireSourceRoots, buildPropertiesParser).isEmpty()) {
return true;
}
} catch (MojoExecutionException e) {