You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by mb...@apache.org on 2008/07/12 17:37:54 UTC
svn commit: r676191 - in /ant/core/trunk: docs/manual/CoreTasks/local.html
src/tests/antunit/taskdefs/local-test.xml
Author: mbenson
Date: Sat Jul 12 08:37:54 2008
New Revision: 676191
URL: http://svn.apache.org/viewvc?rev=676191&view=rev
Log:
doc/test global locals
Modified:
ant/core/trunk/docs/manual/CoreTasks/local.html
ant/core/trunk/src/tests/antunit/taskdefs/local-test.xml
Modified: ant/core/trunk/docs/manual/CoreTasks/local.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/local.html?rev=676191&r1=676190&r2=676191&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/local.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/local.html Sat Jul 12 08:37:54 2008
@@ -31,7 +31,10 @@
<a href="parallel.html">Parallel</a> and <a href="sequential.html">Sequential</a>
task containers (including <a href="macrodef.html">Macrodef</a> bodies). A local
property at a given scope "shadows" properties of the same name at higher scopes,
-including the global scope. <b>Since Ant 1.8</b></p>
+including the global scope. Note that using the Local task at the global
+level effectively makes the property local to the "anonymous target" in which
+top-level operations are carried out; it will not be defined for other targets
+in the buildfile. <b>Since Ant 1.8</b></p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
Modified: ant/core/trunk/src/tests/antunit/taskdefs/local-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/local-test.xml?rev=676191&r1=676190&r2=676191&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/local-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/local-test.xml Sat Jul 12 08:37:54 2008
@@ -20,6 +20,16 @@
<property name="foo" value="foo" />
+ <local name="bar" />
+ <property name="bar" value="bar" />
+ <au:assertPropertyEquals name="bar" value="bar" />
+
+ <target name="testGlobalLocal">
+ <au:assertFalse>
+ <isset property="bar" />
+ </au:assertFalse>
+ </target>
+
<target name="testBaseline">
<au:assertPropertyEquals name="foo" value="foo" />
</target>