Class Gosuc

  • All Implemented Interfaces:
    Cloneable, org.apache.tools.ant.types.selectors.SelectorContainer

    public class Gosuc
    extends GosuMatchingTask
    Ant task for compiling Gosu files to disk.

    The following parameters are available:

    • "srcdir" : A Path containing one or more source directories
    • "destdir" : A File representing the output destination of the compilation
    • "checkedarithmetic" : Compile with checked arithmetic if true. Defaults to false.
    • "failonerror" : Ignore compile errors and continue if true. Defaults to true.
    • "projectname" : Outputs this value in the compilation complete message. Defaults to the empty string.
    • "additionalscriptextensions" : Comma-separated list of additional file extensions to compile. Normally not required.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected List<File> compileList  
      • 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

      Constructors 
      Constructor Description
      Gosuc()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.tools.ant.types.Path createClasspath()
      Adds a path to the classpath.
      org.apache.tools.ant.types.Path createSrc()
      Adds a path for source compilation.
      void execute()
      Executes the task.
      File getDestdir()
      Gets the destination directory into which the Gosu source files should be compiled.
      boolean getFailOnError()
      Gets the FailOnError flag.
      List<File> getFileList()
      Gets the list of files to be compiled.
      String getProjectName()
      Gets the optional Project Name.
      This has no impact on the compilation; simply outputs this value in the compilation complete message.
      org.apache.tools.ant.types.Path getSrcdir()
      Gets the source dirs to find the source Gosu files.
      boolean isCheckedArithmetic()  
      boolean isForce()
      Gets the Force flag.
      ant's directory scanner is timestamp based.
      protected org.apache.tools.ant.types.Path recreateSrc()
      Recreate src.
      protected void scanDir​(File srcDir, File destDir, String[] files)
      Scans the directory looking for source files to be compiled.
      void setAdditionalScriptExtensions​(String extensions)  
      void setCheckedArithmetic​(boolean checkedArithmetic)  
      void setClasspathRef​(org.apache.tools.ant.types.Reference ref)
      Adds a reference to a classpath defined elsewhere.
      void setDestdir​(File destDir)
      Set the destination directory into which the Gosu source files should be compiled.
      void setFailOnError​(boolean fail)
      Indicates whether the build will continue even if there are compilation errors; defaults to true.
      void setForce​(boolean force)  
      void setProjectName​(String projectName)  
      void setSrcdir​(org.apache.tools.ant.types.Path srcDir)
      Set the source directories to find the source Gosu files.
      • 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
    • Field Detail

      • compileList

        protected List<File> compileList
    • Constructor Detail

      • Gosuc

        public Gosuc()
    • Method Detail

      • createSrc

        public org.apache.tools.ant.types.Path createSrc()
        Adds a path for source compilation.
        Returns:
        a nested src element.
      • recreateSrc

        protected org.apache.tools.ant.types.Path recreateSrc()
        Recreate src.
        Returns:
        a nested src element.
      • setSrcdir

        public void setSrcdir​(org.apache.tools.ant.types.Path srcDir)
        Set the source directories to find the source Gosu 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 Gosu files.
        Returns:
        the source directories as a path
      • setDestdir

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

        public File getDestdir()
        Gets the destination directory into which the Gosu source files should be compiled.
        Returns:
        the destination directory
      • createClasspath

        public org.apache.tools.ant.types.Path createClasspath()
        Adds a path to the classpath.
        Returns:
        a classpath to be configured
      • setClasspathRef

        public void setClasspathRef​(org.apache.tools.ant.types.Reference ref)
        Adds a reference to a classpath defined elsewhere.
        Parameters:
        ref - a reference to a classpath
      • setAdditionalScriptExtensions

        public void setAdditionalScriptExtensions​(String extensions)
        Parameters:
        extensions - Additional extensions to compile; for example "grs, gr"
      • 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
      • isCheckedArithmetic

        public boolean isCheckedArithmetic()
      • setCheckedArithmetic

        public void setCheckedArithmetic​(boolean checkedArithmetic)
      • isForce

        public boolean isForce()
        Gets the Force flag.
        ant's directory scanner is timestamp based. Without proper tasks, this could result in successful, but incomplete compilation.
        Therefore we default 'force' to true, which causes compilation of all matching source files, regardless of the timestamp comparison between source and target.
        Returns:
      • setForce

        public void setForce​(boolean force)
      • getProjectName

        public String getProjectName()
        Gets the optional Project Name.
        This has no impact on the compilation; simply outputs this value in the compilation complete message. Useful in large, multimodule builds with parallelization.
        Returns:
        ProjectName property; defaults to empty string.
      • setProjectName

        public void setProjectName​(String projectName)
      • scanDir

        protected void scanDir​(File srcDir,
                               File destDir,
                               String[] files)
        Scans the directory looking for source files to be compiled. The results are returned in the class variable compileList
        Parameters:
        srcDir - The source directory
        destDir - The destination directory
        files - An array of filenames
      • getFileList

        public List<File> getFileList()
        Gets the list of files to be compiled.
        Returns:
        the list of files
      • execute

        public void execute()
                     throws org.apache.tools.ant.BuildException
        Executes the task.
        Overrides:
        execute in class org.apache.tools.ant.Task
        Throws:
        org.apache.tools.ant.BuildException - if an error occurs