本文整理汇总了Java中org.gradle.api.tasks.ScalaSourceSet类的典型用法代码示例。如果您正苦于以下问题:Java ScalaSourceSet类的具体用法?Java ScalaSourceSet怎么用?Java ScalaSourceSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScalaSourceSet类属于org.gradle.api.tasks包,在下文中一共展示了ScalaSourceSet类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureScalaCompile
import org.gradle.api.tasks.ScalaSourceSet; //导入依赖的package包/类
private static void configureScalaCompile(final Project project, JavaBasePlugin javaPlugin, final SourceSet sourceSet) {
String taskName = sourceSet.getCompileTaskName("scala");
final ScalaCompile scalaCompile = project.getTasks().create(taskName, ScalaCompile.class);
scalaCompile.dependsOn(sourceSet.getCompileJavaTaskName());
javaPlugin.configureForSourceSet(sourceSet, scalaCompile);
Convention scalaConvention = (Convention) InvokerHelper.getProperty(sourceSet, "convention");
ScalaSourceSet scalaSourceSet = scalaConvention.findPlugin(ScalaSourceSet.class);
scalaCompile.setDescription("Compiles the " + scalaSourceSet.getScala() + ".");
scalaCompile.setSource(scalaSourceSet.getScala());
project.getTasks().getByName(sourceSet.getClassesTaskName()).dependsOn(taskName);
// cannot use convention mapping because the resulting object won't be serializable
// cannot compute at task execution time because we need association with source set
project.getGradle().addBuildListener(new BuildAdapter() {
@Override
public void projectsEvaluated(Gradle gradle) {
IncrementalCompileOptions incrementalOptions = scalaCompile.getScalaCompileOptions().getIncrementalOptions();
if (incrementalOptions.getAnalysisFile() == null) {
String analysisFilePath = project.getBuildDir().getPath() + "/tmp/scala/compilerAnalysis/" + scalaCompile.getName() + ".analysis";
incrementalOptions.setAnalysisFile(new File(analysisFilePath));
}
if (incrementalOptions.getPublishedCode() == null) {
Jar jarTask = (Jar) project.getTasks().findByName(sourceSet.getJarTaskName());
incrementalOptions.setPublishedCode(jarTask == null ? null : jarTask.getArchivePath());
}
}
});
}
示例2: scala
import org.gradle.api.tasks.ScalaSourceSet; //导入依赖的package包/类
public ScalaSourceSet scala(Closure configureClosure) {
return scala(ClosureBackedAction.of(configureClosure));
}
示例3: scala
import org.gradle.api.tasks.ScalaSourceSet; //导入依赖的package包/类
public ScalaSourceSet scala(Closure configureClosure) {
ConfigureUtil.configure(configureClosure, getScala());
return this;
}