public DefaultSourceSet(String name, FileResolver fileResolver) { 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 resourcesDisplayName = String.format("%s resources", displayName); resources = new DefaultSourceDirectorySet(resourcesDisplayName, fileResolver); resources.getFilter().exclude(new Spec<FileTreeElement>() { public boolean isSatisfiedBy(FileTreeElement element) { return javaSource.contains(element.getFile()); } }); String allSourceDisplayName = String.format("%s source", displayName); allSource = new DefaultSourceDirectorySet(allSourceDisplayName, fileResolver); allSource.source(resources); allSource.source(javaSource); }
public DefaultScalaSourceSet(String displayName, FileResolver fileResolver) { scala = new DefaultSourceDirectorySet(String.format("%s Scala source", displayName), fileResolver); scala.getFilter().include("**/*.java", "**/*.scala"); allScala = new DefaultSourceDirectorySet(String.format("%s Scala source", displayName), fileResolver); allScala.getFilter().include("**/*.scala"); allScala.source(scala); }
public DefaultGroovySourceSet(String displayName, FileResolver fileResolver) { groovy = new DefaultSourceDirectorySet(String.format("%s Groovy source", displayName), fileResolver); groovy.getFilter().include("**/*.java", "**/*.groovy"); allGroovy = new DefaultSourceDirectorySet(String.format("%s Groovy source", displayName), fileResolver); allGroovy.source(groovy); allGroovy.getFilter().include("**/*.groovy"); }
public void apply(final Project target) { target.getPlugins().apply(JvmLanguagePlugin.class); BinaryContainer jvmBinaryContainer = target.getExtensions().getByType(BinaryContainer.class); jvmBinaryContainer.withType(ClassDirectoryBinary.class).all(new Action<ClassDirectoryBinary>() { public void execute(final ClassDirectoryBinary binary) { final BinaryNamingScheme namingScheme = ((BinaryInternal) binary).getNamingScheme(); binary.getSource().withType(JavaSourceSet.class).all(new Action<JavaSourceSet>() { public void execute(JavaSourceSet javaSourceSet) { // TODO: handle case where binary has multiple JavaSourceSet's JavaCompile compileTask = target.getTasks().create(namingScheme.getTaskName("compile", "java"), JavaCompile.class); configureCompileTask(compileTask, javaSourceSet, binary); binary.builtBy(compileTask); } }); } }); ProjectSourceSet projectSourceSet = target.getExtensions().getByType(DefaultProjectSourceSet.class); projectSourceSet.all(new Action<FunctionalSourceSet>() { public void execute(final FunctionalSourceSet functionalSourceSet) { functionalSourceSet.registerFactory(JavaSourceSet.class, new NamedDomainObjectFactory<JavaSourceSet>() { public JavaSourceSet create(String name) { return instantiator.newInstance(DefaultJavaSourceSet.class, name, instantiator.newInstance(DefaultSourceDirectorySet.class, name, fileResolver), instantiator.newInstance(DefaultClasspath.class, fileResolver, target.getTasks()), functionalSourceSet); } }); } }); }
public AntlrSourceVirtualDirectoryImpl(String parentDisplayName, FileResolver fileResolver) { final String displayName = String.format("%s Antlr source", parentDisplayName); antlr = new DefaultSourceDirectorySet(displayName, fileResolver); antlr.getFilter().include("**/*.g"); }
public DefaultPrebuiltLibrary(String name, FileResolver fileResolver) { this.name = name; headers = new DefaultSourceDirectorySet("headers", fileResolver); binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class); }
@Inject public DefaultJvmResourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) { super(name, parent, "JVM resources", new DefaultSourceDirectorySet("source", fileResolver)); }
@Inject public DefaultJavaSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) { super(name, parent, "Java source", new DefaultSourceDirectorySet("source", fileResolver)); this.compileClasspath = new EmptyClasspath(); }
@Inject public DefaultObjectiveCSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) { super(name, parent, fileResolver, "Objective-C source", new DefaultSourceDirectorySet("source", fileResolver)); }
public AbstractHeaderExportingSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver, String typeName, SourceDirectorySet source) { super(name, parent, typeName, source); this.exportedHeaders = new DefaultSourceDirectorySet("exported headers", fileResolver); this.implicitHeaders = new DefaultSourceDirectorySet("implicit headers", fileResolver); }
public DefaultWindowsResourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) { super(name, parent, fileResolver, "windows resources", new DefaultSourceDirectorySet("source", fileResolver)); }
public DefaultCppSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) { super(name, parent, fileResolver, "C++ source", new DefaultSourceDirectorySet("source", fileResolver)); }
@Inject public DefaultCSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) { super(name, parent, fileResolver, "C source", new DefaultSourceDirectorySet("source", fileResolver)); }
public DefaultAssemblerSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) { super(name, parent, "assembler source", new DefaultSourceDirectorySet("source", fileResolver)); }
@Inject public DefaultObjectiveCppSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) { super(name, parent, fileResolver, "Objective-C++ source", new DefaultSourceDirectorySet("source", fileResolver)); }
public DefaultPrebuiltLibrary(String name, FileResolver fileResolver) { this.name = name; headers = new DefaultSourceDirectorySet("headers", fileResolver); binaries = new DefaultDomainObjectSet<NativeBinary>(NativeBinary.class); }
@Inject public DefaultObjectiveCSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) { super(name, parent, project, "Objective-C source", new DefaultSourceDirectorySet("source", project.getFileResolver())); }
public DefaultWindowsResourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) { super(name, parent, project, "windows resources", new DefaultSourceDirectorySet("source", project.getFileResolver())); }
public DefaultCppSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) { super(name, parent, project, "C++ source", new DefaultSourceDirectorySet("source", project.getFileResolver())); }
@Inject public DefaultCSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) { super(name, parent, project, "C source", new DefaultSourceDirectorySet("source", project.getFileResolver())); }
public AbstractHeaderExportingSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project, String typeName, SourceDirectorySet source) { super(name, parent, typeName, source); this.exportedHeaders = new DefaultSourceDirectorySet("exported headers", project.getFileResolver()); this.implicitHeaders = new DefaultSourceDirectorySet("implicit headers", project.getFileResolver()); }
public DefaultAssemblerSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) { super(name, parent, "assembler source", new DefaultSourceDirectorySet("source", project.getFileResolver())); }
@Inject public DefaultObjectiveCppSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) { super(name, parent, project, "Objective-C++ source", new DefaultSourceDirectorySet("source", project.getFileResolver())); }
public VelocitySourceSet(String displayName, FileResolver fileResolver) { velocity = new DefaultSourceDirectorySet(String.format("Velocity %s source", displayName), fileResolver); velocity.getFilter().include("**/*.java"); }