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:[EMAIL PROTECTED]] 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:[EMAIL PROTECTED] -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
