• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ant Basic Doubt

 
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From a tutorial

Let's create another build file and examine some common command line options in ant. Copy the following lines into a file named "echo.xml".



Execute ant using:

* -f echo.xml to specify "echo.xml" as the build file
* goodbye to specify "goodbye" as the target rather than the default


Question:

My Ant directory is in C drive. with ant batch file in "C:\ant\bin"
As told in the tutorial I saved this xml as "echo.xml" in "C:\ant\bin" and I didn't understand this part.




Execute ant using:

* -f echo.xml to specify "echo.xml" as the build file
* goodbye to specify "goodbye" as the target rather than the default



Actually where should I include this [ -f echo.xml ]. Should I include this in the ant batch file.

One more doubt is How to store these xml files in different folders and execute the ant batch file without errors. I tried by putting a xml file in another folder and got error when executed the ant batch file as

C:\ant\bin>
Buildfile: build.xml does not exist!
Build failed

Some one please help me.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Execute ant using:

* -f echo.xml to specify "echo.xml" as the build file
* goodbye to specify "goodbye" as the target rather than the default



That refers to command line options.
The -f switch lets you specify the build file to be used; if you omit it, Ant defaults to using "build.xml" , and will complain if it doesn't exist.
The other parameter is the target to be executed. You have two, hello and goodbye. If you omit it, the default is "hello", because that is specified in the <project> element. (The Ant manual talks about all of this in detail.)
So what you might type in is as follows:
ant -f echo.xml
ant -f echo.xml goodbye

As an aside, you should not store any build files in the bin directory. Add the bin directory to your PATH, so that you can access ant from any directory.
[ July 25, 2005: Message edited by: Ulf Dittmer ]
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That worked

thank u very much




 
reply
    Bookmark Topic Watch Topic
  • New Topic