org.springframework.build.ant
Class Javac

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.MatchingTask
              extended by org.apache.tools.ant.taskdefs.Javac
                  extended by org.springframework.build.ant.Javac
All Implemented Interfaces:
java.lang.Cloneable, org.apache.tools.ant.types.selectors.SelectorContainer

public class Javac
extends org.apache.tools.ant.taskdefs.Javac

Compiles Java source files. This task can take the following arguments:

Of these arguments, the sourcedir and destdir are required.

When this task executes, it will recursively scan the sourcedir and destdir looking for Java source files to compile. This task makes its compile decision based on timestamp.

Since:
Ant 1.1

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.Javac
org.apache.tools.ant.taskdefs.Javac.ImplementationSpecificArgument
 
Field Summary
private  org.apache.tools.ant.types.Path bootclasspath
           
private static java.lang.String CLASSIC
           
private  org.apache.tools.ant.types.Path compileClasspath
           
protected  java.io.File[] compileList
           
private  org.apache.tools.ant.types.Path compileSourcepath
           
private  boolean debug
           
private  java.lang.String debugLevel
           
private  boolean depend
           
private  boolean deprecation
           
private  java.io.File destDir
           
private  java.lang.String encoding
           
private  org.apache.tools.ant.types.Path extdirs
           
private static java.lang.String EXTJAVAC
           
private  org.apache.tools.ant.util.facade.FacadeTaskHelper facade
           
private static java.lang.String FAIL_MSG
           
protected  boolean failOnError
           
private  boolean fork
           
private  java.lang.String forkedExecutable
           
private  boolean includeAntRuntime
           
private  boolean includeJavaRuntime
           
private static java.lang.String JAVAC11
           
private static java.lang.String JAVAC12
           
private static java.lang.String JAVAC13
           
private static java.lang.String JAVAC14
           
private static java.lang.String JAVAC15
           
private static java.lang.String JAVAC16
           
protected  boolean listFiles
           
private  java.lang.String memoryInitialSize
           
private  java.lang.String memoryMaximumSize
           
private static java.lang.String MODERN
           
private  boolean nowarn
           
private  boolean optimize
           
private  java.lang.String source
           
private  org.apache.tools.ant.types.Path src
           
private  java.lang.String targetAttribute
           
private  java.io.File tmpDir
           
private  boolean verbose
           
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
Javac()
          Javac task for compilation of Java files.
 
Method Summary
private  java.lang.String assumedJavaVersion()
           
protected  void checkParameters()
          Check that all required attributes have been set and nothing silly has been entered.
protected  void compile()
          Perform the compilation.
 org.apache.tools.ant.types.Path createBootclasspath()
          Adds a path to the bootclasspath.
 org.apache.tools.ant.types.Path createClasspath()
          Adds a path to the classpath.
 org.apache.tools.ant.taskdefs.Javac.ImplementationSpecificArgument createCompilerArg()
          Adds an implementation specific command-line argument.
 org.apache.tools.ant.types.Path createExtdirs()
          Adds a path to extdirs.
 org.apache.tools.ant.types.Path createSourcepath()
          Adds a path to sourcepath.
 org.apache.tools.ant.types.Path createSrc()
          Adds a path for source compilation.
 void execute()
          Executes the task.
