gnu.kawa.ant
Class Kawac

java.lang.Object
  extended by MatchingTask
      extended by gnu.kawa.ant.Kawac

public class Kawac
extends MatchingTask

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

If srcdir is set, then that directory is searched for source files to compile (subject to any nested includes/excludes). Otherwise, files included in nested filesets will be compiled and written into destdir.

When this task executes, it will compile any listed source file which is younger than its corresponding class file.

Superficially based upon the standard Ant Javac Task, but with FileSet support as well.


Constructor Summary
Kawac()
          Kawac task for compilation of Kawa files.
 
Method Summary
 void add(FileSelector selector)
           
 void addAnd(AndSelector selector)
           
 void addArg(Commandline.Argument arg)
          Adds a nested <arg>.
 void addContains(ContainsSelector selector)
           
 void addContainsRegexp(ContainsRegexpSelector selector)
           
 void addCustom(ExtendSelector selector)
           
 void addDate(DateSelector selector)
           
 void addDepend(DependSelector selector)
           
 void addDepth(DepthSelector selector)
           
 void addFilename(FilenameSelector selector)
           
 void addFileset(FileSet set)
          Adds a set of files to be compiled.
 void addMajority(MajoritySelector selector)
           
 void addModified(ModifiedSelector selector)
           
 void addNone(NoneSelector selector)
           
 void addNot(NotSelector selector)
           
 void addOr(OrSelector selector)
           
 void addPresent(PresentSelector selector)
           
 void addSelector(SelectSelector selector)
           
 void addSize(SizeSelector selector)
           
 Path createClasspath()
          Adds a path to the classpath.
 PatternSet.NameEntry createExclude()
           
 PatternSet.NameEntry createExcludesFile()
           
 PatternSet.NameEntry createInclude()
           
 PatternSet.NameEntry createIncludesFile()
           
 PatternSet createPatternSet()
           
 void execute()
          Executes the task.
 boolean getApplet()
          Gets the value of the "applet" property.
 Path getClasspath()
          Gets the classpath to be used for this compilation.
 java.io.File getDestdir()
          Gets the destination directory into which the Kawa source files should be compiled.
 boolean getFailonerror()
          Gets the failonerror flag.
 java.io.File[] getFileList()
          Gets the list of files to be compiled.
 boolean getFulltailcalls()
          Gets the value of the fulltailcalls property.
 java.lang.String getLanguage()
          Gets the language.
 boolean getListfiles()
          Get the listfiles flag.
 boolean getMain()
          Gets the value of the "main" property.
 java.lang.String getModulestatic()
          Gets the value of the modulestatic property.
 java.lang.String getPrefix()
          Gets the prefix
 boolean getServlet()
          Gets the value of the "servlet" property.
 Path getSrcdir()
          Gets the source dirs to find the source Kawa files.
 java.lang.String getTarget()
          Gets the target VM that the classes will be compiled for.
 boolean getTaskSuccess()
          Get the result of the kawac task (success or failure).
 boolean getWarnaserror()
          Gets the value of the warnaserror property.
 boolean getWarnundefinedvariable()
          Gets the value of the warnundefinedvariable property.
 boolean isIncludeDestClasses()
          Get the value of the includeDestClasses property.
 void setApplet(boolean applet)
          If true, then Kawa will generate an applet.
 void setCaseSensitive(boolean isCaseSensitive)
           
 void setClasspath(Path classpath)
          Set the classpath to be used for this compilation.
 void setClasspathRef(Reference r)
          Adds a reference to a classpath defined elsewhere.
 void setDefaultexcludes(boolean useDefaultExcludes)
           
 void setDestdir(java.io.File destDir)
          Set the destination directory into which the Kawa source files should be compiled.
 void setErrorProperty(java.lang.String errorProperty)
          The property to set on compilation failure.
 void setExcludes(java.lang.String excludes)
           
 void setExcludesfile(java.io.File excludesfile)
           
 void setFailonerror(boolean fail)
          Indicates whether the build will continue even if there are compilation errors; defaults to true.
 void setFollowSymlinks(boolean followSymlinks)
           
 void setFulltailcalls(boolean tailcalls)
          If true, Kawa will use full tailcalls.
 void setIncludeDestClasses(boolean includeDestClasses)
          This property controls whether to include the destination classes directory in the classpath given to the compiler.
 void setIncludes(java.lang.String includes)
           
 void setIncludesfile(java.io.File includesfile)
           
 void setLanguage(java.lang.String lang)
          Sets the language to use: "scheme", "commonlisp", or "elisp".
 void setListfiles(boolean list)
          If true, list the source files being handed off to the compiler.
 void setMain(boolean main)
          If true, then Kawa will create a static main method.
 void setModulestatic(java.lang.String moduleStatic)
          Passes the --module-static or --module-static-run flag.
 void setPrefix(java.lang.String prefix)
          Sets the prefix.
 void setServlet(boolean servlet)
          If true, then Kawa will generate a servlet.
 void setSrcdir(Path srcDir)
          Set the source directories to find the source Kawa files.
 void setTarget(java.lang.String target)
          Sets the target VM that the classes will be compiled for.
 void setUpdatedProperty(java.lang.String updatedProperty)
          The property to set on compilation success.
 void setWarnaserror(boolean warnaserror)
          Passes the --warn-as-error flag if true.
 void setWarnundefinedvariable(boolean undefined)
          Passes the --warn-undefined-variable flag if true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Kawac

