org.gradle.api.tasks.compile
Class CompileOptions

java.lang.Object
  extended by org.gradle.api.tasks.compile.AbstractOptions
      extended by org.gradle.api.tasks.compile.CompileOptions
All Implemented Interfaces:
Serializable

public class CompileOptions
extends AbstractOptions

Main options for Java compilation.

See Also:
Serialized Form

Constructor Summary
CompileOptions()
           
 
Method Summary
 CompileOptions debug(Map<String,Object> debugArgs)
          Convenience method to set DebugOptions with named parameter syntax.
 CompileOptions depend(Map<String,Object> dependArgs)
          Convenience method to set DependOptions with named parameter syntax.
protected  boolean excludeFromAntProperties(String fieldName)
           
 CompileOptions fork(Map<String,Object> forkArgs)
          Convenience method to set ForkOptions with named parameter syntax.
protected  String getAntPropertyName(String fieldName)
           
protected  Object getAntPropertyValue(String fieldName, Object value)
           
 String getBootClasspath()
          Returns the bootstrap classpath to be used for the compiler process.
 String getCompiler()
          Deprecated. use CompileOptions.forkOptions.executable instead
 List<String> 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 <depend> 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()
          Deprecated. No replacement
 boolean getOptimize()
          Deprecated. No replacement
 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()
          Deprecated. No replacement
 boolean isListFiles()
          Tells whether to log the files to be compiled.
 boolean isOptimize()
          Deprecated. No replacement
 boolean isUseAnt()
          Deprecated. No replacement
 boolean isUseDepend()
          Tells whether to use the Ant <depend> task.
 boolean isVerbose()
          Tells whether to produce verbose output.
 boolean isWarnings()
          Tells whether to log warning messages.
 Map<String,Object> optionMap()
          Internal method.
 void setBootClasspath(String bootClasspath)
          Sets the bootstrap classpath to be used for the compiler process.
 void setCompiler(String compiler)
          Deprecated. use CompileOptions.forkOptions.executable instead
 void setCompilerArgs(List<String> 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 <depend> 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)
          Deprecated. No replacement
 void setListFiles(boolean listFiles)
          Sets whether to log the files to be compiled.
 void setOptimize(boolean optimize)
          Deprecated. No replacement
 void setUseAnt(boolean useAnt)
          Deprecated. No replacement
 void setUseDepend(boolean useDepend)
          Sets whether to use the Ant <depend> 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 org.gradle.api.tasks.compile.AbstractOptions
define
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompileOptions

public CompileOptions()
Method Detail

isFailOnError

public boolean isFailOnError()
Tells whether to fail the build when compilation fails. Defaults to true.


getFailOnError

@Input
public boolean getFailOnError()
Tells whether to fail the build when compilation fails. Defaults to true.


setFailOnError

public void setFailOnError(boolean failOnError)
Sets whether to fail the build when compilation fails. Defaults to true.


isVerbose

public boolean isVerbose()
Tells whether to produce verbose output. Defaults to false.


setVerbose

public void setVerbose(boolean verbose)
Sets whether to produce verbose output. Defaults to false.


isListFiles

public boolean isListFiles()
Tells whether to log the files to be compiled. Defaults to false.


setListFiles

public void setListFiles(boolean listFiles)
Sets whether to log the files to be compiled. Defaults to false.


isDeprecation

public boolean isDeprecation()
Tells whether to log details of usage of deprecated members or classes. Defaults to false.


setDeprecation

public void setDeprecation(boolean deprecation)
Sets whether to log details of usage of deprecated members or classes. Defaults to false.


isWarnings

public boolean isWarnings()
Tells whether to log warning messages. The default is true.


setWarnings

public void setWarnings(boolean warnings)
Sets whether to log warning messages. The default is true.


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.


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.


isOptimize

@Deprecated
public boolean isOptimize()
Deprecated. No replacement

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.


getOptimize

@Input
@Deprecated
public boolean getOptimize()
Deprecated. No replacement

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.


setOptimize

@Deprecated
public void setOptimize(boolean optimize)
Deprecated. No replacement

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.


isDebug

public boolean isDebug()
Tells whether to include debugging information in the generated class files. Defaults to true. See DebugOptions.getDebugLevel() for which debugging information will be generated.


getDebug

@Input
public boolean getDebug()
Tells whether to include debugging information in the generated class files. Defaults to true. See DebugOptions.getDebugLevel() for which debugging information will be generated.


setDebug

public void setDebug(boolean debug)
Sets whether to include debugging information in the generated class files. Defaults to true. See DebugOptions.getDebugLevel() for which debugging information will be generated.


getDebugOptions

public DebugOptions getDebugOptions()
Returns options for generating debugging information.


setDebugOptions

public void setDebugOptions(DebugOptions debugOptions)
Sets options for generating debugging information.


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.


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.


getForkOptions

public ForkOptions getForkOptions()
Returns options for running the compiler in a child process.


setForkOptions

public void setForkOptions(ForkOptions forkOptions)
Sets options for running the compiler in a child process.


isUseDepend

public boolean isUseDepend()
Tells whether to use the Ant <depend> task. Only takes effect if useAnt is true. Defaults to false.


setUseDepend

public void setUseDepend(boolean useDepend)
Sets whether to use the Ant <depend> task. Only takes effect if useAnt is true. Defaults to false.


getDependOptions

public DependOptions getDependOptions()
Returns options for using the Ant <depend> task.


setDependOptions

public void setDependOptions(DependOptions dependOptions)
Sets options for using the Ant <depend> task.


getCompiler

@Deprecated
@Input
@Optional
public String getCompiler()
Deprecated. use CompileOptions.forkOptions.executable instead

Returns the compiler to be used. Only takes effect if useAnt is true.


setCompiler

@Deprecated
public void setCompiler(String compiler)
Deprecated. use CompileOptions.forkOptions.executable instead

Sets the compiler to be used. Only takes effect if useAnt is true.


isIncludeJavaRuntime

@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.


getIncludeJavaRuntime

@Input
@Deprecated
public boolean getIncludeJavaRuntime()
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.


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.


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.


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.


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.


getCompilerArgs

@Input
public List<String> getCompilerArgs()
Returns any additional arguments to be passed to the compiler. Defaults to the empty list.


setCompilerArgs

public void setCompilerArgs(List<String> compilerArgs)
Sets any additional arguments to be passed to the compiler. Defaults to the empty list.


isUseAnt

@Deprecated
public boolean isUseAnt()
Deprecated. No replacement

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


setUseAnt

@Deprecated
public void setUseAnt(boolean useAnt)
Deprecated. No replacement

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


fork

public CompileOptions fork(Map<String,Object> forkArgs)
Convenience method to set ForkOptions with named parameter syntax. Calling this method will set fork to true.


debug

public CompileOptions debug(Map<String,Object> debugArgs)
Convenience method to set DebugOptions with named parameter syntax. Calling this method will set debug to true.


depend

public CompileOptions depend(Map<String,Object> dependArgs)
Convenience method to set DependOptions with named parameter syntax. Calling this method will set useDepend to true.


optionMap

public Map<String,Object> optionMap()
Internal method.

Overrides:
optionMap in class AbstractOptions

excludeFromAntProperties

protected boolean excludeFromAntProperties(String fieldName)
Overrides:
excludeFromAntProperties in class AbstractOptions

getAntPropertyName

protected String getAntPropertyName(String fieldName)
Overrides:
getAntPropertyName in class AbstractOptions

getAntPropertyValue

protected Object getAntPropertyValue(String fieldName,
                                     Object value)
Overrides:
getAntPropertyValue in class AbstractOptions