Javac Plugin (quokka.plugin.javac:0.3, namespace=javac)
The Javac plugin compiles java source code
Minor Targets
| compile | Compiles main Java source code. Implements quokka.plugin.lifecycle:compile |
| test-compile | Compiles test Java source code. Implements quokka.plugin.lifecycle:test-compile |
Compilation paths:
The Javac Plugin will automatically add project dependencies to the compilation class path. See the lifecycle plugin help for information on how these paths are resolved.
Properties: (Common to all targets)
- srcDir Mandatory. Location of the java files.
- bootClassPath Optional. Location of bootstrap class files.
- bootClassPathRef Optional. Location of bootstrap class files, given as a reference to a path defined elsewhere.
- extDirs Optional. Location of installed extensions.
- encoding Optional.Encoding of source files. (Note: gcj doesn't support this option yet.)
-
noWarn
Optional. Indicates whether the
-nowarnswitch should be passed to the compiler; defaults tooff. -
debug
Optional. Indicates whether source should be compiled with
debug information; defaults to
off. If set tooff,-g:nonewill be passed on the command line for compilers that support it (for other compilers, no command line argument will be used). If set totrue, the value of thedebugLevelattribute determines the command line argument. -
debugLevel
Optional. Keyword list to be appended to the
-gcommand-line switch. This will be ignored by all implementations exceptmodern,classic(ver >= 1.2)andjikes. Legal values arenoneor a comma-separated list of the following keywords:lines,vars, andsource. IfdebugLevelis not specified, by default, nothing will be appended to-g. Ifdebugis not turned on, this attribute will be ignored. -
optimize
Optional. Indicates whether source should be compiled with
optimization; defaults to
off. Note that this flag is just ignored by Sun'sjavacstarting with JDK 1.3 (since compile-time optimization is unnecessary). -
deprecation
Optional. Indicates whether source should be compiled with
deprecation information; defaults to
off. -
target
Optional. Generate class files for specific VM version
(e.g.,
1.1or1.2). Note: the default value depends on the JVM that is running Ant. In particular, if you use JDK 1.4+ the generated classes will not be usable for a 1.1 Java VM unless you explicitly set this attribute to the value 1.1 (which is the default value for JDK 1.1 to 1.3). We highly recommend to always specify this attribute. -
verbose
Optional. Asks the compiler for verbose output; defaults to
no. -
depend
Optional. Enables dependency-tracking
for compilers that support this (
jikesandclassic). -
fork
Optional. Whether to execute
javacusing the JDK compiler externally; defaults tono. -
executable
Optional. Complete path to the
javacexecutable to use in case offork="yes". Defaults to the compiler of the Java version that is currently running Ant. Ignored iffork="no".
Since Ant 1.6 this attribute can also be used to specify the path to the executable when using jikes, jvc, gcj or sj. -
memoryInitialSize
Optional. The initial size of the memory for the underlying VM,
if
javacis run externally; ignored otherwise. Defaults to the standard VM memory setting. (Examples:83886080,81920k, or80m) -
memoryMaximumSize
Optional. The maximum size of the memory for the underlying VM,
if
javacis run externally; ignored otherwise. Defaults to the standard VM memory setting. (Examples:83886080,81920k, or80m) -
failOnError
Optional. Indicates whether compilation errors
will fail the build; defaults to
true. -
source
Optional. Value of the
-sourcecommand-line switch; will be ignored by all implementations prior tojavac1.4(ormodernwhen Ant is not running in a 1.3 VM) andjikes.
If you use this attribute together withjikes, you must make sure that your version of jikes supports the-sourceswitch. By default, no-sourceargument will be used at all. Note: the default value depends on the JVM that is running Ant. We highly recommend to always specify this attribute. -
compiler
Optional. The compiler implementation to use.
If this attribute is not set, the value of the
build.compilerproperty, if set, will be used. Otherwise, the default compiler for the current VM will be used. (See the above list of valid compilers.) -
listFiles
Optional. Indicates whether the source files to be compiled will
be listed; defaults to
no. - tempDir Optional. Where Ant should place temporary files. This is only used if the task is forked and the command line args length exceeds 4k. Since Ant 1.6.
- destDir Optional. Location to store the class files.
- compilerArgs Optional. Command line arguements for the compiler.
It is possible to use different compilers. This can be specified by
either setting the global build.compiler property, which will
affect all <javac> tasks throughout the build, or by
setting the compiler attribute, specific to the current
<javac> task.
Valid values for either the
build.compiler property or the compiler
attribute are:
-
classic(the standard compiler of JDK 1.1/1.2)javac1.1andjavac1.2can be used as aliases. -
modern(the standard compiler of JDK 1.3/1.4/1.5/1.6)javac1.3andjavac1.4andjavac1.5andjavac1.6can be used as aliases. -
jikes(the Jikes compiler). -
jvc(the Command-Line Compiler from Microsoft's SDK for Java / Visual J++)microsoftcan be used as an alias. -
kjc(the kopi compiler). -
gcj(the gcj compiler from gcc). -
sj(Symantec java compiler)symanteccan be used as an alias. -
extJavac(run either modern or classic in a JVM of its own).
compile
Compiles main Java source code
- prefix: q.javac.main
- Implements: quokka.plugin.lifecycle:compile
Default Properties
| debug | true |
| destDir | ${q.lifecycle.compileOutput} |
| memoryMaximumSize | ${@setifdef q.project.forkMaxMemory} |
| source | ${@setifdef q.project.java.source} |
| srcDir | ${q.project.sourceDir}/main/java |
| target | ${@setifdef q.project.java.target} |
test-compile
Compiles test Java source code
- prefix: q.javac.test
- Implements: quokka.plugin.lifecycle:test-compile
Default Properties
| debug | true |
| destDir | ${q.lifecycle.testCompileOutput} |
| memoryMaximumSize | ${@setifdef q.project.forkMaxMemory} |
| source | ${@setifdef q.project.java.source} |
| srcDir | ${q.project.sourceDir}/test/java |
| target | ${@setifdef q.project.java.target} |
Plugin Paths
runtime : Runtime class path
quokka.core.plugin-spi plugin-spi 0.3
quokka.plugin.lifecycle lifecycle 0.3
quokka.core.plugin-spi plugin-spi 0.3
apache.ant ant 1.7.1
quokka.core.bootstrap-util bootstrap-util 0.3
apache.ant ant 1.7.1
apache.ant launcher 1.7.1