If you add a "target" attribute to the <ant> task that's a property, you
could define it on the command line. (Set it in the top-level build-file
to the name of the default target for the sub-project build-file, so it's
guaranteed to be defined even if you don't define it on the command line.)
Diane
--- Ryan Schutt <[EMAIL PROTECTED]> wrote:
> I can't do that.. I have a project, and a subproject that is run from
> the project. I want to be able to run the subproject with a conditional
> target. Let me illustrate with snippets from my build files..
>
> build.xml:
>
> ...
> <target name="UpdateDatabase">
> <ant antfile="UpdateDatabase.xml" dir="misc/crons/database"/>
> </target>
> ...
>
> So when I run "ant UpdateDatabase", it executes the subproject from
> UpdateDatabase.xml. I *could* add a target attribute to the <ant> tag,
> but my goal is to select a target conditionally at runtime.. ie, I don't
> want to have to edit build.xml each time I want a different target for
> the subproject. Make sense?
>
>
>
> ----- Original Message -----
> From: "Kevin Cummings" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 04, 2001 4:36 PM
> Subject: Re: conditionally execute a target
>
>
> > Use ant <TargetName>
> >
> > HTH,
> > -- Kevin
> >
> > At 04:32 PM 4/4/2001 -0400, you wrote:
> > >The way ant currently works, you set the default target, and when you
> build
> > >without specifying a target, ant will run the default target. What
> I'd
> like
> > >to do is conditionally execute a target at runtime, instead of
> executing
> the
> > >default target all the time. Is there anyway to do this?
> >
>
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/