aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/ant/apache-ant-1.9.6/src/etc/testcases/taskdefs/ant.xml
blob: 33ef1dab2abbdab832f84b42acfedd4312c790d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<project name="ant-test" basedir="." default="test1">

  <path id="inheritable">
    <pathelement path="${java.class.path}" />
  </path>

  <target name="cleanup">
    <delete file="test1.log" />
    <delete file="test2.log" />
    <delete file="ant/test3.log" />
    <delete file="ant/test4.log" />
  </target>

  <target name="all" depends="test1,test2,test3,test4"/>

  <target name="test1">
    <ant antfile="ant.xml" dir="." target="test1"/>
  </target>

  <target name="test2">
    <antcall/>
  </target>

  <target name="test3">
    <antcall target="test3"/>
  </target>

  <target name="test4">
    <antcall target=""/>
  </target>

  <target name="test4b">
    <antcall target="does-not-exist"/>
  </target>

  <target name="test5">
    <antcall target="dummy"/>
  </target>

  <target name="test6">
    <ant antfile="ant.xml" dir="." target="dummy"/>
  </target>

  <target name="dummy">
  </target>

  <target name="inheritBasedir">
    <ant antfile="ant/ant.xml" target="dummy" inheritAll="true" />
  </target>

  <target name="doNotInheritBasedir">
    <ant antfile="ant/ant.xml" target="dummy" inheritAll="false" />
  </target>

  <target name="explicitBasedir1">
    <ant antfile="taskdefs/ant/ant.xml" target="dummy" inheritAll="true" 
         dir=".." />
  </target>

  <target name="explicitBasedir2">
    <ant antfile="taskdefs/ant/ant.xml" target="dummy" inheritAll="false" 
         dir=".." />
  </target>

  <target name="tripleCall">
    <ant antfile="ant/ant.xml" target="callback" inheritAll="false" />
  </target>

  <target name="testInherit">
    <ant antfile="ant/references.xml" inheritRefs="true" target="dummy" />
  </target>

  <target name="testNoInherit">
    <ant antfile="ant/references.xml" inheritRefs="false" target="dummy" />
  </target>

  <target name="testRename">
    <ant antfile="ant/references.xml" inheritRefs="false" target="dummy">
      <reference refid="path" torefid="newpath" />
    </ant>
  </target>

  <target name="testInheritPath" description="try to pass a reference to a path, which refers itself to a second path">
    <property name="rootdir" location="."/>
    <path id="project.classpath">
      <pathelement location="../classes"/>
    </path>
    <path id="test.classpath">
      <pathelement location="${rootdir}/test/testframework.jar"/>
      <path refid="project.classpath"/>
    </path>
    <ant antfile="ant/references.xml"  target="testInheritPath">
      <reference refid="test.classpath"/>
    </ant>
  </target>

  <target name="testLogfilePlacement">
    <ant antfile="ant.xml" target="dummy" output="test1.log"
         inheritall="false" />
    <ant antfile="ant.xml" target="dummy" output="test2.log" />
    <ant antfile="ant.xml" target="dummy" output="test3.log"
         inheritall="false" dir="ant" />
    <ant antfile="ant.xml" target="dummy" output="test4.log" 
         dir="ant" />
  </target>

  <target name="testRefid">
    <ant antfile="ant/references.xml" inheritRefs="false" target="dummy">
      <property name="testprop" refid="inheritable" />
    </ant>
  </target>

  <target name="test-property-override-inheritall-start">
    <property name="test" value="1" />
    <ant antfile="ant.xml"
         target="test-property-override-inheritall-level-2"
         inheritall="true">
      <property name="test" value="2" />
    </ant>
  </target>

  <target name="test-property-override-inheritall-level-2">
    <property name="test" value="3" />
    <ant antfile="ant.xml"
         target="test-property-override-inheritall-level-3"
         inheritall="true">
      <property name="test" value="4" />
    </ant>
  </target>

  <target name="test-property-override-inheritall-level-3">
    <property name="test" value="5" />
    <echo message="The value of test is ${test}" />
  </target>

  <target name="test-property-override-no-inheritall-start">
    <property name="test" value="1" />
    <ant antfile="ant.xml"
         target="test-property-override-no-inheritall-level-2"
         inheritall="false">
      <property name="test" value="2" />
    </ant>
  </target>

  <target name="test-property-override-no-inheritall-level-2">
    <property name="test" value="3" />
    <ant antfile="ant.xml"
         target="test-property-override-no-inheritall-level-3"
         inheritall="false">
      <property name="test" value="4" />
    </ant>
  </target>

  <target name="test-property-override-no-inheritall-level-3">
    <property name="test" value="5" />
    <echo message="The value of test is ${test}" />
  </target>

  <target name="test-propertyset">
    <property name="test1" value="1"/>
    <property name="test2" value="2"/>
    <propertyset id="set">
      <propertyref name="test1"/>
      <mapper type="glob" from="*" to="*.x"/>
    </propertyset>
    <ant antfile="ant.xml" target="echo-for-propertyset-test" 
         inheritall="false">
      <propertyset refid="set"/>
    </ant>
  </target>

  <target name="echo-for-propertyset-test">
    <echo>test1 is ${test1}</echo>
    <echo>test2 is ${test2}</echo>
    <echo>test1.x is ${test1.x}</echo>
  </target>

  <target name="infinite-loop-via-depends">
    <antcall target="dependent"/>
  </target>

  <target name="middleman" depends="infinite-loop-via-depends"/>
  <target name="dependent" depends="middleman"/>
  
  <target name="multi-same-property">
    <ant antfile="ant.xml" target="echo-for-multi-same">
      <property name="prop" value="one"/>
      <property name="prop" value="two"/>
    </ant>
  </target>

  <target name="echo-for-multi-same">
    <echo>prop is ${prop}</echo>
  </target>

  <target name="topleveltarget">
    <ant antfile="ant.topleveltest.xml"/>
  </target>

  <target name="multiple-property-file-children">
    <ant target="dummy" antfile="ant.xml">
      <property file="foo.properties"/>
      <property file="bar.properties"/>
    </ant>
  </target>

  <target name="blank-target">
    <ant antfile="ant.topleveltest.xml">
      <target name="" />
    </ant>
  </target>

  <target name="multiple-targets">
    <ant antfile="ant.xml">
      <target name="ta" />
      <target name="tb" />
      <target name="tc" />
    </ant>
  </target>

  <target name="multiple-targets-2">
    <ant antfile="ant.xml">
      <target name="tb" />
      <target name="da" />
    </ant>
  </target>

  <target name="ta"><echo>ta</echo></target>
  <target name="tb" depends="da,dc"><echo>tb</echo></target>
  <target name="tc" depends="db,dc"><echo>tc</echo></target>

  <target name="da"><echo>da</echo></target>
  <target name="db"><echo>db</echo></target>
  <target name="dc"><echo>dc</echo></target>

  <target name="show-ant.core.lib">
    <echo>${ant.core.lib}</echo>
  </target>
  <target name="sub-show-ant.core.lib">
    <ant antfile="${ant.file}" target="show-ant.core.lib" inheritall="false" inheritrefs="false"/>
  </target>

</project>