aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes passing a list of parameter from the command line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "passing a list of parameter from the command line" Watch "passing a list of parameter from the command line" New topic
Author

passing a list of parameter from the command line

Daniel Beck
Greenhorn

Joined: May 21, 2004
Posts: 12
Hello,

I have the following problem, and I don't know how to solve it elegantly in ant.

I need to pass to a JavaProgramm a list of strings, where each element of the lost has this form :
"grammar/xtdl/ne/${lang}/${lang}.spj" , where "lang" represents languages, and can have values like "de", "en" , "en_US", "it", and so on ...
Only the user knows how many elements to pass to that Java class.
And, I want the ant programm to be usuable. So the user of this ant programm should run ant like that:

ant install -Dlang=en:de:fr:cn
and I want the target to got call java de.util.SproutProjectToInstallPackage with argv="grammar/xtdl/en/en.spj grammar/xtdl/de/de.spj grammar/xtdl/fr/fr.spj grammar/xtdl/cn/cn.spj"
So my question:
How can I do that ?




Best regards<br />---> Daniel
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16141
    
  21

JavaScript


Customer surveys are for companies who didn't pay proper attention to begin with.
Daniel Beck
Greenhorn

Joined: May 21, 2004
Posts: 12
Hugh ? JavaScript ?
I do it for now so, that I use an xslt script to create a new ant-file on the fly - thought I don't think that this is beautifull. I would have liked to do it in ant, but I thing, this is not feasable.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing a list of parameter from the command line