Java 类org.gradle.api.internal.file.DefaultSourceDirectorySet 实例源码

项目:Pushjet-Android    文件:DefaultSourceSet.java   
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);
}
项目:Pushjet-Android    文件:DefaultSourceSet.java   
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);
}
项目:Pushjet-Android    文件:DefaultScalaSourceSet.java   
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);
}
项目:Pushjet-Android    文件:DefaultGroovySourceSet.java   
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");
}
项目:Pushjet-Android    文件:DefaultScalaSourceSet.java   
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);
}
项目:Pushjet-Android    文件:DefaultGroovySourceSet.java   
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");
}
项目:Pushjet-Android    文件:JavaLanguagePlugin.java   
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);
                }
            });
        }
    });
}
项目:Pushjet-Android    文件:AntlrSourceVirtualDirectoryImpl.java   
public AntlrSourceVirtualDirectoryImpl(String parentDisplayName, FileResolver fileResolver) {
    final String displayName = String.format("%s Antlr source", parentDisplayName);
    antlr = new DefaultSourceDirectorySet(displayName, fileResolver);
    antlr.getFilter().include("**/*.g");
}
项目:Pushjet-Android    文件:DefaultPrebuiltLibrary.java   
public DefaultPrebuiltLibrary(String name, FileResolver fileResolver) {
    this.name = name;
    headers = new DefaultSourceDirectorySet("headers", fileResolver);
    binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class);
}
项目:Pushjet-Android    文件:DefaultJvmResourceSet.java   
@Inject
public DefaultJvmResourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) {
    super(name, parent, "JVM resources", new DefaultSourceDirectorySet("source", fileResolver));
}
项目:Pushjet-Android    文件:DefaultJavaSourceSet.java   
@Inject
public DefaultJavaSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) {
    super(name, parent, "Java source", new DefaultSourceDirectorySet("source", fileResolver));
    this.compileClasspath = new EmptyClasspath();
}
项目:Pushjet-Android    文件:DefaultObjectiveCSourceSet.java   
@Inject
public DefaultObjectiveCSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) {
    super(name, parent, fileResolver, "Objective-C source", new DefaultSourceDirectorySet("source", fileResolver));
}
项目:Pushjet-Android    文件:AbstractHeaderExportingSourceSet.java   
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);
}
项目:Pushjet-Android    文件:DefaultWindowsResourceSet.java   
public DefaultWindowsResourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) {
   super(name, parent, fileResolver, "windows resources", new DefaultSourceDirectorySet("source", fileResolver));
}
项目:Pushjet-Android    文件:DefaultCppSourceSet.java   
public DefaultCppSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) {
    super(name, parent, fileResolver, "C++ source", new DefaultSourceDirectorySet("source", fileResolver));
}
项目:Pushjet-Android    文件:DefaultCSourceSet.java   
@Inject
public DefaultCSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) {
    super(name, parent, fileResolver, "C source", new DefaultSourceDirectorySet("source", fileResolver));
}
项目:Pushjet-Android    文件:DefaultAssemblerSourceSet.java   
public DefaultAssemblerSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) {
    super(name, parent, "assembler source", new DefaultSourceDirectorySet("source", fileResolver));
}
项目:Pushjet-Android    文件:DefaultObjectiveCppSourceSet.java   
@Inject
public DefaultObjectiveCppSourceSet(String name, FunctionalSourceSet parent, FileResolver fileResolver) {
    super(name, parent, fileResolver, "Objective-C++ source", new DefaultSourceDirectorySet("source", fileResolver));
}
项目:Pushjet-Android    文件:AntlrSourceVirtualDirectoryImpl.java   
public AntlrSourceVirtualDirectoryImpl(String parentDisplayName, FileResolver fileResolver) {
    final String displayName = String.format("%s Antlr source", parentDisplayName);
    antlr = new DefaultSourceDirectorySet(displayName, fileResolver);
    antlr.getFilter().include("**/*.g");
}
项目:Pushjet-Android    文件:DefaultPrebuiltLibrary.java   
public DefaultPrebuiltLibrary(String name, FileResolver fileResolver) {
    this.name = name;
    headers = new DefaultSourceDirectorySet("headers", fileResolver);
    binaries = new DefaultDomainObjectSet<NativeBinary>(NativeBinary.class);
}
项目:Pushjet-Android    文件:DefaultObjectiveCSourceSet.java   
@Inject
public DefaultObjectiveCSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) {
    super(name, parent, project, "Objective-C source", new DefaultSourceDirectorySet("source", project.getFileResolver()));
}
项目:Pushjet-Android    文件:DefaultWindowsResourceSet.java   
public DefaultWindowsResourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) {
   super(name, parent, project, "windows resources", new DefaultSourceDirectorySet("source", project.getFileResolver()));
}
项目:Pushjet-Android    文件:DefaultCppSourceSet.java   
public DefaultCppSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) {
    super(name, parent, project, "C++ source", new DefaultSourceDirectorySet("source", project.getFileResolver()));
}
项目:Pushjet-Android    文件:DefaultCSourceSet.java   
@Inject
public DefaultCSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) {
    super(name, parent, project, "C source", new DefaultSourceDirectorySet("source", project.getFileResolver()));
}
项目:Pushjet-Android    文件:AbstractHeaderExportingSourceSet.java   
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());
}
项目:Pushjet-Android    文件:DefaultAssemblerSourceSet.java   
public DefaultAssemblerSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) {
    super(name, parent, "assembler source", new DefaultSourceDirectorySet("source", project.getFileResolver()));
}
项目:Pushjet-Android    文件:DefaultObjectiveCppSourceSet.java   
@Inject
public DefaultObjectiveCppSourceSet(String name, FunctionalSourceSet parent, ProjectInternal project) {
    super(name, parent, project, "Objective-C++ source", new DefaultSourceDirectorySet("source", project.getFileResolver()));
}
项目:gradle-velocity-plugin    文件:VelocitySourceSet.java   
public VelocitySourceSet(String displayName, FileResolver fileResolver) {
    velocity = new DefaultSourceDirectorySet(String.format("Velocity %s source", displayName), fileResolver);
    velocity.getFilter().include("**/*.java");
}