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 -nowarn switch should be passed to the compiler; defaults to off.
  • debug Optional. Indicates whether source should be compiled with debug information; defaults to off. If set to off, -g:none will be passed on the command line for compilers that support it (for other compilers, no command line argument will be used). If set to true, the value of the debugLevel attribute determines the command line argument.
  • debugLevel Optional. Keyword list to be appended to the -g command-line switch. This will be ignored by all implementations except modern, classic(ver >= 1.2) and jikes. Legal values are none or a comma-separated list of the following keywords: lines, vars, and source. If debugLevel is not specified, by default, nothing will be appended to -g. If debug is 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's javac starting 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.1 or 1.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 (jikes and classic).
  • fork Optional. Whether to execute javac using the JDK compiler externally; defaults to no.
  • executable Optional. Complete path to the javac executable to use in case of fork="yes". Defaults to the compiler of the Java version that is currently running Ant. Ignored if fork="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 javac is run externally; ignored otherwise. Defaults to the standard VM memory setting. (Examples: 83886080, 81920k, or 80m)
  • memoryMaximumSize Optional. The maximum size of the memory for the underlying VM, if javac is run externally; ignored otherwise. Defaults to the standard VM memory setting. (Examples: 83886080, 81920k, or 80m)
  • failOnError Optional. Indicates whether compilation errors will fail the build; defaults to true.
  • source Optional. Value of the -source command-line switch; will be ignored by all implementations prior to javac1.4 (or modern when Ant is not running in a 1.3 VM) and jikes.
    If you use this attribute together with jikes, you must make sure that your version of jikes supports the -source switch. By default, no -source argument 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.compiler property, 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.
Compilers

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.1 and javac1.2 can be used as aliases.
  • modern (the standard compiler of JDK 1.3/1.4/1.5/1.6) javac1.3 and javac1.4 and javac1.5 and javac1.6 can be used as aliases.
  • jikes (the Jikes compiler).
  • jvc (the Command-Line Compiler from Microsoft's SDK for Java / Visual J++) microsoft can be used as an alias.
  • kjc (the kopi compiler).
  • gcj (the gcj compiler from gcc).
  • sj (Symantec java compiler) symantec can 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