ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <>
Subject Re: Re[2]: loading before other properties when it does n't exist before building ...
Date Tue, 10 Sep 2002 01:58:26 GMT
Why bother with all that file copying? :-) Just do:

<property file=""/>
<property file=""/>

If doesn't exist it wont be loaded; if it does exist the
properties it contains will override those in Now
the user simply adds only those properties they want to override to their


On 9/9/02 6:05 PM, "Jacob Kjome" <> wrote:

> Hello Dominique,
> Thanks for the suggestion, but that solution misses the point.  If we
> just had it stored as "" so that it always existed it
> would achieve the same thing as the entity include stuff you are
> talking about so that doesn't seem to approach my hopeful solution.  I
> actually am using the entity include for Tomcat Ant Manager tasks and
> it works pretty slick :-)
> But the point of the is that each person may
> have their own.  Each person can add/change/remove properties from
> their own copy of but we always want to have a
> reference available for the standard stuff that goes in
> hence the copy from sample.* to * only if * doesn't
> exist.
> Sounds like I'm going to have to forgo the sample. stuff for
>  Works fine for everything else because we can
> guarantee that the other files will be copied from sample.* to *
> before they are needed by the build.  There just isn't a good way to
> do that will
> BTW, is the <import> tag that you mention available in Ant-1.5.1beta1?
> I thought that was only going to be Ant2 functionality?
> Jake
> Monday, September 09, 2002, 4:41:21 PM, you wrote:
> DD> Sounds to me that you should maybe avoid this kind of trouble by using
> DD> entity include instead of your <copy> of sample files... That way, you can
> DD> have a properly named project whose entire body is empty but for the
> entity
> DD> reference. Pretty much achieve what you do with <copy>, without the
> trouble
> DD> you're running into with properties. Check out the Ant FAQ for details on
> DD> entity including an XML fragment file.
> DD> You could also go with the embed proposal (that defines an <import> tag),
> DD> but that's a little more on the bleeding edge. --DD
> DD> -----Original Message-----
> DD> From: Jacob Kjome []
> DD> Sent: Monday, September 09, 2002 4:29 PM
> DD> To: Ant Users List
> DD> Subject: loading before other properties when it doesn't
> DD> exist before building ...
> DD> Hi,
> DD> I have a project where we have sample files such as sample.web.xml or
> DD>  I copy these files to a file of the same
> DD> name minus the ".sample" prefix.  That is all working fine.  The
> DD> problem is with the unique case of
> DD> Normally, I load first thing before defining other
> DD> properties so that properties in the build file can be overridden by
> DD> those in  However, the target that runs the copy of
> DD> to runs *after* all the
> DD> properties would have been defined.  So, with a fresh CVS tree,
> DD> running ant for the first time on my build file fails to load
> DD> properties from because it does not exist yet.
> DD> Now, I would put the <copy> deal before
> DD> <property file=""/>
> DD> but the latter needs to be before all the properties are defined which
> DD> aren't inside a target.  Since I can't put <copy> anywhere outside a
> DD> <target> element, I can't make the copy happen before the rest of the
> DD> properties are defined.
> DD> Is there a good way to deal with this situation other than, maybe,
> DD> putting all the <property ...> definitions inside a <target ...>
> DD> element, thereby allowing me to run the <copy ...> task to copy the
> DD> to then load it, then define
> DD> all the other propeprties?
> DD> Jake

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message