Class AntExecutor


  • public class AntExecutor
    extends Object
    The AntExecutor class allows to execute ant tasks in a given build.xml file.
    • Constructor Detail

      • AntExecutor

        public AntExecutor​(String buildFile,
                           String baseDir)
                    throws Exception
        Initializes a newly created AntExecutor object assigning it the build.xml file to execute tasks from and the base directory where they will be executed.
        Parameters:
        buildFile - - Complete path to the build.xml file
        baseDir - - Complete path to the base directory
        Throws:
        Exception - - if an error occurs loading the xml file
      • AntExecutor

        public AntExecutor​(String buildDir)
                    throws Exception
        Initializes a new AntExecutor object assigning it the build.xml file in the directory passed as parameter, the base directory is the same as the one the build.xml is in.
        Parameters:
        buildDir - - Directory where is the build.xml file and that will be the base directory
        Throws:
        Exception - - if an error occurs loading the xml file
    • Method Detail

      • setProperty

        public void setProperty​(String property,
                                String value)
        Set a value to a property to the project.
        Parameters:
        property - - Property name
        value - - Value to assign
      • runTask

        public void runTask​(String _task)
                     throws Exception
        Executes an ant task
        Parameters:
        _task - - Name of the task to execute
        Throws:
        Exception - - In case the project is not loaded
      • runTask

        public void runTask​(Vector<String> tasks)
                     throws Exception
        Executes a set of ant tasks
        Parameters:
        tasks - - A Vector<String> with the names of the tasks to be executed
        Throws:
        Exception - - In case the project is not loaded