Here is some information about how we use ANT at my workplace. The company I work at was kind enough to let me present this information here as I wanted to try to provide some information back to help other people using these great tools that are, mostly, created and maintained by volunteers. This is just one way to do things; it is tied to my work environment and not meant to be a general "one size fits all" resource, but hopefully a good place for some ideas. Also, it's good to describe it as documentation for the future and to make things clear for myself anyway :)
To use any of the common tasks, you need to set some properties at the start of each build file (either in the build file or in an included properties file).
The most common and important ones are:
vob.root - the clearcase vob directory that your project is using; eg: /vob_myproject (no drive letter is used as this is figured out by the scripts and Unix style path separators are used)
script.root.dir - common ant scripts directory; eg: Z:/vob_devtools/ant/scripts
common.build - common build file to use; eg: ${script.root.dir}/common-build.xml
root.dir - the root directory for the location of this projects WSAD projects; eg: ${vob.root}/ (note that this often the same as root.dir with UCM based projects but this property must still be set - a BaseCC project might have it set to: ${vob.root}/myproject/src/Java_sources/
ext.jaxb.home - the location of the JAXB that you are using; eg: Z:/vob_devtools/jaxb
project.report.dir - where any reports for this project are written to; eg: C:/Temp/reports/myproject (directories are created under this by the scripts for each report)
cc.workspace.project - the name of any project within your workspace that is on the drive that your projects are coming from. This is used by a task that figures out which drive letter to use and replace on certain properties that require full path names as UCM mounted drives can be on any drive letter; eg: ${ear.project.name} (which could be set to "MyProject")
There are also other properties which may need to be set before calling some targets in the common build scripts, please take a look over the Common Build Targets for a description of what each target available does and what the required properties are.
Remember that, with ANT, when you set a property its value doesn't change. This means that default properties can be set in the common scripts and overridden by the project scripts.
NOTE: the 'java' and 'javadoc' executables must be in your system path environment
3rd Party Tasks
PMD - static code analysis FindBugs - compiled code analysis JUnit - junit test runner Clover - code coverage for junit run tests JavaNCSS - source code metrics JDepend - show code dependencies XMLTask - XML handling
Some Common ANT Tasks
These tasks have been written to provide helpful utilities through ANT (also within WSAD).
ClasspathTask - obtain a simple WSAD projects classpath ApplyDriveLetterTask - obtains the current drive letter of where the project exists and updates/prefixes the given property value with this J2EEClasspathTask - obtain the classpath from a WSAD project in a J2EE application. This will also get the output directory of any referenced project as well JDependHelperTask - help modify GraphViz output to produce a graphical dependency diagram of the components ListAllJavaFilesTask - produce a listing of all of the Java files in a workspace NNTPTask - send a message to a news server using NNTP SerialVerTask - create a serialVersionUID for a class
The Java source files for these tasks can be downloaded here
Last Updated Tuesday, January 24 2006 @ 04:43 AM CST; 1,981 Hits
IRC Hacks
I am a contributor to the IRC Hacks book released by O'Reilly in 2004. I wrote a few of the hacks, some of which were about my own software - 2 about PPF and 1 about MatchEd.