Using ANT from Eclipse
I have recently taken the plunge into ANT for use in deployment and doing some mundane tasks, and since I use Eclipse I have been playing with the integrated version that comes bundled.
There were a few things that are not very well documented (or I could not find) that took me a while to figure out, so I though I would share.
Running an ANT task can be done from within Eclipse very easily. Eclipse recognises an ANT file as long as its called "build.xml". You can then right click on the file and hit "Run As" > "Ant Build". Eclipse will then execute it and push any output to the console (Window > Show View > Other > General > Console).
An ANT build.xml file takes the following basic structure:
<project default="hello">
<target name="hello">
<echo message="hello world" />
</target>
</project>
You can set variables in an external file called build.properties, for example:
# project defaults
# ----------------------------------------
projectName=temprepo
projectURL=http://www.sixfive.co.uk
You can also build up variable on-the-fly, here I have set up a build directory using the projectName
That is it for my quick primer to ANT, I will check out some more features in the coming days.


There are no comments for this entry.
[Add Comment]