private  java.lang.String getAltCompilerName(java.lang.String anImplementation)
           
 org.apache.tools.ant.types.Path getBootclasspath()
          Gets the bootclasspath that will be used to compile the classes against.
 org.apache.tools.ant.types.Path getClasspath()
          Gets the classpath to be used for this compilation.
 java.lang.String getCompiler()
          The implementation for this particular task.
 java.lang.String getCompilerVersion()
          The implementation for this particular task.
 java.lang.String[] getCurrentCompilerArgs()
          Get the additional implementation specific command line arguments.
 boolean getDebug()
          Gets the debug flag.
 java.lang.String getDebugLevel()
          Get the value of debugLevel.
 boolean getDepend()
          Gets the depend flag.
 boolean getDeprecation()
          Gets the deprecation flag.
 java.io.File getDestdir()
          Gets the destination directory into which the java source files should be compiled.
 java.lang.String getEncoding()
          Gets the java source file encoding name.
 java.lang.String getExecutable()
          The value of the executable attribute, if any.
 org.apache.tools.ant.types.Path getExtdirs()
          Gets the extension directories that will be used during the compilation.
 boolean getFailonerror()
          Gets the failonerror flag.
 java.io.File[] getFileList()
          Gets the list of files to be compiled.
 boolean getIncludeantruntime()
          Gets whether or not the ant classpath is to be included in the classpath.
 boolean getIncludejavaruntime()
          Gets whether or not the java runtime should be included in this task's classpath.
 java.lang.String getJavacExecutable()
          The name of the javac executable to use in fork-mode.
 boolean getListfiles()
          Get the listfiles flag.
 java.lang.String getMemoryInitialSize()
          Gets the memoryInitialSize flag.
 java.lang.String getMemoryMaximumSize()
          Gets the memoryMaximumSize flag.
 boolean getNowarn()
          Should the -nowarn option be used.
 boolean getOptimize()
          Gets the optimize flag.
 java.lang.String getSource()
          Get the value of source.
 org.apache.tools.ant.types.Path getSourcepath()
          Gets the sourcepath to be used for this compilation.
 org.apache.tools.ant.types.Path getSrcdir()
          Gets the source dirs to find the source java files.
protected  java.lang.String getSystemJavac()
           
 java.lang.String getTarget()
          Gets the target VM that the classes will be compiled for.
 java.io.File getTempdir()
          Where Ant should place temporary files.
 boolean getVerbose()
          Gets the verbose flag.
 boolean isForkedJavac()
          Is this a forked invocation of JDK's javac?
protected  boolean isJdkCompiler(java.lang.String compilerImpl)
          Is the compiler implementation a jdk compiler
protected  org.apache.tools.ant.types.Path recreateSrc()
          Recreate src.
protected  void resetFileLists()
          Clear the list of files to be compiled and copied..
protected  void scanDir(java.io.File srcDir, java.io.File destDir, java.lang.String[] files)
          Scans the directory looking for source files to be compiled.
 void setBootclasspath(org.apache.tools.ant.types.Path bootclasspath)
          Sets the bootclasspath that will be used to compile the classes against.
 void setBootClasspathRef(org.apache.tools.ant.types.Reference r)
          Adds a reference to a classpath defined elsewhere.
 void setClasspath(org.apache.tools.ant.types.Path classpath)
          Set the classpath to be used for this compilation.
 void setClasspathRef(org.apache.tools.ant.types.Reference r)
          Adds a reference to a classpath defined elsewhere.
 void setCompiler(java.lang.String compiler)
          Choose the implementation for this particular task.
 void setDebug(boolean debug)
          Indicates whether source should be compiled with debug information; defaults to off.
 void setDebugLevel(java.lang.String v)
          Keyword list to be appended to the -g command-line switch.
 void setDepend(boolean depend)
          Enables dependency-tracking for compilers that support this (jikes and classic).
 void setDeprecation(boolean deprecation)
          Indicates whether source should be compiled with deprecation information; defaults to off.
 void setDestdir(java.io.File destDir)
          Set the destination directory into which the Java source files should be compiled.
 void setEncoding(java.lang.String encoding)
          Set the Java source file encoding name.
 void setExecutable(java.lang.String forkExec)
          Sets the name of the javac executable.
 void setExtdirs(org.apache.tools.ant.types.Path extdirs)
          Sets the extension directories that will be used during the compilation.
 void setFailonerror(boolean fail)
          Indicates whether the build will continue even if there are compilation errors; defaults to true.
 void setFork(boolean f)
          If true, forks the javac compiler.
 void setIncludeantruntime(boolean include)
          If true, includes Ant's own classpath in the classpath.
 void setIncludejavaruntime(boolean include)
          If true, includes the Java runtime libraries in the classpath.
 void setListfiles(boolean list)
          If true, list the source files being handed off to the compiler.
 void setMemoryInitialSize(java.lang.String memoryInitialSize)
          The initial size of the memory for the underlying VM if javac is run externally; ignored otherwise.
 void setMemoryMaximumSize(java.lang.String memoryMaximumSize)
          The maximum size of the memory for the underlying VM if javac is run externally; ignored otherwise.
 void setNowarn(boolean flag)
          If true, enables the -nowarn option.
 void setOptimize(boolean optimize)
          If true, compiles with optimization enabled.
 void setProceed(boolean proceed)
           
 void setSource(java.lang.String v)
          Value of the -source command-line switch; will be ignored by all implementations except modern and jikes.
 void setSourcepath(org.apache.tools.ant.types.Path sourcepath)
          Set the sourcepath to be used for this compilation.
 void setSourcepathRef(org.apache.tools.ant.types.Reference r)
          Adds a reference to a source path defined elsewhere.
 void setSrcdir(org.apache.tools.ant.types.Path srcDir)
          Set the source directories to find the source Java files.
 void setTarget(java.lang.String target)
          Sets the target VM that the classes will be compiled for.
 void setTempdir(java.io.File tmpDir)
          Where Ant should place temporary files.
 void setVerbose(boolean verbose)
          If true, asks the compiler for verbose output.
 
