Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning on bin, testsrc, testbin, target properties to be single file… #6057

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions biz.aQute.bndlib/src/aQute/bnd/build/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Project> dependencies, Project dependent, Set<Project> visited) throws Exception {
Expand All @@ -524,6 +524,17 @@ private void traverse(Set<Project> dependencies, Project dependent, Set<Project>
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.
Expand Down Expand Up @@ -1921,8 +1932,7 @@ public File[] buildLocal(boolean underTest) throws Exception {
if (lastModified < jar.lastModified()) {
lastModified = jar.lastModified();
}
Supplier<org.osgi.resource.Resource> indexer = ResourceBuilder.memoize(jar,
file.toURI(),
Supplier<org.osgi.resource.Resource> indexer = ResourceBuilder.memoize(jar, file.toURI(),
getName());
if (indexer != null) {
resourceBuilders.add(indexer);
Expand Down Expand Up @@ -1987,7 +1997,6 @@ public File[] buildLocal(boolean underTest) throws Exception {
}
}


boolean bfsWrite = !bfs.exists() || (lastModified > bfs.lastModified());
if (buildfiles != null) {
Set<File> removed = Create.set(buildfiles);
Expand Down
7 changes: 5 additions & 2 deletions biz.aQute.bndlib/src/aQute/bnd/differ/Baseline.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
import static aQute.bnd.service.diff.Delta.UNCHANGED;

import java.io.IOException;
import java.util.*;
import java.util.Collection;
import java.util.Collections;
import java.util.Formatter;
import java.util.Map;
import java.util.Set;
import java.util.jar.Manifest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import aQute.bnd.header.Attrs;
import aQute.bnd.header.OSGiHeader;
import aQute.bnd.header.Parameters;
import aQute.bnd.osgi.Constants;
Expand Down
Loading