ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Determine target's name
Date Tue, 26 Feb 2002 12:07:39 GMT
On Tue, 26 Feb 2002, Matthew Helliwell <Matthew.Helliwell@DRKW.com>
wrote:

> I've wanted to use it when using a target to specify a prod/uat/dev
> build. I wanted to be able to type 'ant PROD'. It then picks up the
> appropriate properties file based on the target (eg
> 'PROD.properties').

If you load these properties inside the target, the name already is
predetermined, if you do so in a common target the others depend upon,
you could do something like

<target name="PROD">
  <antcall target="real-target">
    <param name="target.name" value="PROD" />
  </antcall>
</target>

and similar for uat or dev.

> I ended up using an explicit property, eg 'ant -Dtarget.name=PROD'

This is the way I would go, yes.  But then again, I prefer things to
be explicit 8-)

Stefan

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