this.name = name;
displayName = GUtil.toWords(this.name);
String javaSrcDisplayName = String.format("%s Java source", displayName);
javaSource = new DefaultSourceDirectorySet(javaSrcDisplayName, fileResolver);
javaSource.getFilter().include("**/*.java");
allJavaSource = new DefaultSourceDirectorySet(javaSrcDisplayName, fileResolver);
allJavaSource.getFilter().include("**/*.java");
allJavaSource.source(javaSource);
String javaResourcesDisplayName = String.format("%s Java resources", displayName);
javaResources = new DefaultSourceDirectorySet(javaResourcesDisplayName, fileResolver);
javaResources.getFilter().exclude(new Spec<FileTreeElement>() {
@Override
public boolean isSatisfiedBy(FileTreeElement element) {
return javaSource.contains(element.getFile());
}
});
String allSourceDisplayName = String.format("%s source", displayName);
allSource = new DefaultSourceDirectorySet(allSourceDisplayName, fileResolver);
allSource.source(javaResources);
allSource.source(javaSource);
String manifestDisplayName = String.format("%s manifest", displayName);
manifest = new DefaultAndroidSourceFile(manifestDisplayName, fileResolver);