Groovy Documentation

org.gradle.api.plugins.scala
[Groovy] Class ScalaBasePlugin

java.lang.Object
  org.gradle.api.plugins.scala.ScalaBasePlugin
All Implemented Interfaces:
Plugin

class ScalaBasePlugin

Property Summary
static String SCALA_TOOLS_CONFIGURATION_NAME

static String ZINC_CONFIGURATION_NAME

 
Constructor Summary
ScalaBasePlugin(FileResolver fileResolver)

 
Method Summary
void apply(Project project)

File findScalaJar(Iterable classpath, String module)

Searches the specified class path for a Scala Jar file matching the specified module (compiler, library, jdbc, etc.).

String getScalaVersion(File scalaJar)

Determines the version of a Scala Jar file (scala-compiler, scala-library, scala-jdbc, etc.).

FileCollection inferScalaCompilerClasspath(Iterable classpath)

Infers a Scala compiler class path (containing a 'scala-compiler' Jar and its dependencies) based on the 'scala-library' Jar found on the specified class path.

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Property Detail

SCALA_TOOLS_CONFIGURATION_NAME

static final String SCALA_TOOLS_CONFIGURATION_NAME


ZINC_CONFIGURATION_NAME

static final String ZINC_CONFIGURATION_NAME


 
Constructor Detail

ScalaBasePlugin

@Inject
ScalaBasePlugin(FileResolver fileResolver)


 
Method Detail

apply

void apply(Project project)


findScalaJar

@Nullable
@Incubating
File findScalaJar(Iterable classpath, String module)
Searches the specified class path for a Scala Jar file matching the specified module (compiler, library, jdbc, etc.).
Parameters:
classpath - the class path to search
module - the module to search for
Returns:
a matching Scala Jar file, or null if no match was found


getScalaVersion

@Nullable
@Incubating
String getScalaVersion(File scalaJar)
Determines the version of a Scala Jar file (scala-compiler, scala-library, scala-jdbc, etc.). If the version cannot be determined, null is returned.

Implementation note: The version is determined by parsing the file name, which is expected to match the pattern 'scala-[component]-[version].jar'.

Parameters:
scalaJar - a Scala Jar file
Returns:
the version of the Jar file


inferScalaCompilerClasspath

@Incubating
FileCollection inferScalaCompilerClasspath(Iterable classpath)
Infers a Scala compiler class path (containing a 'scala-compiler' Jar and its dependencies) based on the 'scala-library' Jar found on the specified class path.

Falls back to returning the 'scalaTools' configuration if one of the following holds:

  1. The 'scalaTools' configuration is explicitly configured (ie. has dependencies declared). This is important for backwards compatibility.
  2. No repository is declared for the project.
  3. A 'scala-library' Jar cannot be found on the specified class path, or its version cannot be determined.
Note that the returned class path may be empty, or may fail to resolve when asked for its contents. If this happens at task execution time, it should usually be treated as a configuration error on part of the user.
Parameters:
classpath - a class path (supposedly) containing a 'scala-library' Jar
Returns:
a Scala compiler class path


 

Gradle API 1.5