本文整理汇总了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;
}
}
示例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;
}
示例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);
}
示例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;
}