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

Ever feel like no one is listening?

 Ever have that feeling that no one is listening to you? Yeah, that feeling. It can be a strong feeling to have, a hurtful feeling also. The...