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
filesetFields inherited from class org.apache.tools.ant.Task
taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.apache.tools.ant.types.selectors.FileSelector selector) voidaddAnd(org.apache.tools.ant.types.selectors.AndSelector selector) voidaddArg(org.apache.tools.ant.types.Commandline.Argument arg) Adds a nested<arg>.voidaddContains(org.apache.tools.ant.types.selectors.ContainsSelector selector) voidaddContainsRegexp(org.apache.tools.ant.types.selectors.ContainsRegexpSelector selector) voidaddCustom(org.apache.tools.ant.types.selectors.ExtendSelector selector) voidaddDate(org.apache.tools.ant.types.selectors.DateSelector selector) voidaddDepend(org.apache.tools.ant.types.selectors.DependSelector selector) voidaddDepth(org.apache.tools.ant.types.selectors.DepthSelector selector) voidaddFilelist(org.apache.tools.ant.types.FileList list) Adds a list of files to be compiled.voidaddFilename(org.apache.tools.ant.types.selectors.FilenameSelector selector) voidaddFileset(org.apache.tools.ant.types.FileSet set) Adds a set of files to be compiled.voidaddMajority(org.apache.tools.ant.types.selectors.MajoritySelector selector) voidaddModified(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector selector) voidaddNone(org.apache.tools.ant.types.selectors.NoneSelector selector) voidaddNot(org.apache.tools.ant.types.selectors.NotSelector selector) voidaddOr(org.apache.tools.ant.types.selectors.OrSelector selector) voidaddPresent(org.apache.tools.ant.types.selectors.PresentSelector selector) voidaddSelector(org.apache.tools.ant.types.selectors.SelectSelector selector) voidaddSize(org.apache.tools.ant.types.selectors.SizeSelector selector) org.apache.tools.ant.types.PathAdds a path to the classpath.org.apache.tools.ant.types.PatternSet.NameEntryorg.apache.tools.ant.types.PatternSet.NameEntryorg.apache.tools.ant.types.PatternSet.NameEntryorg.apache.tools.ant.types.PatternSet.NameEntryorg.apache.tools.ant.types.PatternSetvoidexecute()Executes the task.booleanGets the value of the "applet" property.org.apache.tools.ant.types.PathGets the classpath to be used for this compilation.Gets the destination directory into which the Kawa source files should be compiled.booleanGets the failonerror flag.File[]Gets the list of files to be compiled.booleanGets the value of the fulltailcalls property.Gets the language.booleanGet the listfiles flag.booleangetMain()Gets the value of the "main" property.Gets the value of the modulestatic property.Gets the prefixbooleanGets the value of the "servlet" property.org.apache.tools.ant.types.PathGets the source dirs to find the source Kawa files.Gets the target VM that the classes will be compiled for.booleanGet the result of the kawac task (success or failure).booleanGets the value of the warnaserror property.booleanGets the value of the warnundefinedvariable property.booleanGet the value of the includeDestClasses property.voidsetApplet(boolean applet) If true, then Kawa will generate an applet.voidsetCaseSensitive(boolean isCaseSensitive) voidsetClasspath(org.apache.tools.ant.types.Path classpath) Set the classpath to be used for this compilation.voidsetClasspathRef(org.apache.tools.ant.types.Reference r) Adds a reference to a classpath defined elsewhere.voidsetDefaultexcludes(boolean useDefaultExcludes) voidsetDestdir(File destDir) Set the destination directory into which the Kawa source files should be compiled.voidsetErrorProperty(String errorProperty) The property to set on compilation failure.voidsetExcludes(String excludes) voidsetExcludesfile(File excludesfile) voidsetFailonerror(boolean fail) Indicates whether the build will continue even if there are compilation errors; defaults to true.voidsetFollowSymlinks(boolean followSymlinks) voidsetFulltailcalls(boolean tailcalls) If true, Kawa will use full tailcalls.voidsetIncludeDestClasses(boolean includeDestClasses) This property controls whether to include the destination classes directory in the classpath given to the compiler.voidsetIncludes(String includes) voidsetIncludesfile(File includesfile) voidsetLanguage(String lang) Sets the language to use: "scheme", "commonlisp", or "elisp".voidsetListfiles(boolean list) If true, list the source files being handed off to the compiler.voidsetMain(boolean main) If true, then Kawa will create a static main method.voidsetModulestatic(String moduleStatic) Passes the --module-static or --module-static-run flag.voidSets the prefix.voidsetServlet(boolean servlet) If true, then Kawa will generate a servlet.voidsetSrcdir(org.apache.tools.ant.types.Path srcDir) Set the source directories to find the source Kawa files.voidSets the target VM that the classes will be compiled for.voidsetUpdatedProperty(String updatedProperty) The property to set on compilation success.voidsetWarnaserror(boolean warnaserror) Passes the --warn-as-error flag if true.voidsetWarnundefinedvariable(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, XsetItemsMethods 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, setTaskTypeMethods 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:
createIncludein classorg.apache.tools.ant.taskdefs.MatchingTask
-
createIncludesFile
public org.apache.tools.ant.types.PatternSet.NameEntry createIncludesFile()- Overrides:
createIncludesFilein classorg.apache.tools.ant.taskdefs.MatchingTask
-
createExclude
public org.apache.tools.ant.types.PatternSet.NameEntry createExclude()- Overrides:
createExcludein classorg.apache.tools.ant.taskdefs.MatchingTask
-
createExcludesFile
public org.apache.tools.ant.types.PatternSet.NameEntry createExcludesFile()- Overrides:
createExcludesFilein classorg.apache.tools.ant.taskdefs.MatchingTask
-
createPatternSet
public org.apache.tools.ant.types.PatternSet createPatternSet()- Overrides:
createPatternSetin classorg.apache.tools.ant.taskdefs.MatchingTask
-
setIncludes
- Overrides:
setIncludesin classorg.apache.tools.ant.taskdefs.MatchingTask
-
setExcludes
- Overrides:
setExcludesin classorg.apache.tools.ant.taskdefs.MatchingTask
-
setDefaultexcludes
public void setDefaultexcludes(boolean useDefaultExcludes) - Overrides:
setDefaultexcludesin classorg.apache.tools.ant.taskdefs.MatchingTask
-
setIncludesfile
- Overrides:
setIncludesfilein classorg.apache.tools.ant.taskdefs.MatchingTask
-
setExcludesfile
- Overrides:
setExcludesfilein classorg.apache.tools.ant.taskdefs.MatchingTask
-
setCaseSensitive
public void setCaseSensitive(boolean isCaseSensitive) - Overrides:
setCaseSensitivein classorg.apache.tools.ant.taskdefs.MatchingTask
-
setFollowSymlinks
public void setFollowSymlinks(boolean followSymlinks) - Overrides:
setFollowSymlinksin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addSelector
public void addSelector(org.apache.tools.ant.types.selectors.SelectSelector selector) - Specified by:
addSelectorin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addSelectorin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addAnd
public void addAnd(org.apache.tools.ant.types.selectors.AndSelector selector) - Specified by:
addAndin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addAndin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addOr
public void addOr(org.apache.tools.ant.types.selectors.OrSelector selector) - Specified by:
addOrin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addOrin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addNot
public void addNot(org.apache.tools.ant.types.selectors.NotSelector selector) - Specified by:
addNotin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addNotin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addNone
public void addNone(org.apache.tools.ant.types.selectors.NoneSelector selector) - Specified by:
addNonein interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addNonein classorg.apache.tools.ant.taskdefs.MatchingTask
-
addMajority
public void addMajority(org.apache.tools.ant.types.selectors.MajoritySelector selector) - Specified by:
addMajorityin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addMajorityin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addDate
public void addDate(org.apache.tools.ant.types.selectors.DateSelector selector) - Specified by:
addDatein interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addDatein classorg.apache.tools.ant.taskdefs.MatchingTask
-
addSize
public void addSize(org.apache.tools.ant.types.selectors.SizeSelector selector) - Specified by:
addSizein interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addSizein classorg.apache.tools.ant.taskdefs.MatchingTask
-
addFilename
public void addFilename(org.apache.tools.ant.types.selectors.FilenameSelector selector) - Specified by:
addFilenamein interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addFilenamein classorg.apache.tools.ant.taskdefs.MatchingTask
-
addCustom
public void addCustom(org.apache.tools.ant.types.selectors.ExtendSelector selector) - Specified by:
addCustomin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addCustomin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addContains
public void addContains(org.apache.tools.ant.types.selectors.ContainsSelector selector) - Specified by:
addContainsin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addContainsin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addPresent
public void addPresent(org.apache.tools.ant.types.selectors.PresentSelector selector) - Specified by:
addPresentin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addPresentin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addDepth
public void addDepth(org.apache.tools.ant.types.selectors.DepthSelector selector) - Specified by:
addDepthin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addDepthin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addDepend
public void addDepend(org.apache.tools.ant.types.selectors.DependSelector selector) - Specified by:
addDependin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addDependin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addContainsRegexp
public void addContainsRegexp(org.apache.tools.ant.types.selectors.ContainsRegexpSelector selector) - Specified by:
addContainsRegexpin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addContainsRegexpin classorg.apache.tools.ant.taskdefs.MatchingTask
-
addModified
public void addModified(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector selector) - Specified by:
addModifiedin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addModifiedin classorg.apache.tools.ant.taskdefs.MatchingTask
-
add
public void add(org.apache.tools.ant.types.selectors.FileSelector selector) - Specified by:
addin interfaceorg.apache.tools.ant.types.selectors.SelectorContainer- Overrides:
addin 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:
executein 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
-