public Kawac()
Kawac task for compilation of Kawa files.

Method Detail

setSrcdir

public void setSrcdir(Path srcDir)
Set the source directories to find the source Kawa files.

Parameters:
srcDir - the source directories as a path

getSrcdir

public Path getSrcdir()
Gets the source dirs to find the source Kawa files.

Returns:
the source directories as a path

setDestdir

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

Parameters:
destDir - the destination directory

getDestdir

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

Returns:
the destination directory

setClasspath

public void setClasspath(Path classpath)
Set the classpath to be used for this compilation.

Parameters:
classpath - an Ant Path object containing the compilation classpath.

getClasspath

public Path getClasspath()
Gets the classpath to be used for this compilation.

Returns:
the class path

createClasspath

public Path createClasspath()
Adds a path to the classpath.

Returns:
a class path to be configured

setClasspathRef

public void setClasspathRef(Reference r)
Adds a reference to a classpath defined elsewhere.

Parameters:
r - a reference to a classpath

setListfiles

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

Parameters:
list - if true list the source files

getListfiles

public boolean getListfiles()
Get the listfiles flag.

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.

Parameters:
fail - if true halt the build on failure

getFailonerror

public boolean getFailonerror()
Gets the failonerror flag.

Returns:
the failonerror flag

setTarget

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

Parameters:
target - the target VM

getTarget

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

Returns:
the target VM

setIncludeDestClasses

public void setIncludeDestClasses(boolean includeDestClasses)
This property controls whether to include the destination classes directory in the classpath given to the compiler. The default value is true.

Parameters:
includeDestClasses - the value to use

isIncludeDestClasses

public boolean isIncludeDestClasses()
Get the value of the includeDestClasses property.

Returns:
the value

setUpdatedProperty

public void setUpdatedProperty(java.lang.String updatedProperty)
The property to set on compilation success. This property will not be set if the compilation fails, or if there are no files to compile.

Parameters:
updatedProperty - the property name to use

setErrorProperty

public void setErrorProperty(java.lang.String errorProperty)
The property to set on compilation failure. This property will be set if the compilation fails.

Parameters:
errorProperty - the property name to use

setPrefix

public void setPrefix(java.lang.String prefix)
Sets the prefix.

Parameters:
prefix - the prefix to use

getPrefix

public java.lang.String getPrefix()
Gets the prefix

Returns:
the prefix

setMain

public void setMain(boolean main)
If true, then Kawa will create a static main method.

Parameters:
main - true to pass --main to Kawa

getMain

public boolean getMain()
Gets the value of the "main" property.

Returns:
the value

setApplet

public void setApplet(boolean applet)
If true, then Kawa will generate an applet.

Parameters:
applet - true to pass --applet to Kawa

getApplet

