use of org.gradle.api.tasks.ScalaRuntime in project gradle by gradle.
the class ScalaBasePlugin method apply.
public void apply(Project project) {
project.getPluginManager().apply(JavaBasePlugin.class);
configureConfigurations(project);
ScalaRuntime scalaRuntime = configureScalaRuntimeExtension(project);
configureCompileDefaults(project, scalaRuntime);
configureSourceSetDefaults(project, sourceDirectorySetFactory);
configureScaladoc(project, scalaRuntime);
}
use of org.gradle.api.tasks.ScalaRuntime in project gradle by gradle.
the class IdeaScalaConfigurer method createScalaSdkLibrary.
private static ProjectLibrary createScalaSdkLibrary(Project scalaProject, Iterable<File> files, boolean useScalaSdk, IdeaModule ideaModule) {
ScalaRuntime runtime = scalaProject.getExtensions().findByType(ScalaRuntime.class);
if (runtime != null) {
// Old Scala Plugin does not specify a ScalaPlatform
FileCollection scalaClasspath = runtime.inferScalaClasspath(files);
File compilerJar = runtime.findScalaJar(scalaClasspath, "compiler");
ScalaPlatform scalaPlatform = compilerJar != null ? new DefaultScalaPlatform(runtime.getScalaVersion(compilerJar)) : new DefaultScalaPlatform();
return createScalaSdkFromPlatform(scalaPlatform, scalaClasspath, useScalaSdk);
} else if (ideaModule.getScalaPlatform() != null) {
// TODO: Wrong, using the full classpath of the application
return createScalaSdkFromPlatform(ideaModule.getScalaPlatform(), scalaProject.files(files), useScalaSdk);
} else {
// we can't create a Scala SDK without either one
return null;
}
}
Aggregations