Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 5088 invoked from network); 12 Jun 2007 15:53:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jun 2007 15:53:43 -0000 Received: (qmail 94328 invoked by uid 500); 12 Jun 2007 15:53:41 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 94296 invoked by uid 500); 12 Jun 2007 15:53:41 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 94285 invoked by uid 99); 12 Jun 2007 15:53:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 08:53:41 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of qazwart@gmail.com designates 66.249.92.168 as permitted sender) Received: from [66.249.92.168] (HELO ug-out-1314.google.com) (66.249.92.168) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 08:53:37 -0700 Received: by ug-out-1314.google.com with SMTP id q2so178995uge for ; Tue, 12 Jun 2007 08:53:13 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=aerC5soQuyuaQsuqUeWVht901q5cqcKmioZsaf0YQzhqnB4wvvhKzMniUJQz0n6ZRIOnABcU2Vk7zCcOD6OxjWDfV2jH+cip1khP7Xw79uvlgcyKCPIaVz5M6RpxbGnOzBSHKMHQx0gZff6Zchh/W7lhZCSR4XnAQS54Jw6kN7k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oz42IaURxy/j/me1ueVm6iSrssGe6psmI0WXgEzMJC5elH5RWIuIH5mgooXmjuuFZwryPSW4qC1zYMQ/ZVdI70tTov/bYvdXba9MxRvQl1bHmhycxMyer+m3FlSIzLP4bhCOMGpdRgQgo7L3Vx5blrdLkL5n9VHc8+FAwB3NGmk= Received: by 10.82.126.5 with SMTP id y5mr13530698buc.1181663592827; Tue, 12 Jun 2007 08:53:12 -0700 (PDT) Received: by 10.82.157.12 with HTTP; Tue, 12 Jun 2007 08:53:12 -0700 (PDT) Message-ID: Date: Tue, 12 Jun 2007 11:53:12 -0400 From: "David Weintraub" To: "Ant Users List" Subject: Re: replacing sections of build file In-Reply-To: <11079129.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <11079129.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org You can set default values in your build.xml like this: Which I recommend. These in turn can be overwritten by reading in a properties file. For example, if you have a file build.properties that looks like this: # Overrides "foo" in the build.xml file foo=munged-foo-value And your build.xml file looks like this: Property "foo" is set to "${foo}" The output of this build.xml will be: [echo] Property "foo" is set to "munged-foo-value" By changing the property file, you affect the values of the properties you have set in your build.xml file, and it will override anything properties you've set in your build.xml file. If you don't have a properties file called build.xml, the will be ignored and the output will be: [echo] Property "foo" is set to "foo-value" You can make things a bit more flexible by doing this: Property "foo" is set to "${foo}" This way, if a user doesn't have a build.properties file, the default value in the build.xml will be used. If the user has a build.properties file, the value in that file will be used. If the user gives a "-Dprop.file="my.properties", then the value set in "my.properties" will be used. This is the way to replace the values of properties in a build.xml file. Is this what you're looking for? On 6/12/07, arijit wrote: > > I have a build file test.xml which has lines in it which need to be replaced > by actual values. These actual values are read from a property file, which > is loaded by this build file. > > This problem is similar to the thread "Token based loading of property > files" posted earlier in this forum. Have not received a response to that as > well. > > any information for this ? > -- > View this message in context: http://www.nabble.com/replacing-sections-of-build-file-tf3907642.html#a11079129 > Sent from the Ant - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > -- -- David Weintraub qazwart@gmail.com --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org