Search in sources :

Example 1 with AbstractScalaCompile

use of org.gradle.language.scala.tasks.AbstractScalaCompile in project gradle by gradle.

the class ScalaPlugin method apply.

@Override
public void apply(Project project) {
    project.getPluginManager().apply(ScalaBasePlugin.class);
    project.getPluginManager().apply(JavaPlugin.class);
    final SourceSet main = project.getExtensions().getByType(JavaPluginExtension.class).getSourceSets().getByName("main");
    configureScaladoc(project, main);
    final Configuration incrementalAnalysisElements = project.getConfigurations().getByName("incrementalScalaAnalysisElements");
    String compileTaskName = main.getCompileTaskName("scala");
    final TaskProvider<AbstractScalaCompile> compileScala = project.getTasks().withType(AbstractScalaCompile.class).named(compileTaskName);
    final Provider<RegularFile> compileScalaMapping = project.getLayout().getBuildDirectory().file("tmp/scala/compilerAnalysis/" + compileTaskName + ".mapping");
    compileScala.configure(task -> task.getAnalysisMappingFile().set(compileScalaMapping));
    incrementalAnalysisElements.getOutgoing().artifact(compileScalaMapping, configurablePublishArtifact -> configurablePublishArtifact.builtBy(compileScala));
}
Also used : SourceSet(org.gradle.api.tasks.SourceSet) AbstractScalaCompile(org.gradle.language.scala.tasks.AbstractScalaCompile) Configuration(org.gradle.api.artifacts.Configuration) RegularFile(org.gradle.api.file.RegularFile)

Aggregations

Configuration (org.gradle.api.artifacts.Configuration)1 RegularFile (org.gradle.api.file.RegularFile)1 SourceSet (org.gradle.api.tasks.SourceSet)1 AbstractScalaCompile (org.gradle.language.scala.tasks.AbstractScalaCompile)1