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:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
set ANT_HOME=c:\ant
set JAVA_HOME=c:\jdk-1.5.0.05
set PATH=%PATH%;%ANT_HOME%\bin
1set ANT_HOME=c:\ant
2set JAVA_HOME=c:\jdk-1.5.0.05
3set 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:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
export ANT_HOME=/usr/local/ant
export PATH=${PATH}:${ANT_HOME}/bin
1export ANT_HOME=/usr/local/ant
2export PATH=${PATH}:${ANT_HOME}/bin
Now open up the Terminal(Mac)/Command line(Win) and just type "ANT" and hit return. You should see:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
Buildfile: build.xml does not exist!
Build failed
1Buildfile: build.xml does not exist!
2Build 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
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
<?xml version="1.0" encoding="UTF-8"?>
<project name="myProject" default="runEcho" basedir=".">
<target name="runEcho">
<!-- Simply echo's a message to the screen -->
<echo message="Is anybody out there"/>
</target>
</project>
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
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
ant -buildfile c:\build.xml
1ant -buildfile c:\build.xml
If you are on Mac then just save this to the desktop and from the Terminal run:
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
ant -buildfile ~/desktop/build.xml
1ant -buildfile ~/desktop/build.xml
You should now see
ColdFISH is developed by Jason Delmore. Source code and license information available at coldfish.riaforge.org
Buildfile: {PATH_TO_YOU_BUILD_FILE}build.xml
runEcho:
[echo] Is anybody out there
BUILD SUCCESSFUL
Total time: 0 seconds
1Buildfile: {PATH_TO_YOU_BUILD_FILE}build.xml
2
3runEcho:
4[echo] Is anybody out there
5
6BUILD SUCCESSFUL
7Total 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!
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
I have installed ant 1.8.1 on my Windows XP and set the path varieable to the bin folder of ant.
But, when i typed 'ant' in command line i am getting this error messaeg-
'ant' is not recognized as an internal or external command,
operable program or batch file.
Can you please help me in this ?