ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Hermann <dherm...@quickarrow.com>
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?

dan

-----Original Message-----
From: Ryan Schutt [mailto:rschutt@vt.edu]
Sent: Wednesday, April 04, 2001 3:44 PM
To: ant-user@jakarta.apache.org
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..

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" <kevin.cummings@mongoosetech.com>
To: <ant-user@jakarta.apache.org>
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?
>

Mime
View raw message