public class GroovyCompileOptions extends AbstractOptions
コンストラクタと説明 |
---|
GroovyCompileOptions() |
修飾子とタイプ | メソッドと説明 |
---|---|
protected boolean |
excludeFromAntProperties(String fieldName) |
GroovyCompileOptions |
fork(Map<String,Object> forkArgs)
Convenience method to set
GroovyForkOptions with named parameter syntax. |
File |
getConfigurationScript()
A Groovy script file that configures the compiler, allowing extensive control over how the code is compiled.
|
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 |
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 |
isVerbose()
Tells whether to turn on verbose output.
|
Map<String,Object> |
optionMap()
Internal method.
|
void |
setConfigurationScript(File configurationFile)
Sets the path to the groovy configuration file.
|
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 |
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 |
setStubDir(File stubDir)
Sets the directory where Java stubs for Groovy classes will be stored during Java/Groovy joint
compilation.
|
void |
setVerbose(boolean verbose)
Sets whether to turn on verbose output.
|
define, getAntPropertyName, getAntPropertyValue
public boolean isFailOnError()
true
.public void setFailOnError(boolean failOnError)
true
.public boolean isVerbose()
false
.public void setVerbose(boolean verbose)
false
.public boolean isListFiles()
false
.public void setListFiles(boolean listFiles)
false
.public void setEncoding(String encoding)
UTF-8
.public boolean isFork()
true
.public void setFork(boolean fork)
true
.@InputFile @Incubating @Optional public File getConfigurationScript()
The script is executed as Groovy code, with the following context:
configuration
variable.This facilitates the following pattern:
withConfig(configuration) { // use compiler configuration DSL here }
For example, to activate type checking for all Groovy classes…
import groovy.transform.TypeChecked withConfig(configuration) { ast(TypeChecked) }
Please see the Groovy compiler customization builder documentation for more information about the compiler configuration DSL.
This feature is only available if compiling with Groovy 2.1 or later.
@Incubating public void setConfigurationScript(@Nullable File configurationFile)
getConfigurationScript()
public GroovyForkOptions getForkOptions()
fork
is set to true
.public void setForkOptions(GroovyForkOptions forkOptions)
fork
is set to true
.public Map<String,Boolean> getOptimizationOptions()
true
and false
.
Only takes effect when compiling against Groovy 1.8 or higher.
Known options are:
public void setOptimizationOptions(Map<String,Boolean> optimizationOptions)
true
and false
.
Only takes effect when compiling against Groovy 1.8 or higher.public File getStubDir()
null
, in which case a temporary directory will be used.public void setStubDir(File stubDir)
null
, in which case a temporary directory will be used.@Input @Incubating public List<String> getFileExtensions()
ImmutableList.of("java", "groovy")
.@Incubating public void setFileExtensions(List<String> fileExtensions)
ImmutableList.of("java", "groovy")
.public boolean isKeepStubs()
false
.public void setKeepStubs(boolean keepStubs)
false
.public GroovyCompileOptions fork(Map<String,Object> forkArgs)
GroovyForkOptions
with named parameter syntax.
Calling this method will set fork
to true
.protected boolean excludeFromAntProperties(String fieldName)
excludeFromAntProperties
クラス内 AbstractOptions
public Map<String,Object> optionMap()
optionMap
クラス内 AbstractOptions