Tuesday, January 24, 2012

Ant - Hello World

Usually you wouldn't ever use a hello world example in Ant. Outputting text isn't really the goal of the thing. But this will give you a chance to see how to run an ant build.



So, open up a text editor and save the following as build.xml.




<project name="HelloWorld">

<target name="sayhello">
<echo>Hello World!</echo>
</target>
</project>


You would then run the program as:

ant sayhello


As you might expect, it simply says Hello World!



Echo messages are useful to track the process of an Ant Task when it's going through specific procedures that you specify.

No comments:

Post a Comment

No Sleep

 This is the second day I've woken up early. Like way earlier than normal. Like four am early. I don't know what to do about it. I n...