Package gnu.kawa.ant

Class 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
    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 and filelists 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 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 
      Constructor Description
      Kawac()
      Kawac task for compilation of Kawa files.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void 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 createClasspath()
      Adds a path to the classpath.
      org.apache.tools.ant.types.PatternSet.NameEntry createExclude()  
      org.apache.tools.ant.types.PatternSet.NameEntry createExcludesFile()  
      org.apache.tools.ant.types.PatternSet.NameEntry createInclude()  
      org.apache.tools.ant.types.PatternSet.NameEntry createIncludesFile()  
      org.apache.tools.ant.types.PatternSet createPatternSet()  
      void execute()
      Executes the task.
      boolean getApplet()
      Gets the value of the "applet" property.
      org.apache.tools.ant.types.Path getClasspath()
      Gets the classpath to be used for this compilation.
      File getDestdir()
      Gets the destination directory into which the Kawa source files should be compiled.
      boolean getFailonerror()
      Gets the failonerror flag.
      File[] getFileList()
      Gets the list of files to be compiled.
      boolean getFulltailcalls()
      Gets the value of the fulltailcalls property.
      String getLanguage()
      Gets the language.
      boolean getListfiles()
      Get the listfiles flag.
      boolean getMain()
      Gets the value of the "main" property.
      String getModulestatic()
      Gets the value of the modulestatic property.
      String getPrefix()
      Gets the prefix
      boolean getServlet()
      Gets the value of the "servlet" property.
      org.apache.tools.ant.types.Path getSrcdir()
      Gets the source dirs to find the source Kawa files.
      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​(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 setPrefix​(String prefix)
      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 setTarget​(String target)
      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 Detail

      • Kawac

        public Kawac()
        Kawac task for compilation of Kawa files.
    • Method Detail

      • 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

        public void setDestdir​(File destDir)
        Set the destination directory into which the Kawa source files should be compiled.
        Parameters:
        destDir - the destination directory
      • getDestdir

        public File 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

        public void setTarget​(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 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​(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​(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​(String prefix)
        Sets the prefix.
        Parameters:
        prefix - the prefix to use
      • getPrefix

        public 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​(String moduleStatic)
        Passes the --module-static or --module-static-run flag.
        Parameters:
        moduleStatic - the flag
      • getModulestatic

        public 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​(String lang)
        Sets the language to use: "scheme", "commonlisp", or "elisp".
        Parameters:
        lang - the language to use
      • getLanguage

        public String 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 class org.apache.tools.ant.taskdefs.MatchingTask
      • createIncludesFile

        public org.apache.tools.ant.types.PatternSet.NameEntry createIncludesFile()
        Overrides:
        createIncludesFile in class org.apache.tools.ant.taskdefs.MatchingTask
      • createExclude

        public org.apache.tools.ant.types.PatternSet.NameEntry createExclude()
        Overrides:
        createExclude in class org.apache.tools.ant.taskdefs.MatchingTask
      • createExcludesFile

        public org.apache.tools.ant.types.PatternSet.NameEntry createExcludesFile()
        Overrides:
        createExcludesFile in class org.apache.tools.ant.taskdefs.MatchingTask
      • createPatternSet

        public org.apache.tools.ant.types.PatternSet createPatternSet()
        Overrides:
        createPatternSet in class org.apache.tools.ant.taskdefs.MatchingTask
      • setIncludes

        public void setIncludes​(String includes)
        Overrides:
        setIncludes in class org.apache.tools.ant.taskdefs.MatchingTask
      • setExcludes

        public void setExcludes​(String excludes)
        Overrides:
        setExcludes in class org.apache.tools.ant.taskdefs.MatchingTask
      • setDefaultexcludes

        public void setDefaultexcludes​(boolean useDefaultExcludes)
        Overrides:
        setDefaultexcludes in class org.apache.tools.ant.taskdefs.MatchingTask
      • setIncludesfile

        public void setIncludesfile​(File includesfile)
        Overrides:
        setIncludesfile in class org.apache.tools.ant.taskdefs.MatchingTask
      • setExcludesfile

        public void setExcludesfile​(File excludesfile)
        Overrides:
        setExcludesfile in class org.apache.tools.ant.taskdefs.MatchingTask
      • setCaseSensitive

        public void setCaseSensitive​(boolean isCaseSensitive)
        Overrides:
        setCaseSensitive in class org.apache.tools.ant.taskdefs.MatchingTask
      • setFollowSymlinks

        public void setFollowSymlinks​(boolean followSymlinks)
        Overrides:
        setFollowSymlinks in class org.apache.tools.ant.taskdefs.MatchingTask
      • addSelector

        public void addSelector​(org.apache.tools.ant.types.selectors.SelectSelector selector)
        Specified by:
        addSelector in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addSelector in class org.apache.tools.ant.taskdefs.MatchingTask
      • addAnd

        public void addAnd​(org.apache.tools.ant.types.selectors.AndSelector selector)
        Specified by:
        addAnd in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addAnd in class org.apache.tools.ant.taskdefs.MatchingTask
      • addOr

        public void addOr​(org.apache.tools.ant.types.selectors.OrSelector selector)
        Specified by:
        addOr in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addOr in class org.apache.tools.ant.taskdefs.MatchingTask
      • addNot

        public void addNot​(org.apache.tools.ant.types.selectors.NotSelector selector)
        Specified by:
        addNot in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addNot in class org.apache.tools.ant.taskdefs.MatchingTask
      • addNone

        public void addNone​(org.apache.tools.ant.types.selectors.NoneSelector selector)
        Specified by:
        addNone in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addNone in class org.apache.tools.ant.taskdefs.MatchingTask
      • addMajority

        public void addMajority​(org.apache.tools.ant.types.selectors.MajoritySelector selector)
        Specified by:
        addMajority in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addMajority in class org.apache.tools.ant.taskdefs.MatchingTask
      • addDate

        public void addDate​(org.apache.tools.ant.types.selectors.DateSelector selector)
        Specified by:
        addDate in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addDate in class org.apache.tools.ant.taskdefs.MatchingTask
      • addSize

        public void addSize​(org.apache.tools.ant.types.selectors.SizeSelector selector)
        Specified by:
        addSize in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addSize in class org.apache.tools.ant.taskdefs.MatchingTask
      • addFilename

        public void addFilename​(org.apache.tools.ant.types.selectors.FilenameSelector selector)
        Specified by:
        addFilename in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addFilename in class org.apache.tools.ant.taskdefs.MatchingTask
      • addCustom

        public void addCustom​(org.apache.tools.ant.types.selectors.ExtendSelector selector)
        Specified by:
        addCustom in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addCustom in class org.apache.tools.ant.taskdefs.MatchingTask
      • addContains

        public void addContains​(org.apache.tools.ant.types.selectors.ContainsSelector selector)
        Specified by:
        addContains in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addContains in class org.apache.tools.ant.taskdefs.MatchingTask
      • addPresent

        public void addPresent​(org.apache.tools.ant.types.selectors.PresentSelector selector)
        Specified by:
        addPresent in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addPresent in class org.apache.tools.ant.taskdefs.MatchingTask
      • addDepth

        public void addDepth​(org.apache.tools.ant.types.selectors.DepthSelector selector)
        Specified by:
        addDepth in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addDepth in class org.apache.tools.ant.taskdefs.MatchingTask
      • addDepend

        public void addDepend​(org.apache.tools.ant.types.selectors.DependSelector selector)
        Specified by:
        addDepend in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addDepend in class org.apache.tools.ant.taskdefs.MatchingTask
      • addContainsRegexp

        public void addContainsRegexp​(org.apache.tools.ant.types.selectors.ContainsRegexpSelector selector)
        Specified by:
        addContainsRegexp in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addContainsRegexp in class org.apache.tools.ant.taskdefs.MatchingTask
      • addModified

        public void addModified​(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector selector)
        Specified by:
        addModified in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        addModified in class org.apache.tools.ant.taskdefs.MatchingTask
      • add

        public void add​(org.apache.tools.ant.types.selectors.FileSelector selector)
        Specified by:
        add in interface org.apache.tools.ant.types.selectors.SelectorContainer
        Overrides:
        add in class org.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.BuildException
        Executes the task. Throws BuildException if an error occurs
        Overrides:
        execute in class org.apache.tools.ant.Task
        Throws:
        org.apache.tools.ant.BuildException
      • getFileList

        public File[] getFileList()
        Gets the list of files to be compiled.
        Returns:
        the list of files as an array