org.gradle.api.tasks.compile

## Class GroovyCompileOptions

- java.lang.Object
- - org.gradle.api.tasks.compile.AbstractOptions
  - - org.gradle.api.tasks.compile.GroovyCompileOptions

- All Implemented Interfaces:
    Serializable

      public class GroovyCompileOptions
      extends AbstractOptions

  Compilation options to be passed to the Groovy compiler.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GroovyCompileOptions()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `excludeFromAntProperties(String fieldName)`
    `GroovyCompileOptions` | `fork(Map forkArgs)` Convenience method to set `GroovyForkOptions` with named parameter syntax.
    `String` | `getEncoding()` Tells the source encoding.
    `List<String>` | `getFileExtensions()` Returns the list of acceptable source file extensions.
    `GroovyForkOptions` | `getForkOptions()` Returns options for running the Groovy compiler in a separate process.
    `Map<String,Boolean>` | `getOptimizationOptions()` Returns optimization options for the Groovy compiler.
    `File` | `getStubDir()` Returns the directory where Java stubs for Groovy classes will be stored during Java/Groovy joint compilation.
    `boolean` | `isFailOnError()` Tells whether the compilation task should fail if compile errors occurred.
    `boolean` | `isFork()` Tells whether to run the Groovy compiler in a separate process.
    `boolean` | `isIncludeJavaRuntime()` Deprecated. No replacement
    `boolean` | `isKeepStubs()` Tells whether Java stubs for Groovy classes generated during Java/Groovy joint compilation should be kept after compilation has completed.
    `boolean` | `isListFiles()` Tells whether to print which source files are to be compiled.
    `boolean` | `isStacktrace()` Deprecated. No replacement
    `boolean` | `isUseAnt()` Deprecated. No replacement
    `boolean` | `isVerbose()` Tells whether to turn on verbose output.
    `Map<String,Object>` | `optionMap()` Internal method.
    `void` | `setEncoding(String encoding)` Sets the source encoding.
    `void` | `setFailOnError(boolean failOnError)` Sets whether the compilation task should fail if compile errors occurred.
    `void` | `setFileExtensions(List<String> fileExtensions)` Sets the list of acceptable source file extensions.
    `void` | `setFork(boolean fork)` Sets whether to run the Groovy compiler in a separate process.
    `void` | `setForkOptions(GroovyForkOptions forkOptions)` Sets options for running the Groovy compiler in a separate process.
    `void` | `setIncludeJavaRuntime(boolean includeJavaRuntime)` Deprecated. No replacement
    `void` | `setKeepStubs(boolean keepStubs)` Sets whether Java stubs for Groovy classes generated during Java/Groovy joint compilation should be kept after compilation has completed.
    `void` | `setListFiles(boolean listFiles)` Sets whether to print which source files are to be compiled.
    `void` | `setOptimizationOptions(Map<String,Boolean> optimizationOptions)` Sets optimization options for the Groovy compiler.
    `void` | `setStacktrace(boolean stacktrace)` Deprecated. No replacement
    `void` | `setStubDir(File stubDir)` Sets the directory where Java stubs for Groovy classes will be stored during Java/Groovy joint compilation.
    `void` | `setUseAnt(boolean useAnt)` Deprecated. No replacement
    `void` | `setVerbose(boolean verbose)` Sets whether to turn on verbose output.

    - ### Methods inherited from class org.gradle.api.tasks.compile.AbstractOptions

      `define, getAntPropertyName, getAntPropertyValue`

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

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

