Browse Source

doc/test global locals

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@676191 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 17 years ago
parent
commit
7e387dfc12
2 changed files with 14 additions and 1 deletions
  1. +4
    -1
      docs/manual/CoreTasks/local.html
  2. +10
    -0
      src/tests/antunit/taskdefs/local-test.xml

+ 4
- 1
docs/manual/CoreTasks/local.html View File

@@ -31,7 +31,10 @@ various "block" levels. These include targets as well as the
<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">


+ 10
- 0
src/tests/antunit/taskdefs/local-test.xml View File

@@ -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>


Loading…
Cancel
Save