Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.api.tasks.compile
[Java] Class CompileOptions

    java.lang.Object
      org.gradle.api.tasks.compile.AbstractOptions
          org.gradle.api.tasks.compile.CompileOptions

    public class CompileOptions
    extends AbstractOptions

Main options for Java compilation.

Authors:
  Hans Dockter

Method Summary
`CompileOptions` | `debug(Map debugArgs)` Convenience method to set DebugOptions with named parameter syntax.
`CompileOptions` | `depend(Map dependArgs)` Convenience method to set DependOptions with named parameter syntax.
`protected List` | `excludedFieldsFromOptionMap()` Internal method.
`protected Map` | `fieldName2AntMap()` Internal method.
`protected Map` | `fieldValue2AntMap()` Internal method.
`CompileOptions` | `fork(Map forkArgs)` Convenience method to set ForkOptions with named parameter syntax.
`String` | `getBootClasspath()` Returns the bootstrap classpath to be used for the compiler process.
`String` | `getCompiler()` Returns the compiler to be used.
`List` | `getCompilerArgs()` Returns any additional arguments to be passed to the compiler.
`boolean` | `getDebug()` Tells whether to include debugging information in the generated class files.
`DebugOptions` | `getDebugOptions()` Returns options for generating debugging information.
`DependOptions` | `getDependOptions()` Returns options for using the Ant `` task.
`String` | `getEncoding()` Returns the character encoding to be used when reading source files.
`String` | `getExtensionDirs()` Returns the extension dirs to be used for the compiler process.
`boolean` | `getFailOnError()` Tells whether to fail the build when compilation fails.
`ForkOptions` | `getForkOptions()` Returns options for running the compiler in a child process.
`boolean` | `getIncludeJavaRuntime()` Tells whether the Java runtime should be put on the compile class path.
`boolean` | `getOptimize()` Tells whether to produce optimized byte code.
`boolean` | `isDebug()` Tells whether to include debugging information in the generated class files.
`boolean` | `isDeprecation()` Tells whether to log details of usage of deprecated members or classes.
`boolean` | `isFailOnError()` Tells whether to fail the build when compilation fails.
`boolean` | `isFork()` Tells whether to run the compiler in its own process.
`boolean` | `isIncludeJavaRuntime()` Tells whether the Java runtime should be put on the compile class path.
`boolean` | `isListFiles()` Tells whether to log the files to be compiled.
`boolean` | `isOptimize()` Tells whether to produce optimized byte code.
`boolean` | `isUseAnt()` Tells whether to use the Ant javac task over Gradle's own Java compiler integration.
`boolean` | `isUseDepend()` Tells whether to use the Ant `` task.
`boolean` | `isVerbose()` Tells whether to produce verbose output.
`boolean` | `isWarnings()` Tells whether to log warning messages.
`Map` | `optionMap()` Internal method.
`void` | `setBootClasspath(String bootClasspath)` Sets the bootstrap classpath to be used for the compiler process.
`void` | `setCompiler(String compiler)` Sets the compiler to be used.
`void` | `setCompilerArgs(List compilerArgs)` Sets any additional arguments to be passed to the compiler.
`void` | `setDebug(boolean debug)` Sets whether to include debugging information in the generated class files.
`void` | `setDebugOptions(DebugOptions debugOptions)` Sets options for generating debugging information.
`void` | `setDependOptions(DependOptions dependOptions)` Sets options for using the Ant `` task.
`void` | `setDeprecation(boolean deprecation)` Sets whether to log details of usage of deprecated members or classes.
`void` | `setEncoding(String encoding)` Sets the character encoding to be used when reading source files.
`void` | `setExtensionDirs(String extensionDirs)` Sets the extension dirs to be used for the compiler process.
`void` | `setFailOnError(boolean failOnError)` Sets whether to fail the build when compilation fails.
`void` | `setFork(boolean fork)` Sets whether to run the compiler in its own process.
`void` | `setForkOptions(ForkOptions forkOptions)` Sets options for running the compiler in a child process.
`void` | `setIncludeJavaRuntime(boolean includeJavaRuntime)` Sets whether the Java runtime should be put on the compile class path.
`void` | `setListFiles(boolean listFiles)` Sets whether to log the files to be compiled.
`void` | `setOptimize(boolean optimize)` Sets whether to produce optimized byte code.
`void` | `setUseAnt(boolean useAnt)` Sets whether to use the Ant javac task over Gradle's own Java compiler integration.
`void` | `setUseDepend(boolean useDepend)` Sets whether to use the Ant `` task.
`void` | `setVerbose(boolean verbose)` Sets whether to produce verbose output.
`void` | `setWarnings(boolean warnings)` Sets whether to log warning messages.

