GroovyRuntime (Gradle API 2.14.1)
Date: 2016-07-18

org.gradle.api.tasks

## Class GroovyRuntime

- java.lang.Object
- - org.gradle.api.tasks.GroovyRuntime

-     @Incubating
      public class GroovyRuntime
      extends Object

  Provides information related to the Groovy runtime(s) used in a project. Added by the `GroovyBasePlugin` as a project extension named `groovyRuntime`.

  Example usage:

           apply plugin: "groovy"

           repositories {
               mavenCentral()
           }

           dependencies {
               compile "org.codehaus.groovy:groovy-all:2.1.2"
           }

           def groovyClasspath = groovyRuntime.inferGroovyClasspath(configurations.compile)
           // The returned class path can be used to configure the 'groovyClasspath' property of tasks
           // such as 'GroovyCompile' or 'Groovydoc', or to execute these and other Groovy tools directly.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GroovyRuntime(Project project)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `FileCollection` | `inferGroovyClasspath(Iterable<File> classpath)` Searches the specified class path for Groovy Jars (`groovy(-indy)`, `groovy-all(-indy)`) and returns a corresponding class path for executing Groovy tools such as the Groovy compiler and Groovydoc tool.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GroovyRuntime

          public GroovyRuntime(Project project)

  - ### Method Detail

    - #### inferGroovyClasspath

          public FileCollection inferGroovyClasspath(Iterable<File> classpath)

      Searches the specified class path for Groovy Jars (`groovy(-indy)`, `groovy-all(-indy)`) and returns a corresponding class path for executing Groovy tools such as the Groovy compiler and Groovydoc tool. The tool versions will match those of the Groovy Jars found. If no Groovy Jars are found on the specified class path, a class path with the contents of the `groovy` configuration will be returned.

      The returned class path may be empty, or may fail to resolve when asked for its contents.

      Parameters:
        `classpath` - a class path containing Groovy Jars
      Returns:
        a corresponding class path for executing Groovy tools such as the Groovy compiler and Groovydoc tool