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 |
RELEASE_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 |
copy() |
JkJavaCompileSpec |
disableAnnotationProcessing()
Disable annotation processing.
|
JkPathSequence |
getClasspath() |
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
JkJavaCompilerToolChain except
source path |
java.nio.file.Path |
getOutputDir() |
java.lang.String |
getReleaseVersion() |
java.util.List<java.nio.file.Path> |
getSourceDirs() |
JkPathTreeSet |
getSources() |
java.lang.String |
getSourceVersion() |
java.lang.String |
getTargetVersion() |
JkJavaVersion |
minJavaVersion()
Returns the minimum version of Java suitable for compiling, according
source, target and release options.
|
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)
Set the compiler classpath with the specified files
|
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 |
setReleaseVersion(java.lang.String version)
Sets option
-release |
JkJavaCompileSpec |
setSources(java.util.function.Function<JkPathTreeSet,JkPathTreeSet> modifier)
Adds specified source files to the set of java sources to compile.
|
JkJavaCompileSpec |
setSources(JkPathTreeSet sources) |
JkJavaCompileSpec |
setSourceVersion(java.lang.String version)
Sets option
-source |
JkJavaCompileSpec |
setTargetVersion(java.lang.String version)
Sets option
-target |
public static final java.lang.String SOURCE_OPTS
public static final java.lang.String TARGET_OPTS
public static final java.lang.String RELEASE_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()
JkJavaCompilerToolChain
except
source pathpublic java.nio.file.Path getOutputDir()
public JkJavaCompileSpec setOutputDir(java.nio.file.Path outputDir)
public java.lang.String getSourceVersion()
public java.lang.String getReleaseVersion()
public java.lang.String getTargetVersion()
public JkJavaVersion minJavaVersion()
Returns null
if none of these options is present.
public JkJavaCompileSpec setSourceVersion(java.lang.String version)
-source
public JkJavaCompileSpec setTargetVersion(java.lang.String version)
-target
public JkJavaCompileSpec setReleaseVersion(java.lang.String version)
-release
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 setSources(java.util.function.Function<JkPathTreeSet,JkPathTreeSet> modifier)
public JkJavaCompileSpec setSources(JkPathTreeSet sources)
public JkPathTreeSet getSources()
public java.util.List<java.nio.file.Path> getSourceDirs()
public JkJavaCompileSpec setClasspath(java.lang.Iterable<java.nio.file.Path> files)
public JkPathSequence getClasspath()
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)