public boolean getApplet()
Gets the value of the "applet" property.

Returns:
the value

setServlet

public void setServlet(boolean servlet)
If true, then Kawa will generate a servlet.

Parameters:
servlet - true to pass --applet to Kawa

getServlet

public boolean getServlet()
Gets the value of the "servlet" property.

Returns:
the value

setFulltailcalls

public void setFulltailcalls(boolean tailcalls)
If true, Kawa will use full tailcalls.

Parameters:
tailcalls - true to use full-tailcalls

getFulltailcalls

public boolean getFulltailcalls()
Gets the value of the fulltailcalls property.

Returns:
the value

setModulestatic

public void setModulestatic(java.lang.String moduleStatic)
Passes the --module-static or --module-static-run flag.

Parameters:
moduleStatic - the flag

getModulestatic

public java.lang.String getModulestatic()
Gets the value of the modulestatic property.

Returns:
the value

setWarnundefinedvariable

public void setWarnundefinedvariable(boolean undefined)
Passes the --warn-undefined-variable flag if true.

Parameters:
undefined - true for --warn-undefined-variable

getWarnundefinedvariable

public boolean getWarnundefinedvariable()
Gets the value of the warnundefinedvariable property.

Returns:
the value

setWarnaserror

public void setWarnaserror(boolean warnaserror)
Passes the --warn-as-error flag if true.

Parameters:
warnaserror - true for --warn-as-error

getWarnaserror

public boolean getWarnaserror()
Gets the value of the warnaserror property.

Returns:
the value

setLanguage

public void setLanguage(java.lang.String lang)
Sets the language to use: "scheme", "commonlisp", or "elisp".

Parameters:
lang - the language to use

getLanguage

public java.lang.String getLanguage()
Gets the language.

Returns:
the value

addFileset

public void addFileset(FileSet set)
Adds a set of files to be compiled.

Parameters:
set - the set of files to be compiled

addArg

public void addArg(Commandline.Argument arg)
Adds a nested <arg>.

Parameters:
arg - the argument to add to the kawa command line

createInclude

public PatternSet.NameEntry createInclude()

createIncludesFile

public PatternSet.NameEntry createIncludesFile()

createExclude

public PatternSet.NameEntry createExclude()

createExcludesFile

public PatternSet.NameEntry createExcludesFile()

createPatternSet

public PatternSet createPatternSet()

setIncludes

public void setIncludes(java.lang.String includes)

setExcludes

public void setExcludes(java.lang.String excludes)

setDefaultexcludes

public void setDefaultexcludes(boolean useDefaultExcludes)

setIncludesfile

public void setIncludesfile(java.io.File includesfile)

setExcludesfile

public void setExcludesfile(java.io.File excludesfile)

setCaseSensitive

public void setCaseSensitive(boolean isCaseSensitive)

setFollowSymlinks

public void setFollowSymlinks(boolean followSymlinks)

addSelector

public void addSelector(SelectSelector selector)

addAnd

public void addAnd(AndSelector selector)

addOr

public void addOr(OrSelector selector)

addNot

public void addNot(NotSelector selector)

addNone

public void addNone(NoneSelector selector)

addMajority

public void addMajority(MajoritySelector selector)

addDate

public void addDate(DateSelector selector)

addSize

public void addSize(SizeSelector selector)

addFilename

public void addFilename(FilenameSelector selector)

addCustom

public void addCustom(ExtendSelector selector)

addContains

public void addContains(ContainsSelector selector)

addPresent

public void addPresent(PresentSelector selector)

addDepth

public void addDepth(DepthSelector selector)

addDepend

public void addDepend(DependSelector selector)

addContainsRegexp

public void addContainsRegexp(ContainsRegexpSelector selector)

addModified

public void addModified(ModifiedSelector selector)

add

public void add(FileSelector selector)

getTaskSuccess

public boolean getTaskSuccess()
Get the result of the kawac task (success or failure).

Returns:
true if compilation succeeded, or was not necessary, false if the compilation failed.

execute

public void execute()
             throws BuildException
Executes the task.

Throws:
BuildException - if an error occurs

getFileList

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

Returns:
the list of files as an array