- - ### Constructor Detail

    - #### GroovyCompileOptions

          public GroovyCompileOptions()

  - ### Method Detail

    - #### isFailOnError

          public boolean isFailOnError()

      Tells whether the compilation task should fail if compile errors occurred. Defaults to `true`.

    - #### setFailOnError

          public void setFailOnError(boolean failOnError)

      Sets whether the compilation task should fail if compile errors occurred. Defaults to `true`.

    - #### isVerbose

          public boolean isVerbose()

      Tells whether to turn on verbose output. Defaults to `false`.

    - #### setVerbose

          public void setVerbose(boolean verbose)

      Sets whether to turn on verbose output. Defaults to `false`.

    - #### isListFiles

          public boolean isListFiles()

      Tells whether to print which source files are to be compiled. Defaults to `false`.

    - #### setListFiles

          public void setListFiles(boolean listFiles)

      Sets whether to print which source files are to be compiled. Defaults to `false`.

    - #### getEncoding

          @Input
          public String getEncoding()

      Tells the source encoding. Defaults to `UTF-8`.

    - #### setEncoding

          public void setEncoding(String encoding)

      Sets the source encoding. Defaults to `UTF-8`.

    - #### isFork

          public boolean isFork()

      Tells whether to run the Groovy compiler in a separate process. Defaults to `true`.

    - #### setFork

          public void setFork(boolean fork)

      Sets whether to run the Groovy compiler in a separate process. Defaults to `true`.

    - #### getForkOptions

          public GroovyForkOptions getForkOptions()

      Returns options for running the Groovy compiler in a separate process. These options only take effect if `fork` is set to `true`.

    - #### setForkOptions

          public void setForkOptions(GroovyForkOptions forkOptions)

      Sets options for running the Groovy compiler in a separate process. These options only take effect if `fork` is set to `true`.

    - #### getOptimizationOptions

          public Map<String,Boolean> getOptimizationOptions()

      Returns optimization options for the Groovy compiler. Allowed values for an option are `true` and `false`. Only takes effect when compiling against Groovy 1.8 or higher.

      Known options are:

      indy
        Use the invokedynamic bytecode instruction. Requires JDK7 or higher and Groovy 2.0 or higher. Disabled by default.
      int
        Optimize operations on primitive types (e.g. integers). Enabled by default.
      all
        Enable or disable all optimizations. Note that some optimizations might be mutually exclusive.

    - #### setOptimizationOptions

          public void setOptimizationOptions(Map<String,Boolean> optimizationOptions)

      Sets optimization options for the Groovy compiler. Allowed values for an option are `true` and `false`. Only takes effect when compiling against Groovy 1.8 or higher.

    - #### isStacktrace

          @Deprecated
          public boolean isStacktrace()

      Deprecated. No replacement
      Tells whether to print a stack trace when the compiler hits a problem (like a compile error). Defaults to `false`. Only used when `isUseAnt()` is `true`.

    - #### setStacktrace

          @Deprecated
          public void setStacktrace(boolean stacktrace)

      Deprecated. No replacement
      Sets whether to print a stack trace when the compiler hits a problem (like a compile error). Defaults to `false`. Only used when `isUseAnt()` is `true`.

    - #### isUseAnt

          @Input
          @Deprecated
          public boolean isUseAnt()

      Deprecated. No replacement
      Tells whether the groovyc Ant task should be used over Gradle's own Groovy compiler integration. Defaults to `false`.

    - #### setUseAnt

          @Deprecated
          public void setUseAnt(boolean useAnt)

      Deprecated. No replacement
      Sets whether the groovyc Ant task should be used over Gradle's own Groovy compiler integration. Defaults to `false`.

    - #### isIncludeJavaRuntime

          @Input
          @Deprecated
          public boolean isIncludeJavaRuntime()

      Deprecated. No replacement
      Tells whether the Java runtime should be put on the compile class path. Only takes effect if `useAnt` is `true`. Defaults to `false`.

    - #### setIncludeJavaRuntime

          @Deprecated
          public void setIncludeJavaRuntime(boolean includeJavaRuntime)

      Deprecated. No replacement
      Sets whether the Java runtime should be put on the compile class path. Only takes effect if `useAnt` is `true`. Defaults to `false`.

    - #### getStubDir

          public File getStubDir()

      Returns the directory where Java stubs for Groovy classes will be stored during Java/Groovy joint compilation. Defaults to `null`, in which case a temporary directory will be used.

    - #### setStubDir

          public void setStubDir(File stubDir)

      Sets the directory where Java stubs for Groovy classes will be stored during Java/Groovy joint compilation. Defaults to `null`, in which case a temporary directory will be used.

    - #### getFileExtensions

          @Input
          @Incubating
          public List<String> getFileExtensions()

      Returns the list of acceptable source file extensions. Only takes effect when compiling against Groovy 1.7 or higher. Defaults to `ImmutableList.of("java", "groovy")`.

    - #### setFileExtensions

          @Incubating
          public void setFileExtensions(List<String> fileExtensions)

      Sets the list of acceptable source file extensions. Only takes effect when compiling against Groovy 1.7 or higher. Defaults to `ImmutableList.of("java", "groovy")`.

    - #### isKeepStubs

          public boolean isKeepStubs()

      Tells whether Java stubs for Groovy classes generated during Java/Groovy joint compilation should be kept after compilation has completed. Useful for joint compilation debugging purposes. Defaults to `false`.

    - #### setKeepStubs

          public void setKeepStubs(boolean keepStubs)

      Sets whether Java stubs for Groovy classes generated during Java/Groovy joint compilation should be kept after compilation has completed. Useful for joint compilation debugging purposes. Defaults to `false`.

    - #### fork

          public GroovyCompileOptions fork(Map forkArgs)

      Convenience method to set `GroovyForkOptions` with named parameter syntax. Calling this method will set `fork` to `true`.

    - #### excludeFromAntProperties

          protected boolean excludeFromAntProperties(String fieldName)

      Overrides:
        `excludeFromAntProperties` in class `AbstractOptions`

    - #### optionMap

          public Map<String,Object> optionMap()

      Internal method.
      Overrides:
        `optionMap` in class `AbstractOptions`