Methods inherited from class AbstractOptions
define, excludedFieldsFromOptionMap, fieldName2AntMap, fieldValue2AntMap, optionMap

Method Detail

### debug

    public CompileOptions debug(Map debugArgs)

  Convenience method to set DebugOptions with named parameter syntax. Calling this method will set `debug` to `true`.

### depend

    public CompileOptions depend(Map dependArgs)

  Convenience method to set DependOptions with named parameter syntax. Calling this method will set `useDepend` to `true`.

### excludedFieldsFromOptionMap

    protected List excludedFieldsFromOptionMap()

  Internal method.

### fieldName2AntMap

    protected Map fieldName2AntMap()

  Internal method.

### fieldValue2AntMap

    protected Map fieldValue2AntMap()

  Internal method.

### fork

    public CompileOptions fork(Map forkArgs)

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

### getBootClasspath

    @Input
    @Optional
    public String getBootClasspath()

  Returns the bootstrap classpath to be used for the compiler process. Only takes effect if `fork` is `true`. Defaults to `null`.

### getCompiler

    @Deprecated
    @Input
    @Optional
    public String getCompiler()

  Returns the compiler to be used. Only takes effect if `useAnt` is `true`.
  deprecated:
    use `CompileOptions.forkOptions.executable` instead

### getCompilerArgs

    @Input
    public List getCompilerArgs()

  Returns any additional arguments to be passed to the compiler. Defaults to the empty list.

### getDebug

    @Input
    public boolean getDebug()

  Tells whether to include debugging information in the generated class files. Defaults to `true`. See DebugOptions#debugLevel#debugLevel for which debugging information will be generated.

### getDebugOptions

    @Nested
    public DebugOptions getDebugOptions()

  Returns options for generating debugging information.

### getDependOptions

    public DependOptions getDependOptions()

  Returns options for using the Ant `` task.

### getEncoding

    @Input
    @Optional
    public String getEncoding()

  Returns the character encoding to be used when reading source files. Defaults to `null`, in which case the platform default encoding will be used.

### getExtensionDirs

    @Input
    @Optional
    public String getExtensionDirs()

  Returns the extension dirs to be used for the compiler process. Only takes effect if `fork` is `true`. Defaults to `null`.

### getFailOnError

    @Input
    public boolean getFailOnError()

  Tells whether to fail the build when compilation fails. Defaults to `true`.

### getForkOptions

    @Nested
    public ForkOptions getForkOptions()

  Returns options for running the compiler in a child process.

### getIncludeJavaRuntime

    @Input
    public boolean getIncludeJavaRuntime()

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

### getOptimize

    @Input
    public boolean getOptimize()

  Tells whether to produce optimized byte code. Only takes effect if `useAnt` is `true`. Note that this flag is ignored by Sun's javac starting with JDK 1.3.

### isDebug

    public boolean isDebug()

  Tells whether to include debugging information in the generated class files. Defaults to `true`. See DebugOptions#debugLevel#debugLevel for which debugging information will be generated.

### isDeprecation

    public boolean isDeprecation()

  Tells whether to log details of usage of deprecated members or classes. Defaults to `false`.

### isFailOnError

    public boolean isFailOnError()

  Tells whether to fail the build when compilation fails. Defaults to `true`.

### isFork

    public boolean isFork()

  Tells whether to run the compiler in its own process. Note that this does not necessarily mean that a new process will be created for each compile task. Defaults to `false`.

