ScalaRuntime

abstract class ScalaRuntime(source)

Provides information related to the Scala runtime(s) used in a project. Added by the org.gradle.api.plugins.scala.ScalaBasePlugin as a project extension named scalaRuntime.

Example usage:

    plugins {
        id 'scala'
    }

    repositories {
        mavenCentral()
    }

    dependencies {
        implementation "org.scala-lang:scala-library:2.10.1"
    }

    def scalaClasspath = scalaRuntime.inferScalaClasspath(configurations.compileClasspath)
    // The returned class path can be used to configure the 'scalaClasspath' property of tasks
    // such as 'ScalaCompile' or 'ScalaDoc', or to execute these and other Scala tools directly.

Constructors

Link copied to clipboard
constructor(project: Project)

Functions

Link copied to clipboard
@Nullable
open fun findScalaJar(classpath: Iterable<File>, appendix: String): File
Searches the specified class path for a Scala Jar file (scala-compiler, scala-library, scala-jdbc, etc.) with the specified appendix (compiler, library, jdbc, etc.).
Link copied to clipboard
@Nullable
open fun getScalaVersion(scalaJar: File): String
Determines the version of a Scala Jar file (scala-compiler, scala-library, scala-jdbc, etc.).
Link copied to clipboard
Searches the specified class path for a 'scala-library' Jar, and returns a class path containing a corresponding (same version) 'scala-compiler' Jar and its dependencies.