diff --git a/biz.aQute.bndlib/src/aQute/bnd/build/Project.java b/biz.aQute.bndlib/src/aQute/bnd/build/Project.java index c4338e8954..fb147c90e7 100644 --- a/biz.aQute.bndlib/src/aQute/bnd/build/Project.java +++ b/biz.aQute.bndlib/src/aQute/bnd/build/Project.java @@ -498,19 +498,19 @@ public File getSrc() throws Exception { } public File getSrcOutput() { - return getFile(getProperty(Constants.DEFAULT_PROP_BIN_DIR)); + return getSingleFile(Constants.DEFAULT_PROP_BIN_DIR); } public File getTestSrc() { - return getFile(getProperty(Constants.DEFAULT_PROP_TESTSRC_DIR)); + return getSingleFile(Constants.DEFAULT_PROP_TESTSRC_DIR); } public File getTestOutput() { - return getFile(getProperty(Constants.DEFAULT_PROP_TESTBIN_DIR)); + return getSingleFile(Constants.DEFAULT_PROP_TESTBIN_DIR); } public File getTargetDir() { - return getFile(getProperty(Constants.DEFAULT_PROP_TARGET_DIR)); + return getSingleFile(Constants.DEFAULT_PROP_TARGET_DIR); } private void traverse(Set dependencies, Project dependent, Set visited) throws Exception { @@ -524,6 +524,17 @@ private void traverse(Set dependencies, Project dependent, Set dependents.add(dependent); } + private File getSingleFile(String key) { + String value = getProperty(key); + if (value == null) { + error("project.%s expected value for property %s but got null", key, key); + value = key; + } else if (value.indexOf(',') >= 0) { + error("project.%s expected one file path for property %s but got multiple: %s", key, key, value); + } + return getFile(value); + } + /** * Iterate over the entries and place the projects on the projects list and * all the files of the entries on the resultpath. @@ -1921,8 +1932,7 @@ public File[] buildLocal(boolean underTest) throws Exception { if (lastModified < jar.lastModified()) { lastModified = jar.lastModified(); } - Supplier indexer = ResourceBuilder.memoize(jar, - file.toURI(), + Supplier indexer = ResourceBuilder.memoize(jar, file.toURI(), getName()); if (indexer != null) { resourceBuilders.add(indexer); @@ -1987,7 +1997,6 @@ public File[] buildLocal(boolean underTest) throws Exception { } } - boolean bfsWrite = !bfs.exists() || (lastModified > bfs.lastModified()); if (buildfiles != null) { Set removed = Create.set(buildfiles);