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

项目:Reer    文件:BaseLanguageSourceSet.java   
public static <T extends LanguageSourceSet> T create(Class<? extends LanguageSourceSet> publicType, Class<T> implementationType, ComponentSpecIdentifier componentId, SourceDirectorySetFactory sourceDirectorySetFactory) {
    NEXT_SOURCE_SET_INFO.set(new SourceSetInfo(componentId, publicType, sourceDirectorySetFactory));
    try {
        try {
            return DirectInstantiator.INSTANCE.newInstance(implementationType);
        } catch (ObjectInstantiationException e) {
            throw new ModelInstantiationException(String.format("Could not create LanguageSourceSet of type %s", publicType.getSimpleName()), e.getCause());
        }
    } finally {
        NEXT_SOURCE_SET_INFO.set(null);
    }
}
项目:Reer    文件:DefaultScalaSourceSet.java   
public DefaultScalaSourceSet(String displayName, SourceDirectorySetFactory sourceDirectorySetFactory) {
    scala = sourceDirectorySetFactory.create(displayName + " Scala source");
    scala.getFilter().include("**/*.java", "**/*.scala");
    allScala = sourceDirectorySetFactory.create(displayName + " Scala source");
    allScala.getFilter().include("**/*.scala");
    allScala.source(scala);
}
项目:Reer    文件:ScalaBasePlugin.java   
private static void configureSourceSetDefaults(final Project project, final SourceDirectorySetFactory sourceDirectorySetFactory) {
    final JavaBasePlugin javaPlugin = project.getPlugins().getPlugin(JavaBasePlugin.class);
    project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().all(new Action<SourceSet>() {
        @Override
        public void execute(final SourceSet sourceSet) {
            String displayName = (String) InvokerHelper.invokeMethod(sourceSet, "getDisplayName", null);
            Convention sourceSetConvention = (Convention) InvokerHelper.getProperty(sourceSet, "convention");
            DefaultScalaSourceSet scalaSourceSet = new DefaultScalaSourceSet(displayName, sourceDirectorySetFactory);
            sourceSetConvention.getPlugins().put("scala", scalaSourceSet);
            final SourceDirectorySet scalaDirectorySet = scalaSourceSet.getScala();
            scalaDirectorySet.srcDir(new Callable<File>() {
                @Override
                public File call() throws Exception {
                    return project.file("src/" + sourceSet.getName() + "/scala");
                }
            });
            sourceSet.getAllJava().source(scalaDirectorySet);
            sourceSet.getAllSource().source(scalaDirectorySet);
            sourceSet.getResources().getFilter().exclude(new Spec<FileTreeElement>() {
                @Override
                public boolean isSatisfiedBy(FileTreeElement element) {
                    return scalaDirectorySet.contains(element.getFile());
                }
            });

            configureScalaCompile(project, javaPlugin, sourceSet);
        }

    });
}
项目:Reer    文件:NativeComponentModelPlugin.java   
@Model
Repositories repositories(ServiceRegistry serviceRegistry, FlavorContainer flavors, PlatformContainer platforms, BuildTypeContainer buildTypes) {
    Instantiator instantiator = serviceRegistry.get(Instantiator.class);
    SourceDirectorySetFactory sourceDirectorySetFactory = serviceRegistry.get(SourceDirectorySetFactory.class);
    NativePlatforms nativePlatforms = serviceRegistry.get(NativePlatforms.class);
    FileCollectionFactory fileCollectionFactory = serviceRegistry.get(FileCollectionFactory.class);
    Action<PrebuiltLibrary> initializer = new PrebuiltLibraryInitializer(instantiator, fileCollectionFactory, nativePlatforms, platforms.withType(NativePlatform.class), buildTypes, flavors);
    return new DefaultRepositories(instantiator, sourceDirectorySetFactory, initializer);
}
项目:Reer    文件:NativeComponentModelPlugin.java   
private DefaultRepositories(final Instantiator instantiator, final SourceDirectorySetFactory sourceDirectorySetFactory, final Action<PrebuiltLibrary> binaryFactory) {
    super(ArtifactRepository.class, instantiator, new ArtifactRepositoryNamer());
    registerFactory(PrebuiltLibraries.class, new NamedDomainObjectFactory<PrebuiltLibraries>() {
        public PrebuiltLibraries create(String name) {
            return instantiator.newInstance(DefaultPrebuiltLibraries.class, name, instantiator, sourceDirectorySetFactory, binaryFactory);
        }
    });
}
项目:Reer    文件:DefaultPlayApplicationBinarySpec.java   
@Override
public void addGeneratedScala(LanguageSourceSet input, SourceDirectorySetFactory sourceDirectorySetFactory) {
    String lssName = input.getName() + "ScalaSources";
    // TODO: To get rid of this, we need a `FunctionalSourceSet` instance here, and that's surprisingly difficult to get.
    ScalaLanguageSourceSet generatedScalaSources = BaseLanguageSourceSet.create(ScalaLanguageSourceSet.class, DefaultScalaLanguageSourceSet.class, getIdentifier().child(lssName), sourceDirectorySetFactory);
    generatedScalaSources.builtBy();
    generatedScala.put(input, generatedScalaSources);
}
项目:Reer    文件:DefaultPlayApplicationBinarySpec.java   
@Override
public void addGeneratedJavaScript(LanguageSourceSet input, SourceDirectorySetFactory sourceDirectorySetFactory) {
    String lssName = input.getName() + "JavaScript";
    JavaScriptSourceSet javaScript = BaseLanguageSourceSet.create(JavaScriptSourceSet.class, DefaultJavaScriptSourceSet.class, getIdentifier().child(lssName), sourceDirectorySetFactory);
    javaScript.builtBy();
    generatedJavaScript.put(input, javaScript);
}
项目:Reer    文件:PlayCoffeeScriptPlugin.java   
@Mutate
void createGeneratedJavaScriptSourceSets(@Path("binaries") ModelMap<PlayApplicationBinarySpecInternal> binaries, final SourceDirectorySetFactory sourceDirectorySetFactory) {
    binaries.all(new Action<PlayApplicationBinarySpecInternal>() {
        @Override
        public void execute(PlayApplicationBinarySpecInternal playApplicationBinarySpec) {
            for (CoffeeScriptSourceSet coffeeScriptSourceSet : playApplicationBinarySpec.getInputs().withType(CoffeeScriptSourceSet.class)) {
                playApplicationBinarySpec.addGeneratedJavaScript(coffeeScriptSourceSet, sourceDirectorySetFactory);
            }
        }
    });
}
项目:Reer    文件:PlayRoutesPlugin.java   
@Mutate
void createGeneratedScalaSourceSets(@Path("binaries") ModelMap<PlayApplicationBinarySpecInternal> binaries, final SourceDirectorySetFactory sourceDirectorySetFactory) {
    binaries.all(new Action<PlayApplicationBinarySpecInternal>() {
        @Override
        public void execute(PlayApplicationBinarySpecInternal playApplicationBinarySpec) {
            for (LanguageSourceSet languageSourceSet : playApplicationBinarySpec.getInputs().withType(RoutesSourceSet.class)) {
                playApplicationBinarySpec.addGeneratedScala(languageSourceSet, sourceDirectorySetFactory);
            }
        }
    });
}
项目:Reer    文件:PlayTwirlPlugin.java   
@Mutate
void createGeneratedScalaSourceSets(@Path("binaries") ModelMap<PlayApplicationBinarySpecInternal> binaries, final SourceDirectorySetFactory sourceDirectorySetFactory) {
    binaries.all(new Action<PlayApplicationBinarySpecInternal>() {
        @Override
        public void execute(PlayApplicationBinarySpecInternal playApplicationBinarySpec) {
            for (LanguageSourceSet languageSourceSet : playApplicationBinarySpec.getInputs().withType(TwirlSourceSet.class)) {
                playApplicationBinarySpec.addGeneratedScala(languageSourceSet, sourceDirectorySetFactory);
            }
        }
    });
}
项目:Reer    文件:DefaultSourceSetContainer.java   
public DefaultSourceSetContainer(FileResolver fileResolver, TaskResolver taskResolver, Instantiator classGenerator, SourceDirectorySetFactory sourceDirectorySetFactory) {
    super(SourceSet.class, classGenerator, new Namer<SourceSet>() {
        public String determineName(SourceSet ss) {
            return ss.getName();
        }
    });
    this.fileResolver = fileResolver;
    this.taskResolver = taskResolver;
    this.instantiator = classGenerator;
    this.sourceDirectorySetFactory = sourceDirectorySetFactory;
}
项目:Reer    文件:DefaultGroovySourceSet.java   
public DefaultGroovySourceSet(String displayName, SourceDirectorySetFactory sourceDirectorySetFactory) {
    groovy = sourceDirectorySetFactory.create(displayName +  " Groovy source");
    groovy.getFilter().include("**/*.java", "**/*.groovy");
    allGroovy = sourceDirectorySetFactory.create(displayName + " Groovy source");
    allGroovy.source(groovy);
    allGroovy.getFilter().include("**/*.groovy");
}
项目:Reer    文件:DefaultSourceSet.java   
public DefaultSourceSet(String name, SourceDirectorySetFactory sourceDirectorySetFactory) {
    this.name = name;
    displayName = GUtil.toWords(this.name);
    namingScheme = new ClassDirectoryBinaryNamingScheme(name);

    String javaSrcDisplayName = displayName + " Java source";

    javaSource = sourceDirectorySetFactory.create(javaSrcDisplayName);
    javaSource.getFilter().include("**/*.java");

    allJavaSource = sourceDirectorySetFactory.create(javaSrcDisplayName);
    allJavaSource.getFilter().include("**/*.java");
    allJavaSource.source(javaSource);

    String resourcesDisplayName = displayName + " resources";
    resources = sourceDirectorySetFactory.create(resourcesDisplayName);
    resources.getFilter().exclude(new Spec<FileTreeElement>() {
        public boolean isSatisfiedBy(FileTreeElement element) {
            return javaSource.contains(element.getFile());
        }
    });

    String allSourceDisplayName = displayName + " source";
    allSource = sourceDirectorySetFactory.create(allSourceDisplayName);
    allSource.source(resources);
    allSource.source(javaSource);
}
项目:Reer    文件:JavaPluginConvention.java   
public JavaPluginConvention(ProjectInternal project, Instantiator instantiator) {
    this.project = project;
    sourceSets = instantiator.newInstance(DefaultSourceSetContainer.class, project.getFileResolver(), project.getTasks(), instantiator,
        project.getServices().get(SourceDirectorySetFactory.class));
    dependencyCacheDirName = "dependency-cache";
    docsDirName = "docs";
    testResultsDirName = "test-results";
    testReportDirName = "tests";
}
项目:Latte-lang    文件:DefaultLatteSourceSet.java   
public DefaultLatteSourceSet(String displayName, SourceDirectorySetFactory sourceDirectorySetFactory) {
        latte = sourceDirectorySetFactory.create(displayName + " Latte source");
        latte.getFilter().include("**/*.lt", "**/*.latte");
        allLatte = sourceDirectorySetFactory.create(displayName + " Latte source");
        allLatte.source(latte);
        allLatte.getFilter().include("**/*.lt", "**/*.latte");
}
项目:Reer    文件:ComponentBasePlugin.java   
@Hidden
@Model
ComponentSpecFactory componentSpecFactory(ProjectIdentifier projectIdentifier, Instantiator instantiator, ITaskFactory taskFactory, SourceDirectorySetFactory sourceDirectorySetFactory) {
    return new ComponentSpecFactory(projectIdentifier, instantiator, taskFactory, sourceDirectorySetFactory);
}
项目:Reer    文件:BaseLanguageSourceSet.java   
private SourceSetInfo(ComponentSpecIdentifier identifier, Class<? extends LanguageSourceSet> publicType, SourceDirectorySetFactory sourceDirectorySetFactory) {
    this.identifier = identifier;
    this.publicType = publicType;
    this.sourceDirectorySetFactory = sourceDirectorySetFactory;
}
项目:Reer    文件:AntlrPlugin.java   
@Inject
public AntlrPlugin(SourceDirectorySetFactory sourceDirectorySetFactory) {
    this.sourceDirectorySetFactory = sourceDirectorySetFactory;
}
项目:Reer    文件:AntlrSourceVirtualDirectoryImpl.java   
public AntlrSourceVirtualDirectoryImpl(String parentDisplayName, SourceDirectorySetFactory sourceDirectorySetFactory) {
    final String displayName = parentDisplayName + " Antlr source";
    antlr = sourceDirectorySetFactory.create(displayName);
    antlr.getFilter().include("**/*.g");
    antlr.getFilter().include("**/*.g4");
}
项目:Reer    文件:ScalaBasePlugin.java   
@Inject
public ScalaBasePlugin(SourceDirectorySetFactory sourceDirectorySetFactory) {
    this.sourceDirectorySetFactory = sourceDirectorySetFactory;
}
项目:Reer    文件:DefaultPrebuiltLibrary.java   
public DefaultPrebuiltLibrary(String name, SourceDirectorySetFactory sourceDirectorySetFactory) {
    this.name = name;
    headers = sourceDirectorySetFactory.create("headers", "headers for prebuilt library '" + name + "'");
    binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class);
}
项目:Reer    文件:DefaultPrebuiltLibraries.java   
public DefaultPrebuiltLibraries(String name, Instantiator instantiator, SourceDirectorySetFactory sourceDirectorySetFactory, Action<PrebuiltLibrary> libraryInitializer) {
    super(PrebuiltLibrary.class, instantiator);
    this.name = name;
    this.sourceDirectorySetFactory = sourceDirectorySetFactory;
    this.libraryInitializer = libraryInitializer;
}
项目:Reer    文件:DefaultProject.java   
@Hidden @Model
SourceDirectorySetFactory sourceDirectorySetFactory(ServiceRegistry serviceRegistry) {
    return serviceRegistry.get(SourceDirectorySetFactory.class);
}
项目:Reer    文件:ProjectScopeServices.java   
protected SourceDirectorySetFactory createSourceDirectorySetFactory(FileResolver fileResolver, DirectoryFileTreeFactory directoryFileTreeFactory) {
    return new DefaultSourceDirectorySetFactory(fileResolver, directoryFileTreeFactory);
}
项目:Reer    文件:GroovyBasePlugin.java   
@Inject
public GroovyBasePlugin(SourceDirectorySetFactory sourceDirectorySetFactory, ModuleRegistry moduleRegistry) {
    this.sourceDirectorySetFactory = sourceDirectorySetFactory;
    this.moduleRegistry = moduleRegistry;
}
项目:gradle-clojure    文件:ClojureBasePlugin.java   
@Inject
public ClojureBasePlugin(SourceDirectorySetFactory sourceDirectorySetFactory) {
  this.sourceDirectorySetFactory = sourceDirectorySetFactory;
}
项目:gradle-clojure    文件:DefaultClojureSourceSet.java   
public DefaultClojureSourceSet(String name, SourceDirectorySetFactory sourceDirectorySetFactory) {
  this.clojure = sourceDirectorySetFactory.create(name);
  this.clojure.getFilter().include("**/*.clj", "**/*.cljc");
}
项目:Reer    文件:PlayApplicationBinarySpecInternal.java   
void addGeneratedScala(LanguageSourceSet input, SourceDirectorySetFactory sourceDirectorySetFactory);
项目:Reer    文件:PlayApplicationBinarySpecInternal.java   
void addGeneratedJavaScript(LanguageSourceSet input, SourceDirectorySetFactory sourceDirectorySetFactory);