Methods inherited from class org.apache.tools.ant.taskdefs.Javac
add, createCompilerClasspath, getTaskSuccess, isIncludeDestClasses, setErrorProperty, setIncludeDestClasses, setUpdatedProperty
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FAIL_MSG

private static final java.lang.String FAIL_MSG
See Also:
Constant Field Values

JAVAC16

private static final java.lang.String JAVAC16
See Also:
Constant Field Values

JAVAC15

private static final java.lang.String JAVAC15
See Also:
Constant Field Values

JAVAC14

private static final java.lang.String JAVAC14
See Also:
Constant Field Values

JAVAC13

private static final java.lang.String JAVAC13
See Also:
Constant Field Values

JAVAC12

private static final java.lang.String JAVAC12
See Also:
Constant Field Values

JAVAC11

private static final java.lang.String JAVAC11
See Also:
Constant Field Values

MODERN

private static final java.lang.String MODERN
See Also:
Constant Field Values

CLASSIC

private static final java.lang.String CLASSIC
See Also:
Constant Field Values

EXTJAVAC

private static final java.lang.String EXTJAVAC
See Also:
Constant Field Values

src

private org.apache.tools.ant.types.Path src

destDir

private java.io.File destDir

compileClasspath

private org.apache.tools.ant.types.Path compileClasspath

compileSourcepath

private org.apache.tools.ant.types.Path compileSourcepath

encoding

private java.lang.String encoding

debug

private boolean debug

optimize

private boolean optimize

deprecation

private boolean deprecation

depend

private boolean depend

verbose

private boolean verbose

targetAttribute

private java.lang.String targetAttribute

bootclasspath

private org.apache.tools.ant.types.Path bootclasspath

extdirs

private org.apache.tools.ant.types.Path extdirs

includeAntRuntime

private boolean includeAntRuntime

includeJavaRuntime

private boolean includeJavaRuntime

fork

private boolean fork

forkedExecutable

private java.lang.String forkedExecutable

nowarn

private boolean nowarn

memoryInitialSize

private java.lang.String memoryInitialSize

memoryMaximumSize

private java.lang.String memoryMaximumSize

facade

private org.apache.tools.ant.util.facade.FacadeTaskHelper facade

failOnError

protected boolean failOnError

listFiles

protected boolean listFiles

compileList

