ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: Best way to force an "arg"
Date Thu, 25 Jul 2002 22:01:23 GMT
--- Sean LeBlanc <> wrote:
> What I want to do is to force at least one "arg" to be present, so
> I can define a branch of things to happen. What's the cleanest way
> to do this?
> I want something like:
> ant (foo|bar) <other targets...>
> but I want the build to exit if foo or bar do not exist on the command
> line.

You'd need to have either a .antrc (if you're *nix-based) file in
everyone's $HOME (or modify the 'ant' script to look for an rc file in
some more generalized location) that verifies the 'ant' command line, or
you'd need to either modify the script to do the verification, or put a
wrapper on top of the Ant wrapper script. As an example of an rc file that
does arg verification, see:
> I've tried some things (they didn't seem very elegant to me), but I
> ended up having troubles with the <fail> task. It says that unless
> is not a supported attribute? What gives with this?

I'm not sure how you'd be using <fail> to deal with command-line args in
the first place, but as to the error, if/unless for <fail> is new to



Do You Yahoo!?
Yahoo! Health - Feel better, live better

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message