Sunday, November 27, 2016

Apache Ant

Apache Ant is a software tool for automating software build processes. It is similar to Make but is implemented using the Java language, requires the Java platform, and is best suited to building Java projects.
The most immediately noticeable difference between Ant and Make is that Ant uses XML to describe the build process and its dependencies, whereas Make uses Makefile format. By default the XML file is named build.xml

Sample build.xml file

Below is listed a sample build.xml file for a simple Java "Hello, world" application. It defines four targets - cleanclobbercompile and jar, each of which has an associated description. The jar target lists the compile target as a dependency. This tells Ant that before it can start the jar target it must first complete the compile target.
 version="1.0"?>
name="Hello" default="compile">
name="clean" description="remove intermediate files">
dir="classes"/>
> name="clobber" depends="clean" description="remove all artifact files"> file="hello.jar"/> > name="compile" description="compile the Java source code to class files"> dir="classes"/> srcdir="." destdir="classes"/> > name="jar" depends="compile" description="create a Jar file for the application"> destfile="hello.jar"> dir="classes" includes="**/*.class"/> > name="Main-Class" value="HelloProgram"/> > > > >
Commands :

rm -rf classes/
rm is a Unix-specific command unavailable in some other environments. 

Microsoft Windows, for example, would use:
rmdir /S /Q classes

No comments:

Post a Comment

உப்பு மாங்காய்

சுருக்குப்பை கிழவி. சுருக்கங்கள் சூழ் கிழவி. பார்க்கும் போதெல்லாம் கூடையுடனே குடியிருப்பாள். கூடை நிறைய குட்டி குட்டி மாங்காய்கள். வெட்டிக்க...