protected java.io.File[] compileList

source

private java.lang.String source

debugLevel

private java.lang.String debugLevel

tmpDir

private java.io.File tmpDir
Constructor Detail

Javac

public Javac()
Javac task for compilation of Java files.

Method Detail

assumedJavaVersion

private java.lang.String assumedJavaVersion()

getDebugLevel

public java.lang.String getDebugLevel()
Get the value of debugLevel.

Overrides:
getDebugLevel in class org.apache.tools.ant.taskdefs.Javac
Returns:
value of debugLevel.

setDebugLevel

public void setDebugLevel(java.lang.String v)
Keyword list to be appended to the -g command-line switch. This will be ignored by all implementations except modern and classic(ver >= 1.2). Legal values are none or a comma-separated list of the following keywords: lines, vars, and source. If debuglevel is not specified, by default, :none will be appended to -g. If debug is not turned on, this attribute will be ignored.

Overrides:
setDebugLevel in class org.apache.tools.ant.taskdefs.Javac
Parameters:
v - Value to assign to debugLevel.

getSource

public java.lang.String getSource()
Get the value of source.

Overrides:
getSource in class org.apache.tools.ant.taskdefs.Javac
Returns:
value of source.

setSource

public void setSource(java.lang.String v)
Value of the -source command-line switch; will be ignored by all implementations except modern and jikes. If you use this attribute together with jikes, you must make sure that your version of jikes supports the -source switch. Legal values are 1.3, 1.4, 1.5, and 5 - by default, no -source argument will be used at all.

Overrides:
setSource in class org.apache.tools.ant.taskdefs.Javac
Parameters:
v - Value to assign to source.

createSrc

public org.apache.tools.ant.types.Path createSrc()
Adds a path for source compilation.

Overrides:
createSrc in class org.apache.tools.ant.taskdefs.Javac
Returns:
a nested src element.

recreateSrc

protected org.apache.tools.ant.types.Path recreateSrc()
Recreate src.

Overrides:
recreateSrc in class org.apache.tools.ant.taskdefs.Javac
Returns:
a nested src element.

setSrcdir

public void setSrcdir(org.apache.tools.ant.types.Path srcDir)
Set the source directories to find the source Java files.

Overrides:
setSrcdir in class org.apache.tools.ant.taskdefs.Javac
Parameters:
srcDir - the source directories as a path

getSrcdir

public org.apache.tools.ant.types.Path getSrcdir()
Gets the source dirs to find the source java files.

Overrides:
getSrcdir in class org.apache.tools.ant.taskdefs.Javac
Returns:
the source directories as a path

setDestdir

public void setDestdir(java.io.File destDir)
Set the destination directory into which the Java source files should be compiled.

Overrides:
setDestdir in class org.apache.tools.ant.taskdefs.Javac
Parameters:
destDir - the destination director

getDestdir

public java.io.File getDestdir()
Gets the destination directory into which the java source files should be compiled.

Overrides:
getDestdir in class org.apache.tools.ant.taskdefs.Javac
Returns:
the destination directory

setSourcepath

public void setSourcepath(org.apache.tools.ant.types.Path sourcepath)
Set the sourcepath to be used for this compilation.

Overrides:
setSourcepath in class org.apache.tools.ant.taskdefs.Javac
Parameters:
sourcepath - the source path

getSourcepath

public org.apache.tools.ant.types.Path getSourcepath()
Gets the sourcepath to be used for this compilation.

Overrides:
getSourcepath in class org.apache.tools.ant.taskdefs.Javac
Returns:
the source path

createSourcepath

public org.apache.tools.ant.types.Path createSourcepath()
Adds a path to sourcepath.

Overrides:
createSourcepath in class org.apache.tools.ant.taskdefs.Javac
Returns:
a sourcepath to be configured

setSourcepathRef

public void setSourcepathRef(org.apache.tools.ant.types.Reference r)
Adds a reference to a source path defined elsewhere.

Overrides:
setSourcepathRef in class org.apache.tools.ant.taskdefs.Javac
Parameters:
r - a reference to a source path

setClasspath

public void setClasspath(org.apache.tools.ant.types.Path classpath)
Set the classpath to be used for this compilation.

Overrides:
setClasspath in class org.apache.tools.ant.taskdefs.Javac
Parameters:
classpath - an Ant Path object containing the compilation classpath.

getClasspath

public org.apache.tools.ant.types.Path getClasspath()
Gets the classpath to be used for this compilation.

Overrides:
getClasspath in class org.apache.tools.ant.taskdefs.Javac
Returns:
the class path

createClasspath

public org.apache.tools.ant.types.Path createClasspath()
Adds a path to the classpath.

Overrides:
createClasspath in class org.apache.tools.ant.taskdefs.Javac
Returns:
a class path to be configured

setClasspathRef

public void setClasspathRef(org.apache.tools.ant.types.Reference r)
Adds a reference to a classpath defined elsewhere.

Overrides:
setClasspathRef in class org.apache.tools.ant.taskdefs.Javac
Parameters:
r - a reference to a classpath

setBootclasspath

public void setBootclasspath(org.apache.tools.ant.types.Path bootclasspath)
Sets the bootclasspath that will be used to compile the classes against.

Overrides:
setBootclasspath in class org.apache.tools.ant.taskdefs.Javac
Parameters:
bootclasspath - a path to use as a boot class path (may be more than one)

getBootclasspath

public org.apache.tools.ant.types.Path getBootclasspath()
Gets the bootclasspath that will be used to compile the classes against.

Overrides:
getBootclasspath in class org.apache.tools.ant.taskdefs.Javac
Returns:
the boot path

createBootclasspath

public org.apache.tools.ant.types.Path createBootclasspath()
Adds a path to the bootclasspath.

Overrides:
createBootclasspath in class org.apache.tools.ant.taskdefs.Javac
Returns:
a path to be configured

setBootClasspathRef

public void setBootClasspathRef(org.apache.tools.ant.types.Reference r)
Adds a reference to a classpath defined elsewhere.

Overrides:
setBootClasspathRef in class org.apache.tools.ant.taskdefs.Javac
Parameters:
r - a reference to a classpath

setExtdirs

public void setExtdirs(org.apache.tools.ant.types.Path extdirs)
Sets the extension directories that will be used during the compilation.

Overrides:
setExtdirs in class org.apache.tools.ant.taskdefs.Javac
Parameters:
extdirs - a path

getExtdirs

public org.apache.tools.ant.types.Path getExtdirs()
Gets the extension directories that will be used during the compilation.

Overrides:
getExtdirs in class org.apache.tools.ant.taskdefs.Javac
Returns:
the extension directories as a path

createExtdirs

public org.apache.tools.ant.types.Path createExtdirs()
Adds a path to extdirs.

Overrides:
createExtdirs in class org.apache.tools.ant.taskdefs.Javac
Returns:
a path to be configured

setListfiles

public void setListfiles(boolean list)
If true, list the source files being handed off to the compiler.

Overrides:
setListfiles in class org.apache.tools.ant.taskdefs.Javac
Parameters:
list - if true list the source files

getListfiles

public boolean getListfiles()
Get the listfiles flag.

Overrides:
getListfiles in class org.apache.tools.ant.taskdefs.Javac
Returns:
the listfiles flag

setFailonerror

public void setFailonerror(boolean fail)
Indicates whether the build will continue even if there are compilation errors; defaults to true.

Overrides:
setFailonerror in class org.apache.tools.ant.taskdefs.Javac
Parameters:
fail - if true halt the build on failure

setProceed

public void setProceed(boolean proceed)
Overrides:
setProceed in class org.apache.tools.ant.taskdefs.Javac
Parameters:
proceed - inverse of failoferror

getFailonerror

