ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Schutt <>
Subject Re: conditionally execute a target
Date Wed, 04 Apr 2001 20:44:28 GMT
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