1 | <?xml version="1.0"?>
|
---|
2 |
|
---|
3 | <project name="ant-test" basedir="." default="test1">
|
---|
4 |
|
---|
5 | <path id="inheritable">
|
---|
6 | <pathelement path="${java.class.path}" />
|
---|
7 | </path>
|
---|
8 |
|
---|
9 | <target name="cleanup">
|
---|
10 | <delete file="test1.log" />
|
---|
11 | <delete file="test2.log" />
|
---|
12 | <delete file="ant/test3.log" />
|
---|
13 | <delete file="ant/test4.log" />
|
---|
14 | </target>
|
---|
15 |
|
---|
16 | <target name="all" depends="test1,test2,test3,test4"/>
|
---|
17 |
|
---|
18 | <target name="test1">
|
---|
19 | <ant antfile="ant.xml" dir="." target="test1"/>
|
---|
20 | </target>
|
---|
21 |
|
---|
22 | <target name="test2">
|
---|
23 | <antcall/>
|
---|
24 | </target>
|
---|
25 |
|
---|
26 | <target name="test3">
|
---|
27 | <antcall target="test3"/>
|
---|
28 | </target>
|
---|
29 |
|
---|
30 | <target name="test4">
|
---|
31 | <antcall target=""/>
|
---|
32 | </target>
|
---|
33 |
|
---|
34 | <target name="test4b">
|
---|
35 | <antcall target="does-not-exist"/>
|
---|
36 | </target>
|
---|
37 |
|
---|
38 | <target name="test5">
|
---|
39 | <antcall target="dummy"/>
|
---|
40 | </target>
|
---|
41 |
|
---|
42 | <target name="test6">
|
---|
43 | <ant antfile="ant.xml" dir="." target="dummy"/>
|
---|
44 | </target>
|
---|
45 |
|
---|
46 | <target name="dummy">
|
---|
47 | </target>
|
---|
48 |
|
---|
49 | <target name="inheritBasedir">
|
---|
50 | <ant antfile="ant/ant.xml" target="dummy" inheritAll="true" />
|
---|
51 | </target>
|
---|
52 |
|
---|
53 | <target name="doNotInheritBasedir">
|
---|
54 | <ant antfile="ant/ant.xml" target="dummy" inheritAll="false" />
|
---|
55 | </target>
|
---|
56 |
|
---|
57 | <target name="explicitBasedir1">
|
---|
58 | <ant antfile="taskdefs/ant/ant.xml" target="dummy" inheritAll="true"
|
---|
59 | dir=".." />
|
---|
60 | </target>
|
---|
61 |
|
---|
62 | <target name="explicitBasedir2">
|
---|
63 | <ant antfile="taskdefs/ant/ant.xml" target="dummy" inheritAll="false"
|
---|
64 | dir=".." />
|
---|
65 | </target>
|
---|
66 |
|
---|
67 | <target name="tripleCall">
|
---|
68 | <ant antfile="ant/ant.xml" target="callback" inheritAll="false" />
|
---|
69 | </target>
|
---|
70 |
|
---|
71 | <target name="testInherit">
|
---|
72 | <ant antfile="ant/references.xml" inheritRefs="true" target="dummy" />
|
---|
73 | </target>
|
---|
74 |
|
---|
75 | <target name="testNoInherit">
|
---|
76 | <ant antfile="ant/references.xml" inheritRefs="false" target="dummy" />
|
---|
77 | </target>
|
---|
78 |
|
---|
79 | <target name="testRename">
|
---|
80 | <ant antfile="ant/references.xml" inheritRefs="false" target="dummy">
|
---|
81 | <reference refid="path" torefid="newpath" />
|
---|
82 | </ant>
|
---|
83 | </target>
|
---|
84 |
|
---|
85 | <target name="testInheritPath" description="try to pass a reference to a path, which refers itself to a second path">
|
---|
86 | <property name="rootdir" location="."/>
|
---|
87 | <path id="project.classpath">
|
---|
88 | <pathelement location="../classes"/>
|
---|
89 | </path>
|
---|
90 | <path id="test.classpath">
|
---|
91 | <pathelement location="${rootdir}/test/testframework.jar"/>
|
---|
92 | <path refid="project.classpath"/>
|
---|
93 | </path>
|
---|
94 | <ant antfile="ant/references.xml" target="testInheritPath">
|
---|
95 | <reference refid="test.classpath"/>
|
---|
96 | </ant>
|
---|
97 | </target>
|
---|
98 |
|
---|
99 | <target name="testLogfilePlacement">
|
---|
100 | <ant antfile="ant.xml" target="dummy" output="test1.log"
|
---|
101 | inheritall="false" />
|
---|
102 | <ant antfile="ant.xml" target="dummy" output="test2.log" />
|
---|
103 | <ant antfile="ant.xml" target="dummy" output="test3.log"
|
---|
104 | inheritall="false" dir="ant" />
|
---|
105 | <ant antfile="ant.xml" target="dummy" output="test4.log"
|
---|
106 | dir="ant" />
|
---|
107 | </target>
|
---|
108 |
|
---|
109 | <target name="testRefid">
|
---|
110 | <ant antfile="ant/references.xml" inheritRefs="false" target="dummy">
|
---|
111 | <property name="testprop" refid="inheritable" />
|
---|
112 | </ant>
|
---|
113 | </target>
|
---|
114 |
|
---|
115 | <target name="test-property-override-inheritall-start">
|
---|
116 | <property name="test" value="1" />
|
---|
117 | <ant antfile="ant.xml"
|
---|
118 | target="test-property-override-inheritall-level-2"
|
---|
119 | inheritall="true">
|
---|
120 | <property name="test" value="2" />
|
---|
121 | </ant>
|
---|
122 | </target>
|
---|
123 |
|
---|
124 | <target name="test-property-override-inheritall-level-2">
|
---|
125 | <property name="test" value="3" />
|
---|
126 | <ant antfile="ant.xml"
|
---|
127 | target="test-property-override-inheritall-level-3"
|
---|
128 | inheritall="true">
|
---|
129 | <property name="test" value="4" />
|
---|
130 | </ant>
|
---|
131 | </target>
|
---|
132 |
|
---|
133 | <target name="test-property-override-inheritall-level-3">
|
---|
134 | <property name="test" value="5" />
|
---|
135 | <echo message="The value of test is ${test}" />
|
---|
136 | </target>
|
---|
137 |
|
---|
138 | <target name="test-property-override-no-inheritall-start">
|
---|
139 | <property name="test" value="1" />
|
---|
140 | <ant antfile="ant.xml"
|
---|
141 | target="test-property-override-no-inheritall-level-2"
|
---|
142 | inheritall="false">
|
---|
143 | <property name="test" value="2" />
|
---|
144 | </ant>
|
---|
145 | </target>
|
---|
146 |
|
---|
147 | <target name="test-property-override-no-inheritall-level-2">
|
---|
148 | <property name="test" value="3" />
|
---|
149 | <ant antfile="ant.xml"
|
---|
150 | target="test-property-override-no-inheritall-level-3"
|
---|
151 | inheritall="false">
|
---|
152 | <property name="test" value="4" />
|
---|
153 | </ant>
|
---|
154 | </target>
|
---|
155 |
|
---|
156 | <target name="test-property-override-no-inheritall-level-3">
|
---|
157 | <property name="test" value="5" />
|
---|
158 | <echo message="The value of test is ${test}" />
|
---|
159 | </target>
|
---|
160 |
|
---|
161 | <target name="test-propertyset">
|
---|
162 | <property name="test1" value="1"/>
|
---|
163 | <property name="test2" value="2"/>
|
---|
164 | <propertyset id="set">
|
---|
165 | <propertyref name="test1"/>
|
---|
166 | <mapper type="glob" from="*" to="*.x"/>
|
---|
167 | </propertyset>
|
---|
168 | <ant antfile="ant.xml" target="echo-for-propertyset-test"
|
---|
169 | inheritall="false">
|
---|
170 | <propertyset refid="set"/>
|
---|
171 | </ant>
|
---|
172 | </target>
|
---|
173 |
|
---|
174 | <target name="echo-for-propertyset-test">
|
---|
175 | <echo>test1 is ${test1}</echo>
|
---|
176 | <echo>test2 is ${test2}</echo>
|
---|
177 | <echo>test1.x is ${test1.x}</echo>
|
---|
178 | </target>
|
---|
179 |
|
---|
180 | <target name="infinite-loop-via-depends">
|
---|
181 | <antcall target="dependent"/>
|
---|
182 | </target>
|
---|
183 |
|
---|
184 | <target name="middleman" depends="infinite-loop-via-depends"/>
|
---|
185 | <target name="dependent" depends="middleman"/>
|
---|
186 |
|
---|
187 | <target name="multi-same-property">
|
---|
188 | <ant antfile="ant.xml" target="echo-for-multi-same">
|
---|
189 | <property name="prop" value="one"/>
|
---|
190 | <property name="prop" value="two"/>
|
---|
191 | </ant>
|
---|
192 | </target>
|
---|
193 |
|
---|
194 | <target name="echo-for-multi-same">
|
---|
195 | <echo>prop is ${prop}</echo>
|
---|
196 | </target>
|
---|
197 |
|
---|
198 | <target name="topleveltarget">
|
---|
199 | <ant antfile="ant.topleveltest.xml"/>
|
---|
200 | </target>
|
---|
201 |
|
---|
202 | <target name="multiple-property-file-children">
|
---|
203 | <ant target="dummy" antfile="ant.xml">
|
---|
204 | <property file="foo.properties"/>
|
---|
205 | <property file="bar.properties"/>
|
---|
206 | </ant>
|
---|
207 | </target>
|
---|
208 |
|
---|
209 | <target name="blank-target">
|
---|
210 | <ant antfile="ant.topleveltest.xml">
|
---|
211 | <target name="" />
|
---|
212 | </ant>
|
---|
213 | </target>
|
---|
214 |
|
---|
215 | <target name="multiple-targets">
|
---|
216 | <ant antfile="ant.xml">
|
---|
217 | <target name="ta" />
|
---|
218 | <target name="tb" />
|
---|
219 | <target name="tc" />
|
---|
220 | </ant>
|
---|
221 | </target>
|
---|
222 |
|
---|
223 | <target name="multiple-targets-2">
|
---|
224 | <ant antfile="ant.xml">
|
---|
225 | <target name="tb" />
|
---|
226 | <target name="da" />
|
---|
227 | </ant>
|
---|
228 | </target>
|
---|
229 |
|
---|
230 | <target name="ta"><echo>ta</echo></target>
|
---|
231 | <target name="tb" depends="da,dc"><echo>tb</echo></target>
|
---|
232 | <target name="tc" depends="db,dc"><echo>tc</echo></target>
|
---|
233 |
|
---|
234 | <target name="da"><echo>da</echo></target>
|
---|
235 | <target name="db"><echo>db</echo></target>
|
---|
236 | <target name="dc"><echo>dc</echo></target>
|
---|
237 |
|
---|
238 | </project>
|
---|