public boolean getFailonerror()
Gets the failonerror flag.

Overrides:
getFailonerror in class org.apache.tools.ant.taskdefs.Javac
Returns:
the failonerror flag

setDeprecation

public void setDeprecation(boolean deprecation)
Indicates whether source should be compiled with deprecation information; defaults to off.

Overrides:
setDeprecation in class org.apache.tools.ant.taskdefs.Javac
Parameters:
deprecation - if true turn on deprecation information

getDeprecation

public boolean getDeprecation()
Gets the deprecation flag.

Overrides:
getDeprecation in class org.apache.tools.ant.taskdefs.Javac
Returns:
the deprecation flag

setMemoryInitialSize

public void setMemoryInitialSize(java.lang.String memoryInitialSize)
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)

Overrides:
setMemoryInitialSize in class org.apache.tools.ant.taskdefs.Javac
Parameters:
memoryInitialSize - string to pass to VM

getMemoryInitialSize

public java.lang.String getMemoryInitialSize()
Gets the memoryInitialSize flag.

Overrides:
getMemoryInitialSize in class org.apache.tools.ant.taskdefs.Javac
Returns:
the memoryInitialSize flag

setMemoryMaximumSize

public void setMemoryMaximumSize(java.lang.String memoryMaximumSize)
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)

Overrides:
setMemoryMaximumSize in class org.apache.tools.ant.taskdefs.Javac
Parameters:
memoryMaximumSize - string to pass to VM

getMemoryMaximumSize

public java.lang.String getMemoryMaximumSize()
Gets the memoryMaximumSize flag.

Overrides:
getMemoryMaximumSize in class org.apache.tools.ant.taskdefs.Javac
Returns:
the memoryMaximumSize flag

setEncoding

public void setEncoding(java.lang.String encoding)
Set the Java source file encoding name.

Overrides:
setEncoding in class org.apache.tools.ant.taskdefs.Javac
Parameters:
encoding - the source file encoding

getEncoding

public java.lang.String getEncoding()
Gets the java source file encoding name.

Overrides:
getEncoding in class org.apache.tools.ant.taskdefs.Javac
Returns:
the source file encoding name

setDebug

public void setDebug(boolean debug)
Indicates whether source should be compiled with debug information; defaults to off.

Overrides:
setDebug in class org.apache.tools.ant.taskdefs.Javac
Parameters:
debug - if true compile with debug information

getDebug

public boolean getDebug()
Gets the debug flag.

Overrides:
getDebug in class org.apache.tools.ant.taskdefs.Javac
Returns:
the debug flag

setOptimize

public void setOptimize(boolean optimize)
If true, compiles with optimization enabled.

Overrides:
setOptimize in class org.apache.tools.ant.taskdefs.Javac
Parameters:
optimize - if true compile with optimization enabled

getOptimize

public boolean getOptimize()
Gets the optimize flag.

Overrides:
getOptimize in class org.apache.tools.ant.taskdefs.Javac
Returns:
the optimize flag

setDepend

public void setDepend(boolean depend)
Enables dependency-tracking for compilers that support this (jikes and classic).

Overrides:
setDepend in class org.apache.tools.ant.taskdefs.Javac
Parameters:
depend - if true enable dependency-tracking

getDepend

public boolean getDepend()
Gets the depend flag.

Overrides:
getDepend in class org.apache.tools.ant.taskdefs.Javac
Returns:
the depend flag

setVerbose

public void setVerbose(boolean verbose)
If true, asks the compiler for verbose output.

Overrides:
setVerbose in class org.apache.tools.ant.taskdefs.Javac
Parameters:
verbose - if true, asks the compiler for verbose output

getVerbose

public boolean getVerbose()
Gets the verbose flag.

Overrides:
getVerbose in class org.apache.tools.ant.taskdefs.Javac
Returns:
the verbose flag

setTarget

