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


Java SourceSet.getName方法代码示例

本文整理汇总了Java中org.gradle.api.tasks.SourceSet.getName方法的典型用法代码示例。如果您正苦于以下问题:Java SourceSet.getName方法的具体用法?Java SourceSet.getName怎么用?Java SourceSet.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.gradle.api.tasks.SourceSet的用法示例。


在下文中一共展示了SourceSet.getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toComparable

import org.gradle.api.tasks.SourceSet; //导入方法依赖的package包/类
private static Comparable toComparable(SourceSet sourceSet) {
    String name = sourceSet.getName();
    if (SourceSet.MAIN_SOURCE_SET_NAME.equals(name)) {
        return 0;
    } else if (SourceSet.TEST_SOURCE_SET_NAME.equals(name)) {
        return 1;
    } else {
        return 2;
    }
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:SourceFoldersCreator.java

示例2: DefaultSourceSetContainer

import org.gradle.api.tasks.SourceSet; //导入方法依赖的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

示例3: apply

import org.gradle.api.tasks.SourceSet; //导入方法依赖的package包/类
private void apply(@Nonnull final Project project, @Nonnull SourceSet sourceSet, @Nonnull final VelocityPluginExtension extension) {
    final VelocitySourceSet velocitySourceSet = new VelocitySourceSet(sourceSet.getName(), fileResolver);
    new DslObject(sourceSet).getConvention().getPlugins().put("velocity", velocitySourceSet);
    final String srcDir = String.format("src/%s/velocity", sourceSet.getName());
    velocitySourceSet.getVelocity().srcDir(srcDir);
    sourceSet.getAllSource().source(velocitySourceSet.getVelocity());

    final String velocityTaskName = sourceSet.getTaskName("process", "Velocity");
    VelocityTask velocityTask = project.getTasks().create(velocityTaskName, VelocityTask.class, new Action<VelocityTask>() {
        @Override
        public void execute(VelocityTask task) {
            task.setDescription("Preprocesses velocity template files.");

            task.conventionMapping("includeDirs", new Callable<List<File>>() {
                @Override
                public List<File> call() {
                    List<Object> includeDirs = extension.includeDirs;
                    if (includeDirs == null)
                        return null;
                    List<File> out = new ArrayList<File>();
                    for (Object includeDir : includeDirs)
                        out.add(project.file(includeDir));
                    return out;
                }
            });

            task.conventionMapping("contextValues", new Callable<Map<String, Object>>() {
                @Override
                public Map<String, Object> call() {
                    return extension.contextValues;
                }
            });
        }
    });

    velocityTask.setSource(velocitySourceSet.getVelocity());

    final String outputDirectoryName = String.format("%s/generated-sources/antlr/%s",
            project.getBuildDir(), sourceSet.getName());
    File outputDir = new File(outputDirectoryName);
    velocityTask.setOutputDir(outputDir);
    sourceSet.getJava().srcDir(outputDir);

    project.getTasks().getByName(sourceSet.getCompileJavaTaskName()).dependsOn(velocityTask);
}
 
开发者ID:shevek,项目名称:gradle-velocity-plugin,代码行数:46,代码来源:VelocityPlugin.java

示例4: DefaultSourceSetContainer

import org.gradle.api.tasks.SourceSet; //导入方法依赖的package包/类
public DefaultSourceSetContainer(FileResolver fileResolver, TaskResolver taskResolver, Instantiator classGenerator) {
    super(SourceSet.class, classGenerator, new Namer<SourceSet>() { public String determineName(SourceSet ss) { return ss.getName(); }});
    this.fileResolver = fileResolver;
    this.taskResolver = taskResolver;
    this.instantiator = classGenerator;
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:7,代码来源:DefaultSourceSetContainer.java


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