ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: loading build.properties before other properties when it does n't exist before building ...
Date Mon, 09 Sep 2002 21:41:21 GMT
Sounds to me that you should maybe avoid this kind of trouble by using
entity include instead of your <copy> of sample files... That way, you can
have a properly named project whose entire body is empty but for the entity
reference. Pretty much achieve what you do with <copy>, without the trouble
you're running into with properties. Check out the Ant FAQ for details on
entity including an XML fragment file.

You could also go with the embed proposal (that defines an <import> tag),
but that's a little more on the bleeding edge. --DD

-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com] 
Sent: Monday, September 09, 2002 4:29 PM
To: Ant Users List
Subject: loading build.properties before other properties when it doesn't
exist before building ...

Hi,

I have a project where we have sample files such as sample.web.xml or
sample.build.properties.  I copy these files to a file of the same
name minus the ".sample" prefix.  That is all working fine.  The
problem is with the unique case of build.properties.

Normally, I load buld.properties first thing before defining other
properties so that properties in the build file can be overridden by
those in build.properties.  However, the target that runs the copy of
sample.buld.properties to build.properties runs *after* all the
properties would have been defined.  So, with a fresh CVS tree,
running ant for the first time on my build file fails to load
properties from build.properties because it does not exist yet.

Now, I would put the <copy> deal before
<property file="build.properties"/>
but the latter needs to be before all the properties are defined which
aren't inside a target.  Since I can't put <copy> anywhere outside a
<target> element, I can't make the copy happen before the rest of the
properties are defined.

Is there a good way to deal with this situation other than, maybe,
putting all the <property ...> definitions inside a <target ...>
element, thereby allowing me to run the <copy ...> task to copy the
sample.build.properties to build.properties then load it, then define
all the other propeprties?

Jake

  

-- 
Best regards,
 Jacob                          mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

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