public final class JkJavaCompileSpec
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ENCODING_OPTS |
static java.lang.String |
PROCESSOR_OPTS |
static java.lang.String |
SOURCE_OPTS |
static java.lang.String |
TARGET_OPTS |
Modifier and Type | Method and Description |
---|---|
JkJavaCompileSpec |
addOptions(java.lang.Iterable<java.lang.String> options)
|
JkJavaCompileSpec |
addOptions(java.lang.String... options)
Adds specified options to pass to the compileRunner.
|
JkJavaCompileSpec |
addSources(java.lang.Iterable<java.nio.file.Path> paths)
Adds specified source files to the set of java sources to compile.
|
JkJavaCompileSpec |
addSources(JkPathTree tree) |
JkJavaCompileSpec |
addSources(JkPathTreeSet treeSet) |
JkJavaCompileSpec |
addSources(java.nio.file.Path path1,
java.nio.file.Path path2,
java.nio.file.Path... files) |
JkJavaCompileSpec |
copy() |
JkJavaCompileSpec |
disableAnnotationProcessing()
Disable annotation processing.
|
java.lang.String |
getEncoding() |
java.lang.String |
getNextValue(java.lang.String optionName) |
java.util.List<java.lang.String> |
getOptions()
Returns the specifications as a list of string directly usable in the
JkJavaCompiler except
sourcepath |
java.nio.file.Path |
getOutputDir() |
java.util.List<java.nio.file.Path> |
getSourceFiles()
Returns all source files to be compiled.
|
JkJavaVersion |
getSourceVersion() |
JkJavaVersion |
getTargetVersion() |
static JkJavaCompileSpec |
of() |
JkJavaCompileSpec |
setAnnotationProcessingOnly()
Only process annotation.
|
JkJavaCompileSpec |
setAnnotationProcessors(java.lang.String... annotationProcessorClassNames)
Sets specified annotation classes instead of using the ones discovered by default Java 6 mechanism.
|
JkJavaCompileSpec |
setClasspath(java.lang.Iterable<java.nio.file.Path> files)
Creates a copy of this
JkJavaCompiler but with the specified
classpath. |
JkJavaCompileSpec |
setEncoding(java.lang.String encoding)
Creates a copy of this
JkJavaCompileSpec but using the
specified source encoding (e.g. |
JkJavaCompileSpec |
setOption(java.lang.String optionName,
java.lang.String optionValue)
Some options of a compileRunner are set in a couple of name/value (version, classpath, .....).
|
JkJavaCompileSpec |
setOutputDir(java.nio.file.Path outputDir) |
JkJavaCompileSpec |
setSourceAndTargetVersion(JkJavaVersion version)
Shorthand for #setSourceVersion chained to #setTargetVersion
|
JkJavaCompileSpec |
setSourceVersion(JkJavaVersion version)
Sets the version of source code accepted.
|
JkJavaCompileSpec |
setTargetVersion(JkJavaVersion version)
Sets the target Java version for compiled classes.
|
public static final java.lang.String SOURCE_OPTS
public static final java.lang.String TARGET_OPTS
public static final java.lang.String PROCESSOR_OPTS
public static final java.lang.String ENCODING_OPTS
public static JkJavaCompileSpec of()
public JkJavaCompileSpec copy()
public java.util.List<java.lang.String> getOptions()
JkJavaCompiler
except
sourcepathpublic java.nio.file.Path getOutputDir()
public JkJavaCompileSpec setOutputDir(java.nio.file.Path outputDir)
public JkJavaVersion getSourceVersion()
public JkJavaVersion getTargetVersion()
public JkJavaCompileSpec setSourceVersion(JkJavaVersion version)
public JkJavaCompileSpec setTargetVersion(JkJavaVersion version)
JkJavaCompiler
can choose to use the appropriate compileRunner to compile to the
specified target.public JkJavaCompileSpec setSourceAndTargetVersion(JkJavaVersion version)
public java.lang.String getEncoding()
public JkJavaCompileSpec setEncoding(java.lang.String encoding)
JkJavaCompileSpec
but using the
specified source encoding (e.g. UTF-8). If null
is specified,
then default plateform encoding will be used.public JkJavaCompileSpec addSources(java.lang.Iterable<java.nio.file.Path> paths)
public JkJavaCompileSpec addSources(JkPathTree tree)
public JkJavaCompileSpec addSources(JkPathTreeSet treeSet)
public JkJavaCompileSpec addSources(java.nio.file.Path path1, java.nio.file.Path path2, java.nio.file.Path... files)
addSources(Iterable)
public java.util.List<java.nio.file.Path> getSourceFiles()
public JkJavaCompileSpec setClasspath(java.lang.Iterable<java.nio.file.Path> files)
JkJavaCompiler
but with the specified
classpath.public JkJavaCompileSpec addOptions(java.lang.String... options)
javac -deprecation -cp path1 path2
, you should pass "-deprecation",
"-cp", "path1", "path2" parameters.public JkJavaCompileSpec addOptions(java.lang.Iterable<java.lang.String> options)
public JkJavaCompileSpec setOption(java.lang.String optionName, java.lang.String optionValue)
public JkJavaCompileSpec setAnnotationProcessors(java.lang.String... annotationProcessorClassNames)
public JkJavaCompileSpec disableAnnotationProcessing()
public JkJavaCompileSpec setAnnotationProcessingOnly()
public java.lang.String getNextValue(java.lang.String optionName)