-
Notifications
You must be signed in to change notification settings - Fork 1
Using ant
Ant is a command line tool like make
.
The basic commands are:
-
ant
- This will execute the default target inside build.xml -
ant -f other.xml
- The -f argument selects the buildfile (build.xml is the default otherwise) -
ant -p
- The -p trigger will show you all available targets -
ant targetName
- This will run the target namedtargetName
You can combine the parameters as you need.
Every project has its own build.xml with the following targets
$ ant -p
Buildfile: /home/frank/swp-compiler/fuc/code/ast/build.xml
Main targets:
build compile source code
build-test compile the JUnit test classes
clean clean compiled classes from ${bin.dir} and javadoc from ${doc.dir}
doc generate the javadoc documentation
run generate javadoc and run all tests
run-test run the JUnit test classes
Default target: run
If you omit the target, run
is always the default target.
Ant will resolve dependencies automatically. E.g. if run-tests depends on build-test ant will automatically run build-test when you choose the target run-test.
Ant needs to know your project dependencies to use the correct class path when compiling your sources. At the moment every component lists the interfaces
as a dependencies. If you need more dependencies they need to be added to the ant file. If you know how to do this feel free to edit your ant file. Otherwise just ask for help.
Ant is a command line tool and intended to be run from your console. Though ant is also integrated into eclipse IDE and can be executed directly from eclipse.
Open the build.xml file in your eclipse project. Select run as Ant Build
to execute the default target run
. If you want to execute another target, right click it in the Outline View and select run as Ant Build
.