• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

passing arguments to ant

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,

I want to call a target from an other antfile (using <ant ...> , but I also want to add arguments to ant . (And I don't want to use exec).
So my Question
*Is there a way to call an ant target from an other build.file by using ant, and adding command line values to ant? *

I tried it that way, but it doesn't work.



I would like to call the target from the buildfile build.xml, with logging .
 
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In order to pass command line args, you would have to start another JVM. The ant task doesn't do this. The property tag, as you specified it, passes a specific property (i.e. environment variable) into the ant call to be executed.

In order to do what you are trying to do, you probably need to use the ant exec task and invoke ant that way.

@see http://ant.apache.org/manual/CoreTasks/exec.html
 
Daniel Beck
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I solved it using the exec file, but I find that very ugly. Is it not possible to use <antcall>, and pass the parameters as Properties ?
 
I'd appreciate it if you pronounced my name correctly. Pinhead, with a silent "H". Petite ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic