ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Hermann <>
Subject RE: conditionally execute a target
Date Wed, 04 Apr 2001 20:54:51 GMT
i don't know that i completely understand your problem, but couldn't you
parameterize your ant call like:

<ant antfile="${subproject}"...>

and set that property ahead of time, perhaps on the commandline?


-----Original Message-----
From: Ryan Schutt []
Sent: Wednesday, April 04, 2001 3:44 PM
Subject: Re: conditionally execute a target

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..


  <target name="UpdateDatabase">
    <ant antfile="UpdateDatabase.xml" dir="misc/crons/database"/>

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" <>
To: <>
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
> >without specifying a target, ant will run the default target.  What I'd
> >to do is conditionally execute a target at runtime, instead of executing
> >default target all the time.  Is there anyway to do this?

View raw message