use of org.robovm.compiler.util.AntPathMatcher in project robovm by robovm.
the class Resource method walk.
public void walk(Walker walker, File destDir) throws IOException {
if (targetPath != null && targetPath.trim().length() > 0) {
destDir = new File(destDir, targetPath);
}
if (path != null) {
// Walk path and all its descendants (if a directory) including
// everything except the default excludes.
walk(walker, path.getParentFile(), path.getName(), destDir, Collections.singletonList(MATCH_ALL_MATCHER), DEFAULTEXCLUDESMATCHERS);
} else {
List<AntPathMatcher> inc = toAntPathMatchers(includes);
if (inc.isEmpty()) {
inc.add(MATCH_ALL_MATCHER);
}
List<AntPathMatcher> exc = toAntPathMatchers(excludes);
if (!isIgnoreDefaultExcludes()) {
exc.addAll(DEFAULTEXCLUDESMATCHERS);
}
File dir = null;
if (directory != null) {
dir = directory.getCanonicalFile();
} else {
dir = new File("").getCanonicalFile();
}
if (dir.exists() && dir.isDirectory()) {
for (File f : dir.listFiles()) {
walk(walker, dir, f.getName(), destDir, inc, exc);
}
}
}
}
use of org.robovm.compiler.util.AntPathMatcher in project robovm by robovm.
the class AppCompiler method getMatchingClasses.
/**
* Returns all {@link Clazz}es in all {@link Path}s matching the specified
* ANT-style pattern.
*/
private Collection<Clazz> getMatchingClasses(String pattern) {
AntPathMatcher matcher = new AntPathMatcher(pattern, ".");
Map<String, Clazz> matches = new HashMap<String, Clazz>();
for (Path path : config.getClazzes().getPaths()) {
for (Clazz clazz : path.listClasses()) {
if (!matches.containsKey(clazz.getClassName()) && matcher.matches(clazz.getClassName())) {
matches.put(clazz.getClassName(), clazz);
}
}
}
return matches.values();
}
Aggregations