Return-Path: Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 1452 invoked from network); 1 Dec 2000 08:46:53 -0000 Received: from bodewig.bost.de (root@195.227.98.11) by locus.apache.org with SMTP; 1 Dec 2000 08:46:53 -0000 Received: (from bodewig@localhost) by bodewig.bost.de (8.9.3/8.9.3) id JAA02445; Fri, 1 Dec 2000 09:46:52 +0100 X-Authentication-Warning: bodewig.bost.de: bodewig set sender to bodewig@apache.org using -f To: ant-user@jakarta.apache.org Subject: Re: How to share same properties in build.xml References: From: Stefan Bodewig Date: 01 Dec 2000 09:46:52 +0100 In-Reply-To: Evan Yang's message of "Thu, 30 Nov 2000 10:47:19 -0800" Message-ID: Lines: 45 User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Evan Yang wrote: > I have a bunch components, each has their own build.xml. > They all share some common properties. > So I like to have a global build.xml contains common properties. > Evan more the common task can be there too. > So how to include this global build.xml in the local build.xml ? Use SYSTEM entities to let the parser include an XML snippet, see for the text that would be in the FAQ if it had been approved. > And one more question, how to overwrite a property/target in local > if possible ? You can't have two targets with the same name - I guess this is what you mean with overwriting targets. And right now there is no way to overwrite a property with (this might change in Ant 2.0 which still hasn't left the specification stage - actually not really entered it), you can do it with a task of your own - 's implementation does an explicit check to make sure it doesn't overwrite an existing property that your own task could omit. > I notice when I use task ant to make recursive build, the same > property can't be overwritten. Is that a feature ? Yes, at least a feature of Ant 1.x. > Can I overwrite the properties in local build, then restore the > value back to global one ? No. Again, both answers only apply to changing them via . Something like should work, as well as its Java equivalent in a custom task. Stefan