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 - clean, clobber, compile 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"/>
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