Package gnu.kawa.ant
Class Kawac
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
gnu.kawa.ant.Kawac
- All Implemented Interfaces:
Cloneable
,org.apache.tools.ant.types.selectors.SelectorContainer
public class Kawac
extends org.apache.tools.ant.taskdefs.MatchingTask
Compiles Kawa source files. This task can take the following
arguments:
- srcdir
- destdir
- classpath
- target
- failonerror
- prefix
- main
- fulltailcalls
- modulestatic
- warnundefinedvariable
- language
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 and FileList support as well.
-
Field Summary
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
Fields inherited from class org.apache.tools.ant.Task
taskName, taskType, wrapper
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(org.apache.tools.ant.types.selectors.FileSelector selector) void
addAnd
(org.apache.tools.ant.types.selectors.AndSelector selector) void
addArg
(org.apache.tools.ant.types.Commandline.Argument arg) Adds a nested<arg>
.void
addContains
(org.apache.tools.ant.types.selectors.ContainsSelector selector) void
addContainsRegexp
(org.apache.tools.ant.types.selectors.ContainsRegexpSelector selector) void
addCustom
(org.apache.tools.ant.types.selectors.ExtendSelector selector) void
addDate
(org.apache.tools.ant.types.selectors.DateSelector selector) void
addDepend
(org.apache.tools.ant.types.selectors.DependSelector selector) void
addDepth
(org.apache.tools.ant.types.selectors.DepthSelector selector) void
addFilelist
(org.apache.tools.ant.types.FileList list) Adds a list of files to be compiled.void
addFilename
(org.apache.tools.ant.types.selectors.FilenameSelector selector) void
addFileset
(org.apache.tools.ant.types.FileSet set) Adds a set of files to be compiled.void
addMajority
(org.apache.tools.ant.types.selectors.MajoritySelector selector) void
addModified
(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector selector) void
addNone
(org.apache.tools.ant.types.selectors.NoneSelector selector) void
addNot
(org.apache.tools.ant.types.selectors.NotSelector selector) void
addOr
(org.apache.tools.ant.types.selectors.OrSelector selector) void
addPresent
(org.apache.tools.ant.types.selectors.PresentSelector selector) void
addSelector
(org.apache.tools.ant.types.selectors.SelectSelector selector) void
addSize
(org.apache.tools.ant.types.selectors.SizeSelector selector) org.apache.tools.ant.types.Path
Adds a path to the classpath.org.apache.tools.ant.types.PatternSet.NameEntry
org.apache.tools.ant.types.PatternSet.NameEntry
org.apache.tools.ant.types.PatternSet.NameEntry
org.apache.tools.ant.types.PatternSet.NameEntry
org.apache.tools.ant.types.PatternSet
void
execute()
Executes the task.boolean
Gets the value of the "applet" property.org.apache.tools.ant.types.Path
Gets the classpath to be used for this compilation.Gets the destination directory into which the Kawa source files should be compiled.boolean
Gets the failonerror flag.File[]
Gets the list of files to be compiled.boolean
Gets the value of the fulltailcalls property.Gets the language.boolean
Get the listfiles flag.boolean
getMain()
Gets the value of the "main" property.Gets the value of the modulestatic property.Gets the prefixboolean
Gets the value of the "servlet" property.org.apache.tools.ant.types.Path
Gets the source dirs to find the source Kawa files.Gets the target VM that the classes will be compiled for.boolean
Get the result of the kawac task (success or failure).boolean
Gets the value of the warnaserror property.boolean
Gets the value of the warnundefinedvariable property.boolean
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
(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
setDefaultexcludes
(boolean useDefaultExcludes) void
setDestdir
(File destDir) Set the destination directory into which the Kawa source files should be compiled.void
setErrorProperty
(String errorProperty) The property to set on compilation failure.void
setExcludes
(String excludes) void
setExcludesfile
(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
(String includes) void
setIncludesfile
(File includesfile) void
setLanguage
(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
(String moduleStatic) Passes the --module-static or --module-static-run flag.void
Sets the prefix.void
setServlet
(boolean servlet) If true, then Kawa will generate a servlet.void
setSrcdir
(org.apache.tools.ant.types.Path srcDir) Set the source directories to find the source Kawa files.void
Sets the target VM that the classes will be compiled for.void
setUpdatedProperty
(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 org.apache.tools.ant.taskdefs.MatchingTask
addDifferent, addType, appendSelector, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, 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
-
Constructor Details
-
Kawac
public Kawac()Kawac task for compilation of Kawa files.
-
-
Method Details
-
setSrcdir
public void setSrcdir(org.apache.tools.ant.types.Path srcDir) Set the source directories to find the source Kawa files.- 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 Kawa files.- Returns:
- the source directories as a path
-
setDestdir
Set the destination directory into which the Kawa source files should be compiled.- Parameters:
destDir
- the destination directory
-
getDestdir
Gets the destination directory into which the Kawa source files should be compiled.- Returns:
- the destination directory
-
setClasspath
public void setClasspath(org.apache.tools.ant.types.Path classpath) Set the classpath to be used for this compilation.- 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.- Returns:
- the class path
-
createClasspath
public org.apache.tools.ant.types.Path createClasspath()Adds a path to the classpath.- 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.- 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
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
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
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
The property to set on compilation failure. This property will be set if the compilation fails.- Parameters:
errorProperty
- the property name to use
-
setPrefix
Sets the prefix.- Parameters:
prefix
- the prefix to use
-
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
Passes the --module-static or --module-static-run flag.- Parameters:
moduleStatic
- the flag
-
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
Sets the language to use: "scheme", "commonlisp", or "elisp".- Parameters:
lang
- the language to use
-
getLanguage
Gets the language.- Returns:
- the value
-
addFileset
public void addFileset(org.apache.tools.ant.types.FileSet set) Adds a set of files to be compiled.- Parameters:
set
- the set of files to be compiled
-
addFilelist
public void addFilelist(org.apache.tools.ant.types.FileList list) Adds a list of files to be compiled.- Parameters:
list
- the list of files to be compiled
-
addArg
public void addArg(org.apache.tools.ant.types.Commandline.Argument arg) Adds a nested<arg>
.- Parameters:
arg
- the argument to add to the kawa command line
-
createInclude
public org.apache.tools.ant.types.PatternSet.NameEntry createInclude()- Overrides:
createInclude
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
createIncludesFile
public org.apache.tools.ant.types.PatternSet.NameEntry createIncludesFile()- Overrides:
createIncludesFile
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
createExclude
public org.apache.tools.ant.types.PatternSet.NameEntry createExclude()- Overrides:
createExclude
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
createExcludesFile
public org.apache.tools.ant.types.PatternSet.NameEntry createExcludesFile()- Overrides:
createExcludesFile
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
createPatternSet
public org.apache.tools.ant.types.PatternSet createPatternSet()- Overrides:
createPatternSet
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
setIncludes
- Overrides:
setIncludes
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
setExcludes
- Overrides:
setExcludes
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
setDefaultexcludes
public void setDefaultexcludes(boolean useDefaultExcludes) - Overrides:
setDefaultexcludes
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
setIncludesfile
- Overrides:
setIncludesfile
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
setExcludesfile
- Overrides:
setExcludesfile
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
setCaseSensitive
public void setCaseSensitive(boolean isCaseSensitive) - Overrides:
setCaseSensitive
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
setFollowSymlinks
public void setFollowSymlinks(boolean followSymlinks) - Overrides:
setFollowSymlinks
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addSelector
public void addSelector(org.apache.tools.ant.types.selectors.SelectSelector selector) - Specified by:
addSelector
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addSelector
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addAnd
public void addAnd(org.apache.tools.ant.types.selectors.AndSelector selector) - Specified by:
addAnd
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addAnd
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addOr
public void addOr(org.apache.tools.ant.types.selectors.OrSelector selector) - Specified by:
addOr
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addOr
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addNot
public void addNot(org.apache.tools.ant.types.selectors.NotSelector selector) - Specified by:
addNot
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addNot
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addNone
public void addNone(org.apache.tools.ant.types.selectors.NoneSelector selector) - Specified by:
addNone
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addNone
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addMajority
public void addMajority(org.apache.tools.ant.types.selectors.MajoritySelector selector) - Specified by:
addMajority
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addMajority
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addDate
public void addDate(org.apache.tools.ant.types.selectors.DateSelector selector) - Specified by:
addDate
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addDate
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addSize
public void addSize(org.apache.tools.ant.types.selectors.SizeSelector selector) - Specified by:
addSize
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addSize
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addFilename
public void addFilename(org.apache.tools.ant.types.selectors.FilenameSelector selector) - Specified by:
addFilename
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addFilename
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addCustom
public void addCustom(org.apache.tools.ant.types.selectors.ExtendSelector selector) - Specified by:
addCustom
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addCustom
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addContains
public void addContains(org.apache.tools.ant.types.selectors.ContainsSelector selector) - Specified by:
addContains
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addContains
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addPresent
public void addPresent(org.apache.tools.ant.types.selectors.PresentSelector selector) - Specified by:
addPresent
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addPresent
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addDepth
public void addDepth(org.apache.tools.ant.types.selectors.DepthSelector selector) - Specified by:
addDepth
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addDepth
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addDepend
public void addDepend(org.apache.tools.ant.types.selectors.DependSelector selector) - Specified by:
addDepend
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addDepend
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addContainsRegexp
public void addContainsRegexp(org.apache.tools.ant.types.selectors.ContainsRegexpSelector selector) - Specified by:
addContainsRegexp
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addContainsRegexp
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
addModified
public void addModified(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector selector) - Specified by:
addModified
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
addModified
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
add
public void add(org.apache.tools.ant.types.selectors.FileSelector selector) - Specified by:
add
in interfaceorg.apache.tools.ant.types.selectors.SelectorContainer
- Overrides:
add
in classorg.apache.tools.ant.taskdefs.MatchingTask
-
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 org.apache.tools.ant.BuildExceptionExecutes the task. Throws BuildException if an error occurs- Overrides:
execute
in classorg.apache.tools.ant.Task
- Throws:
org.apache.tools.ant.BuildException
-
getFileList
Gets the list of files to be compiled.- Returns:
- the list of files as an array
-