From dev-return-86754-apmail-ant-dev-archive=ant.apache.org@ant.apache.org Sun Feb 12 10:13:58 2012 Return-Path: X-Original-To: apmail-ant-dev-archive@www.apache.org Delivered-To: apmail-ant-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 95EC997A8 for ; Sun, 12 Feb 2012 10:13:58 +0000 (UTC) Received: (qmail 10282 invoked by uid 500); 12 Feb 2012 10:13:53 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 10019 invoked by uid 500); 12 Feb 2012 10:13:40 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 10009 invoked by uid 99); 12 Feb 2012 10:13:36 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Feb 2012 10:13:36 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [88.84.128.168] (HELO samaflost.de) (88.84.128.168) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Feb 2012 10:13:28 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by samaflost.de (Postfix) with ESMTP id 8519C40F010E for ; Sun, 12 Feb 2012 11:13:06 +0100 (CET) Received: from samaflost.de ([127.0.0.1]) by localhost (v35516.1blu.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q+pI8yfFHwYv for ; Sun, 12 Feb 2012 11:13:06 +0100 (CET) Received: by samaflost.de (Postfix, from userid 1000) id 4AE3040F010D; Sun, 12 Feb 2012 11:13:06 +0100 (CET) From: Stefan Bodewig To: dev@ant.apache.org Subject: Property expansion in macrodef attributes Date: Sun, 12 Feb 2012 11:13:06 +0100 Message-ID: <87aa4oqs0d.fsf@v35516.1blu.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org Hi all, for those who don't follow bugzilla comment threads (I know I seldomly do): Until Ant 1.8.2 ${} sequences in macrodef attributes were expanded once before @{} sequences are expanded and once in the context where the @{} is expanded. I.e. with @{from} becomes thing.2 and the second expansion does what the FAQ says. Ant's trunk has removed the ${} expansion that happens before @{} expansion, breaking the example of our own FAQ and breaking some other existing macrodefs out there (for example in Netbeans). https://issues.apache.org/bugzilla/show_bug.cgi?id=52621 Double expansion is unexpected and leads to subtle issues: https://issues.apache.org/bugzilla/show_bug.cgi?id=42046 https://issues.apache.org/bugzilla/show_bug.cgi?id=41400 In particular it made some AntUnit tests pass in Ant's own code base even though the code was actually broken. Jesse suggests to introduce an attribute to macrodef (or even at the granularity of the individual attribute definition of a macrodef) to control ${} expansion. I'm not sure whether the macrodef writer will always know whether she wants double-expansion or not. I also fear it will be quite difficult to explain in the manual of a macrodefed task ("this attribute may have ${} sequences expanded twice, this other one will not"). Another option would be to not fix the 1.8.2 behavior at all but call it a feature. Macrodef writers then can say something like "foo is implemented as a macrodef so ${} will be expanded twice, see http://ant.apache.org/faq.html#macrodef-property-expansion - not sure whether this a good option. Any other ideas? Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org