public void setTarget(java.lang.String target)
Sets the target VM that the classes will be compiled for. Valid values depend on the compiler, for jdk 1.4 the valid values are "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "5" and "6".

Overrides:
setTarget in class org.apache.tools.ant.taskdefs.Javac
Parameters:
target - the target VM

getTarget

public java.lang.String getTarget()
Gets the target VM that the classes will be compiled for.

Overrides:
getTarget in class org.apache.tools.ant.taskdefs.Javac
Returns:
the target VM

setIncludeantruntime

public void setIncludeantruntime(boolean include)
If true, includes Ant's own classpath in the classpath.

Overrides:
setIncludeantruntime in class org.apache.tools.ant.taskdefs.Javac
Parameters:
include - if true, includes Ant's own classpath in the classpath

getIncludeantruntime

public boolean getIncludeantruntime()
Gets whether or not the ant classpath is to be included in the classpath.

Overrides:
getIncludeantruntime in class org.apache.tools.ant.taskdefs.Javac
Returns:
whether or not the ant classpath is to be included in the classpath

setIncludejavaruntime

public void setIncludejavaruntime(boolean include)
If true, includes the Java runtime libraries in the classpath.

Overrides:
setIncludejavaruntime in class org.apache.tools.ant.taskdefs.Javac
Parameters:
include - if true, includes the Java runtime libraries in the classpath

getIncludejavaruntime

public boolean getIncludejavaruntime()
Gets whether or not the java runtime should be included in this task's classpath.

Overrides:
getIncludejavaruntime in class org.apache.tools.ant.taskdefs.Javac
Returns:
the includejavaruntime attribute

setFork

public void setFork(boolean f)
If true, forks the javac compiler.

Overrides:
setFork in class org.apache.tools.ant.taskdefs.Javac
Parameters:
f - "true|false|on|off|yes|no"

setExecutable

public void setExecutable(java.lang.String forkExec)
Sets the name of the javac executable.

Ignored unless fork is true or extJavac has been specified as the compiler.

Overrides:
setExecutable in class org.apache.tools.ant.taskdefs.Javac
Parameters:
forkExec - the name of the executable

getExecutable

public java.lang.String getExecutable()
The value of the executable attribute, if any.

Overrides:
getExecutable in class org.apache.tools.ant.taskdefs.Javac
Returns:
the name of the java executable
Since:
Ant 1.6

isForkedJavac

public boolean isForkedJavac()
Is this a forked invocation of JDK's javac?

Overrides:
isForkedJavac in class org.apache.tools.ant.taskdefs.Javac
Returns:
true if this is a forked invocation

getJavacExecutable

public java.lang.String getJavacExecutable()
The name of the javac executable to use in fork-mode.

This is either the name specified with the executable attribute or the full path of the javac compiler of the VM Ant is currently running in - guessed by Ant.

You should not invoke this method if you want to get the value of the executable command - use getExecutable for this.

Overrides:
getJavacExecutable in class org.apache.tools.ant.taskdefs.Javac
Returns:
the name of the javac executable

setNowarn

public void setNowarn(boolean flag)
If true, enables the -nowarn option.

Overrides:
setNowarn in class org.apache.tools.ant.taskdefs.Javac
Parameters:
flag - if true, enable the -nowarn option

getNowarn

public boolean getNowarn()
Should the -nowarn option be used.

Overrides:
getNowarn in class org.apache.tools.ant.taskdefs.Javac
Returns:
true if the -nowarn option should be used

createCompilerArg

public org.apache.tools.ant.taskdefs.Javac.ImplementationSpecificArgument createCompilerArg()
Adds an implementation specific command-line argument.

Overrides:
createCompilerArg in class org.apache.tools.ant.taskdefs.Javac
Returns:
a ImplementationSpecificArgument to be configured

getCurrentCompilerArgs

public java.lang.String[] getCurrentCompilerArgs()
Get the additional implementation specific command line arguments.

