Installing ANT on Windows and or Mac OS X
I'm gonna try and cover the two OS's here so be kind.
First things first, goto http://ant.apache.org/bindownload.cgi and download the appropriate archive (zip) file: apache-ant-[VERSION NUMBER HERE]-bin.zip
Then for Windows: Extract the .zip to c:\ant. From the command line set the following environment variables:1 set ANT_HOME=c:\ant
2 set JAVA_HOME=c:\jdk-1.5.0.05
3 set PATH=%PATH%;%ANT_HOME%\bin
For Mac: Unpack the zip file to /usr/local/ant/. Then from the command line set the following environment variables:
2 set JAVA_HOME=c:\jdk-1.5.0.05
3 set PATH=%PATH%;%ANT_HOME%\bin
1 export ANT_HOME=/usr/local/ant
2 export PATH=${PATH}:${ANT_HOME}/bin
Now open up the Terminal(Mac)/Command line(Win) and just type "ANT" and hit return. You should see:
2 export PATH=${PATH}:${ANT_HOME}/bin
1 Buildfile: build.xml does not exist!
2 Build failed
To demonstrate calling a file we're gonna create a quick build.xml. Create a new text file, enter the following bit of XML and save it as build.xml
2 Build failed
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="myProject" default="runEcho" basedir=".">
3 <target name="runEcho">
4 <!-- Simply echo's a message to the screen -->
5 <echo message="Is anybody out there"/>
6 </target>
7 </project>
If you are on Windows save this file to the root of c:\ and from the command line run the following
2 <project name="myProject" default="runEcho" basedir=".">
3 <target name="runEcho">
4 <!-- Simply echo's a message to the screen -->
5 <echo message="Is anybody out there"/>
6 </target>
7 </project>
1 ant -buildfile c:\build.xml
If you are on Mac then just save this to the desktop and from the Terminal run:
1 ant -buildfile ~/desktop/build.xml
You should now see
1 Buildfile: {PATH_TO_YOU_BUILD_FILE}build.xml
2
3 runEcho:
4 [echo] Is anybody out there
5
6 BUILD SUCCESSFUL
7 Total time: 0 seconds
That's pretty much it, from here you you are now set to run Ant from the Terminal/Command line so in theory you should be able to schedule tasks etc!
2
3 runEcho:
4 [echo] Is anybody out there
5
6 BUILD SUCCESSFUL
7 Total time: 0 seconds
TweetBacks
http://www.microsoft.com/msagent/default.asp
http://www.andyjarrett.co.uk/andy/blog/index.cfm/2...
danke
I hope it's useful, and let me know if you'd like to develop it further.
Really Helped me.. someone new to ANT.
Cheers !!!
Sriram