aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarrie Treloar2012-04-23 00:37:56 (EDT)
committerJan Sievers2012-04-23 12:27:48 (EDT)
commitd9d43d85620c304adb0e2f9eea67605b2b6b41d2 (patch)
treeffb71621b0dc3c144d87afc072d1c939f76d0795
parent44a45b8f13998a4dfca3452e8bb71e42a1384d72 (diff)
downloadorg.eclipse.tycho-d9d43d85620c304adb0e2f9eea67605b2b6b41d2.zip
org.eclipse.tycho-d9d43d85620c304adb0e2f9eea67605b2b6b41d2.tar.gz
org.eclipse.tycho-d9d43d85620c304adb0e2f9eea67605b2b6b41d2.tar.bz2
377371 bin.includes must be specified in build.propertiesrefs/changes/42/5642/3
added testCheckBinIncludesNotSpecified to show bug when build.properties exists but bin.includes is not specified Null or empty includePatterns for plugins and features now fail in strict mode (default), otherwise log a warning. As a side-effect of this commit, missing build.properties for plugin and feature projects will now fail the build by default (strict bin.includes mode) Change-Id: I187ae99c5b426fe41c27bcbebe8b58e699e7a1fd
-rw-r--r--tycho-its/projects/363331_extraTargetPlatformRequirements/artificial/build.properties1
-rw-r--r--tycho-its/projects/367701_reactorIndirectOptionalDependencies/reactorbundle/build.properties1
-rw-r--r--tycho-its/projects/TYCHO0432configurableFailIfNoTests/build.properties1
-rw-r--r--tycho-its/projects/compiler.optionalDependencies/require-bundle-ignore/build.properties1
-rw-r--r--tycho-its/projects/compiler.optionalDependencies/require-bundle/build.properties1
-rw-r--r--tycho-its/projects/symLink/project/build.properties1
-rw-r--r--tycho-its/projects/target.restriction.filter/build.properties1
-rw-r--r--tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/IncludeValidationHelper.java9
-rw-r--r--tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java6
-rw-r--r--tycho-packaging-plugin/src/test/java/org/eclipse/tycho/packaging/IncludeValidationHelperTest.java11
10 files changed, 29 insertions, 4 deletions
diff --git a/tycho-its/projects/363331_extraTargetPlatformRequirements/artificial/build.properties b/tycho-its/projects/363331_extraTargetPlatformRequirements/artificial/build.properties
index 8e82761..1a74d28 100644
--- a/tycho-its/projects/363331_extraTargetPlatformRequirements/artificial/build.properties
+++ b/tycho-its/projects/363331_extraTargetPlatformRequirements/artificial/build.properties
@@ -1,3 +1,4 @@
jars.compile.order = .
source.. = src/
output.. = target/classes
+bin.includes = META-INF/, .
diff --git a/tycho-its/projects/367701_reactorIndirectOptionalDependencies/reactorbundle/build.properties b/tycho-its/projects/367701_reactorIndirectOptionalDependencies/reactorbundle/build.properties
new file mode 100644
index 0000000..6404c0c
--- /dev/null
+++ b/tycho-its/projects/367701_reactorIndirectOptionalDependencies/reactorbundle/build.properties
@@ -0,0 +1 @@
+bin.includes = META-INF/ \ No newline at end of file
diff --git a/tycho-its/projects/TYCHO0432configurableFailIfNoTests/build.properties b/tycho-its/projects/TYCHO0432configurableFailIfNoTests/build.properties
new file mode 100644
index 0000000..735a47b
--- /dev/null
+++ b/tycho-its/projects/TYCHO0432configurableFailIfNoTests/build.properties
@@ -0,0 +1 @@
+bin.includes=META-INF/ \ No newline at end of file
diff --git a/tycho-its/projects/compiler.optionalDependencies/require-bundle-ignore/build.properties b/tycho-its/projects/compiler.optionalDependencies/require-bundle-ignore/build.properties
index 8e82761..1a74d28 100644
--- a/tycho-its/projects/compiler.optionalDependencies/require-bundle-ignore/build.properties
+++ b/tycho-its/projects/compiler.optionalDependencies/require-bundle-ignore/build.properties
@@ -1,3 +1,4 @@
jars.compile.order = .
source.. = src/
output.. = target/classes
+bin.includes = META-INF/, .
diff --git a/tycho-its/projects/compiler.optionalDependencies/require-bundle/build.properties b/tycho-its/projects/compiler.optionalDependencies/require-bundle/build.properties
index 8e82761..1a74d28 100644
--- a/tycho-its/projects/compiler.optionalDependencies/require-bundle/build.properties
+++ b/tycho-its/projects/compiler.optionalDependencies/require-bundle/build.properties
@@ -1,3 +1,4 @@
jars.compile.order = .
source.. = src/
output.. = target/classes
+bin.includes = META-INF/, .
diff --git a/tycho-its/projects/symLink/project/build.properties b/tycho-its/projects/symLink/project/build.properties
new file mode 100644
index 0000000..5f22cdd
--- /dev/null
+++ b/tycho-its/projects/symLink/project/build.properties
@@ -0,0 +1 @@
+bin.includes = META-INF/
diff --git a/tycho-its/projects/target.restriction.filter/build.properties b/tycho-its/projects/target.restriction.filter/build.properties
index 63f21dd..f82aab1 100644
--- a/tycho-its/projects/target.restriction.filter/build.properties
+++ b/tycho-its/projects/target.restriction.filter/build.properties
@@ -1,2 +1,3 @@
source.. = src/
output.. = target/classes
+bin.includes=META-INF/,.
diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/IncludeValidationHelper.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/IncludeValidationHelper.java
index 2bcb20b..ab2c8e9 100644
--- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/IncludeValidationHelper.java
+++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/IncludeValidationHelper.java
@@ -52,6 +52,15 @@ public class IncludeValidationHelper {
File baseDir = project.getBasedir();
List<String> nonMatchingIncludes = new ArrayList<String>();
List<String> ignoreList = Arrays.asList(ignoredIncludes);
+ if (includePatterns == null || includePatterns.isEmpty()) {
+ String message = new File(baseDir, "build.properties").getAbsolutePath() + ": " + buildPropertiesKey
+ + " value(s) must be specified.";
+ if (strict) {
+ throw new MojoExecutionException(message);
+ } else {
+ log.warn(message);
+ }
+ }
for (String includePattern : includePatterns) {
if (ignoreList.contains(includePattern)) {
continue;
diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java
index 085e3ab..11a02a5 100644
--- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java
+++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java
@@ -129,10 +129,8 @@ public class PackagePluginMojo extends AbstractTychoPackagingMojo {
}
}
// 2. handle nested jars and included resources
- if (binIncludesList.size() > 0) {
- checkBinIncludesExist(buildProperties, binIncludesIgnoredForValidation.toArray(new String[0]));
- archiver.getArchiver().addFileSet(getFileSet(project.getBasedir(), binIncludesList, binExcludesList));
- }
+ checkBinIncludesExist(buildProperties, binIncludesIgnoredForValidation.toArray(new String[0]));
+ archiver.getArchiver().addFileSet(getFileSet(project.getBasedir(), binIncludesList, binExcludesList));
File manifest = updateManifest();
if (manifest.exists()) {
diff --git a/tycho-packaging-plugin/src/test/java/org/eclipse/tycho/packaging/IncludeValidationHelperTest.java b/tycho-packaging-plugin/src/test/java/org/eclipse/tycho/packaging/IncludeValidationHelperTest.java
index 033b23b..3efdd82 100644
--- a/tycho-packaging-plugin/src/test/java/org/eclipse/tycho/packaging/IncludeValidationHelperTest.java
+++ b/tycho-packaging-plugin/src/test/java/org/eclipse/tycho/packaging/IncludeValidationHelperTest.java
@@ -59,6 +59,17 @@ public class IncludeValidationHelperTest {
}
@Test
+ public void testCheckBinIncludesNotSpecified() throws Exception {
+ BuildPropertiesImpl buildProperties = createBuildProperties("no.bin.includes", "bin.includes is not specified");
+ try {
+ subject.checkBinIncludesExist(createMockProject(), buildProperties, true);
+ fail();
+ } catch (MojoExecutionException e) {
+ assertStringContains("bin.includes value(s) must be specified", e.getMessage());
+ }
+ }
+
+ @Test
public void testCheckSourceIncludesDontExist() throws Exception {
BuildPropertiesImpl buildProperties = createBuildProperties("src.includes", "foo3, bar3*,**/*.me");
try {