### isIncludeJavaRuntime

    public boolean isIncludeJavaRuntime()

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

### isListFiles

    public boolean isListFiles()

  Tells whether to log the files to be compiled. Defaults to `false`.

### isOptimize

    public boolean isOptimize()

  Tells whether to produce optimized byte code. Only takes effect if `useAnt` is `true`. Note that this flag is ignored by Sun's javac starting with JDK 1.3.

### isUseAnt

    public boolean isUseAnt()

  Tells whether to use the Ant javac task over Gradle's own Java compiler integration. Defaults to `false`.

### isUseDepend

    public boolean isUseDepend()

  Tells whether to use the Ant `` task. Only takes effect if `useAnt` is `true`. Defaults to `false`.

### isVerbose

    public boolean isVerbose()

  Tells whether to produce verbose output. Defaults to `false`.

### isWarnings

    public boolean isWarnings()

  Tells whether to log warning messages. The default is `true`.

### optionMap

    public Map optionMap()

  Internal method.

### setBootClasspath

    public void setBootClasspath(String bootClasspath)

  Sets the bootstrap classpath to be used for the compiler process. Only takes effect if `fork` is `true`. Defaults to `null`.

### setCompiler

    @Deprecated
    public void setCompiler(String compiler)

  Sets the compiler to be used. Only takes effect if `useAnt` is `true`.
  deprecated:
    use `CompileOptions.forkOptions.executable instead`

### setCompilerArgs

    public void setCompilerArgs(List compilerArgs)

  Sets any additional arguments to be passed to the compiler. Defaults to the empty list.

### setDebug

    public void setDebug(boolean debug)

  Sets whether to include debugging information in the generated class files. Defaults to `true`. See DebugOptions#debugLevel#debugLevel for which debugging information will be generated.

### setDebugOptions

    public void setDebugOptions(DebugOptions debugOptions)

  Sets options for generating debugging information.

### setDependOptions

    public void setDependOptions(DependOptions dependOptions)

  Sets options for using the Ant `` task.

### setDeprecation

    public void setDeprecation(boolean deprecation)

  Sets whether to log details of usage of deprecated members or classes. Defaults to `false`.

### setEncoding

    public void setEncoding(String encoding)

  Sets the character encoding to be used when reading source files. Defaults to `null`, in which case the platform default encoding will be used.

### setExtensionDirs

    public void setExtensionDirs(String extensionDirs)

  Sets the extension dirs to be used for the compiler process. Only takes effect if `fork` is `true`. Defaults to `null`.

### setFailOnError

    public void setFailOnError(boolean failOnError)

  Sets whether to fail the build when compilation fails. Defaults to `true`.

### setFork

    public void setFork(boolean fork)

  Sets whether to run the compiler in its own process. Note that this does not necessarily mean that a new process will be created for each compile task. Defaults to `false`.

### setForkOptions

    public void setForkOptions(ForkOptions forkOptions)

  Sets options for running the compiler in a child process.

### setIncludeJavaRuntime

    public void setIncludeJavaRuntime(boolean includeJavaRuntime)

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

### setListFiles

    public void setListFiles(boolean listFiles)

  Sets whether to log the files to be compiled. Defaults to `false`.

### setOptimize

    public void setOptimize(boolean optimize)

  Sets whether to produce optimized byte code. Only takes effect if `useAnt` is `true`. Note that this flag is ignored by Sun's javac starting with JDK 1.3.

### setUseAnt

    public void setUseAnt(boolean useAnt)

  Sets whether to use the Ant javac task over Gradle's own Java compiler integration. Defaults to `false`.

### setUseDepend

    public void setUseDepend(boolean useDepend)

  Sets whether to use the Ant `` task. Only takes effect if `useAnt` is `true`. Defaults to `false`.

### setVerbose

    public void setVerbose(boolean verbose)

  Sets whether to produce verbose output. Defaults to `false`.

### setWarnings

    public void setWarnings(boolean warnings)

  Sets whether to log warning messages. The default is `true`.

Gradle API 1.1-rc-1