ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean LeBlanc" <s...@nutros.com>
Subject RE: Best way to force an "arg"
Date Fri, 26 Jul 2002 13:47:22 GMT


> -----Original Message-----
> From: Diane Holt [mailto:holtdl@yahoo.com]
> Sent: Thursday, July 25, 2002 4:01 PM
> To: Ant Users List; sean@nutros.com
> Subject: Re: Best way to force an "arg"
> 
> 
> --- Sean LeBlanc <sean@nutros.com> 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:
>   http://marc.theaimsgroup.com/?l=ant-user&m=101364053529833&w=2
>  
> > 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
> Ant1.5.

That would explain things...I'm using 1.4.x. The way I'm using fail with the "arg"
is because it's not really an arg per se - it's another target, but I
want to make one of two choice required as the first target given. The
"arg"(target) is for building development vs. stable versions of the code. 

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message