Overrides:
getCurrentCompilerArgs in class org.apache.tools.ant.taskdefs.Javac
Returns:
array of command line arguments, guaranteed to be non-null.

getAltCompilerName

private java.lang.String getAltCompilerName(java.lang.String anImplementation)

setTempdir

public void setTempdir(java.io.File tmpDir)
Where Ant should place temporary files.

Overrides:
setTempdir in class org.apache.tools.ant.taskdefs.Javac
Parameters:
tmpDir - the temporary directory
Since:
Ant 1.6

getTempdir

public java.io.File getTempdir()
Where Ant should place temporary files.

Overrides:
getTempdir in class org.apache.tools.ant.taskdefs.Javac
Returns:
the temporary directory
Since:
Ant 1.6

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Executes the task.

Overrides:
execute in class org.apache.tools.ant.taskdefs.Javac
Throws:
org.apache.tools.ant.BuildException - if an error occurs

resetFileLists

protected void resetFileLists()
Clear the list of files to be compiled and copied..

Overrides:
resetFileLists in class org.apache.tools.ant.taskdefs.Javac

scanDir

protected void scanDir(java.io.File srcDir,
                       java.io.File destDir,
                       java.lang.String[] files)
Scans the directory looking for source files to be compiled. The results are returned in the class variable compileList

Overrides:
scanDir in class org.apache.tools.ant.taskdefs.Javac
Parameters:
srcDir - The source directory
destDir - The destination directory
files - An array of filenames

getFileList

public java.io.File[] getFileList()
Gets the list of files to be compiled.

Overrides:
getFileList in class org.apache.tools.ant.taskdefs.Javac
Returns:
the list of files as an array

isJdkCompiler

protected boolean isJdkCompiler(java.lang.String compilerImpl)
Is the compiler implementation a jdk compiler

Overrides:
isJdkCompiler in class org.apache.tools.ant.taskdefs.Javac
Parameters:
compilerImpl - the name of the compiler implementation
Returns:
true if compilerImpl is "modern", "classic", "javac1.1", "javac1.2", "javac1.3", "javac1.4", "javac1.5" or "javac1.6".

getSystemJavac

protected java.lang.String getSystemJavac()
Overrides:
getSystemJavac in class org.apache.tools.ant.taskdefs.Javac
Returns:
the executable name of the java compiler

setCompiler

public void setCompiler(java.lang.String compiler)
Choose the implementation for this particular task.

Overrides:
setCompiler in class org.apache.tools.ant.taskdefs.Javac
Parameters:
compiler - the name of the compiler
Since:
Ant 1.5

getCompiler

public java.lang.String getCompiler()
The implementation for this particular task.

Defaults to the build.compiler property but can be overridden via the compiler and fork attributes.

If fork has been set to true, the result will be extJavac and not classic or java1.2 - no matter what the compiler attribute looks like.

Overrides:
getCompiler in class org.apache.tools.ant.taskdefs.Javac
Returns:
the compiler.
Since:
Ant 1.5
See Also:
getCompilerVersion()

getCompilerVersion

public java.lang.String getCompilerVersion()
The implementation for this particular task.

Defaults to the build.compiler property but can be overridden via the compiler attribute.

This method does not take the fork attribute into account.

Overrides:
getCompilerVersion in class org.apache.tools.ant.taskdefs.Javac
Returns:
the compiler.
Since:
Ant 1.5
See Also:
getCompiler()

checkParameters

protected void checkParameters()
                        throws org.apache.tools.ant.BuildException
Check that all required attributes have been set and nothing silly has been entered.

Overrides:
checkParameters in class org.apache.tools.ant.taskdefs.Javac
Throws:
org.apache.tools.ant.BuildException - if an error occurs
Since:
Ant 1.5

compile

protected void compile()
Perform the compilation.

Overrides:
compile in class org.apache.tools.ant.taskdefs.Javac
Since:
Ant 1.5