For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

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.

Since

1.6

Constructors

Link copied to clipboard
constructor(project: Project)
Creates a new ScalaRuntime.

Functions

Link copied to clipboard
@Nullable
open fun findScalaJar(classpath: Iterable<File>, appendix: String): @Nullable 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): @Nullable 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.