当前位置: 首页>>代码示例>>Java>>正文


Java SourceDirectorySetFactory类代码示例

本文整理汇总了Java中org.gradle.api.internal.file.SourceDirectorySetFactory的典型用法代码示例。如果您正苦于以下问题:Java SourceDirectorySetFactory类的具体用法?Java SourceDirectorySetFactory怎么用?Java SourceDirectorySetFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SourceDirectorySetFactory类属于org.gradle.api.internal.file包,在下文中一共展示了SourceDirectorySetFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
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);
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:BaseLanguageSourceSet.java

示例2: DefaultScalaSourceSet

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultScalaSourceSet.java

示例3: configureSourceSetDefaults

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
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);
        }

    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:31,代码来源:ScalaBasePlugin.java

示例4: repositories

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
@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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:NativeComponentModelPlugin.java

示例5: DefaultRepositories

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
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);
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:NativeComponentModelPlugin.java

示例6: addGeneratedScala

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
@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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultPlayApplicationBinarySpec.java

示例7: addGeneratedJavaScript

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
@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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultPlayApplicationBinarySpec.java

示例8: createGeneratedJavaScriptSourceSets

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
@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);
            }
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:PlayCoffeeScriptPlugin.java

示例9: createGeneratedScalaSourceSets

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
@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);
            }
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:PlayRoutesPlugin.java

示例10: createGeneratedScalaSourceSets

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
@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);
            }
        }
    });
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:PlayTwirlPlugin.java

示例11: DefaultSourceSetContainer

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
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;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:12,代码来源:DefaultSourceSetContainer.java

示例12: DefaultGroovySourceSet

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
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");
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultGroovySourceSet.java

示例13: DefaultSourceSet

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
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);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:28,代码来源:DefaultSourceSet.java

示例14: JavaPluginConvention

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
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";
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:JavaPluginConvention.java

示例15: DefaultLatteSourceSet

import org.gradle.api.internal.file.SourceDirectorySetFactory; //导入依赖的package包/类
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");
}
 
开发者ID:wkgcass,项目名称:Latte-lang,代码行数:8,代码来源:DefaultLatteSourceSet.java


注:本文中的org.gradle.api.internal.file.SourceDirectorySetFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。