Debian Codegraph @

test/resources/property/variabletest.xml

raw symbols SCIP
1 <?xml version="1.0"?>
2
3 <project name="variabletest" basedir="." default="test1">
4 <description>
5 test build file for the Variable task
6 </description>
7
8 <taskdef resource="net/sf/antcontrib/antcontrib.properties">
9 <classpath location="${antcontrib.jar}"/>
10 </taskdef>
11
12 <!-- use like a standard property -->
13 <target name="test1">
14 <var name="x" value="6" />
15 </target>
16
17 <!-- use like a standard property -->
18 <target name="test2">
19 <var name="x" value="12" />
20 </target>
21
22 <!-- can append to itself -->
23 <target name="test3">
24 <var name="x" value="12" />
25 <var name="x" value="6 + ${x}" /> <!-- 6 + 12 -->
26 </target>
27
28 <!-- property can't override -->
29 <target name="test4">
30 <var name="x" value="6" />
31 <property name="x" value="12" />
32 </target>
33
34 <!-- can append multiple times -->
35 <target name="test5">
36 <var name="str" value="I" />
37 <var name="str" value="${str} am" />
38 <var name="str" value="${str} a" />
39 <var name="str" value="${str} string." />
40 <!-- I am a string. -->
41 </target>
42
43 <!-- property can't override -->
44 <target name="test6">
45 <var name="x" value="blue" />
46 <tstamp>
47 <format property="x" pattern="EEEE" />
48 </tstamp>
49 <var name="x" value="Today is ${x}."/>
50 <!-- Today is blue. -->
51 </target>
52
53 <!-- can override property -->
54 <target name="test7">
55 <property name="x" value="12" />
56 <var name="x" value="6" />
57 </target>
58
59 <!-- TODO: uses the Antelope <if>, need to adjust to use ant-contrib <if>
60 <target name="test8">
61 <var name="x" value="6"/>
62 <if name="x" value="6">
63 <var name="x" value="12"/>
64 <else>
65 <var name="x" value="13"/>
66 </else>
67 </if>
68 <echo>${x}</echo>
69 </target>
70 -->
71
72 <target name="test9">
73 <property name="i" value="2"/>
74 <var name="i" unset="true"/>
75 </target>
76
77 <target name="test10">
78 <var name="x" value="test"/>
79 <var name="x" unset="true"/>
80 <property name="x" value="xxx"/>
81 </target>
82 </project>