The below tutorial is for all learners who want to write a simple ant build file.
first identify what you want to build, either .jar or .war . In my below tutorial I am putting down steps for creating a .war file using ant script.
build.xm-- for creating .war file.
create a build.xml file in eclipse and you can run build.xml file using eclipse as run as -- ant build.
But I dont suggest to depend on a tool , even though i like Eclipse . Try to down ant and set ant_home in the environment variables and run from the command prompt.
Now place below contents in the kdevaraBuild.properties . Before that create a file with what ever name you want and append .properties.