}
if (!prefix.endsWith(".") && prefix.length() > 0) {
prefix = prefix + ".";
}
SearchEngine searcher = new SearchEngine(settings);
PatternMatcher patternMatcher = new PatternMatcher() {
private PatternMatcher exact = new ExactPatternMatcher();
private PatternMatcher regexp = new ExactOrRegexpPatternMatcher();
public Matcher getMatcher(String expression) {
if ((expression == organisation)
|| (expression == module)
|| (expression == branch)) {
return exact.getMatcher(expression);
}
return regexp.getMatcher(expression);
}
public String getName() {
return "buildnumber-matcher";
}
};
ModuleRevisionId[] revisions;
if (resolver == null) {
revisions = searcher.listModules(ModuleRevisionId.newInstance(organisation,
module, branch, ".*"), patternMatcher);
} else {
DependencyResolver depResolver = settings.getResolver(resolver);
if (depResolver == null) {
throw new BuildException("Unknown resolver: " + resolver);
}
revisions = searcher.listModules(depResolver, ModuleRevisionId.newInstance(organisation,
module, branch, ".*"), patternMatcher);
}
ArtifactInfo[] infos = new ArtifactInfo[revisions.length];
for (int i = 0; i < revisions.length; i++) {