1 | <project name="test" basedir=".">
|
---|
2 |
|
---|
3 | <target name="addpath">
|
---|
4 | <typedef name="mypath" classname="org.apache.tools.ant.types.Path"/>
|
---|
5 | <path>
|
---|
6 | <mypath path="build.xml"/>
|
---|
7 | </path>
|
---|
8 | </target>
|
---|
9 |
|
---|
10 | <target name="addcondition">
|
---|
11 | <typedef name="mycondition"
|
---|
12 | classname="org.apache.tools.ant.taskdefs.condition.Equals"/>
|
---|
13 | <condition property="mycondition.set">
|
---|
14 | <mycondition arg1="string" arg2="string"/>
|
---|
15 | </condition>
|
---|
16 | <fail unless="mycondition.set"/>
|
---|
17 | </target>
|
---|
18 |
|
---|
19 | <target name="addfilter">
|
---|
20 | <typedef name="headfilter2"
|
---|
21 | classname="org.apache.tools.ant.filters.HeadFilter"/>
|
---|
22 | <concat>This is line 1
|
---|
23 | This is line 2
|
---|
24 | This is line 3
|
---|
25 | <filterchain>
|
---|
26 | <headfilter2 lines="2"/>
|
---|
27 | </filterchain>
|
---|
28 | </concat>
|
---|
29 | </target>
|
---|
30 |
|
---|
31 | <target name="addselector">
|
---|
32 | <typedef
|
---|
33 | name="myselector"
|
---|
34 | classname="org.apache.tools.ant.types.selectors.ContainsSelector"/>
|
---|
35 | <fileset id="myselector.test" dir="${basedir}" includes="*">
|
---|
36 | <myselector text="myselector"/>
|
---|
37 | </fileset>
|
---|
38 | </target>
|
---|
39 |
|
---|
40 | <target name="init">
|
---|
41 | <property name="nested.package" value="org.apache.tools.ant.types."/>
|
---|
42 | <path id="test-classes">
|
---|
43 | <pathelement location="../../../../build/testcases" />
|
---|
44 | <pathelement path="${java.class.path}" />
|
---|
45 | </path>
|
---|
46 | <typedef loaderref="nested.loader" classpathref="test-classes"
|
---|
47 | name = "nested.a"
|
---|
48 | classname="${nested.package}AddTypeTest$AImpl"/>
|
---|
49 | <typedef loaderref="nested.loader"
|
---|
50 | name = "nested.b"
|
---|
51 | classname="${nested.package}AddTypeTest$BImpl"/>
|
---|
52 | <typedef loaderref="nested.loader"
|
---|
53 | name = "nested.c"
|
---|
54 | classname="${nested.package}AddTypeTest$CImpl"/>
|
---|
55 | <typedef loaderref="nested.loader"
|
---|
56 | name = "nested.ab"
|
---|
57 | classname="${nested.package}AddTypeTest$ABImpl"/>
|
---|
58 | <taskdef loaderref="nested.loader"
|
---|
59 | name = "nested.container"
|
---|
60 | classname="${nested.package}AddTypeTest$NestedContainer"/>
|
---|
61 | <taskdef loaderref="nested.loader"
|
---|
62 | name = "nested.condition.task"
|
---|
63 | classname="${nested.package}AddTypeTest$MyCondition"/>
|
---|
64 | <typedef loaderref="nested.loader"
|
---|
65 | name = "nested.condition.type"
|
---|
66 | classname="${nested.package}AddTypeTest$MyCondition"/>
|
---|
67 | <typedef loaderref="nested.loader"
|
---|
68 | name = "myaddconfigured"
|
---|
69 | classname="${nested.package}AddTypeTest$MyAddConfigured"/>
|
---|
70 | <typedef loaderref="nested.loader"
|
---|
71 | name = "myvalue"
|
---|
72 | classname="${nested.package}AddTypeTest$MyValue"/>
|
---|
73 | </target>
|
---|
74 |
|
---|
75 | <target name="nested.a" depends="init">
|
---|
76 | <nested.container>
|
---|
77 | <nested.a/>
|
---|
78 | </nested.container>
|
---|
79 | </target>
|
---|
80 |
|
---|
81 | <target name="nested.b" depends="init">
|
---|
82 | <nested.container>
|
---|
83 | <nested.b/>
|
---|
84 | </nested.container>
|
---|
85 | </target>
|
---|
86 |
|
---|
87 | <target name="nested.c" depends="init">
|
---|
88 | <nested.container>
|
---|
89 | <nested.c/>
|
---|
90 | </nested.container>
|
---|
91 | </target>
|
---|
92 |
|
---|
93 | <target name="nested.ab" depends="init">
|
---|
94 | <nested.container>
|
---|
95 | <nested.ab/>
|
---|
96 | </nested.container>
|
---|
97 | </target>
|
---|
98 |
|
---|
99 | <!-- tests for task adaptor -->
|
---|
100 | <target name="condition.type" depends="init">
|
---|
101 | <echo>before</echo>
|
---|
102 | <nested.condition.type/>
|
---|
103 | <echo>after</echo>
|
---|
104 | </target>
|
---|
105 |
|
---|
106 | <target name="condition.task" depends="init">
|
---|
107 | <echo>before</echo>
|
---|
108 | <nested.condition.task/>
|
---|
109 | <echo>after</echo>
|
---|
110 | </target>
|
---|
111 |
|
---|
112 | <target name="condition.condition.type" depends="init">
|
---|
113 | <condition property="condition.condition.type">
|
---|
114 | <nested.condition.type/>
|
---|
115 | </condition>
|
---|
116 | </target>
|
---|
117 |
|
---|
118 | <target name="condition.condition.task" depends="init">
|
---|
119 | <condition property="condition.condition.task">
|
---|
120 | <nested.condition.task/>
|
---|
121 | </condition>
|
---|
122 | </target>
|
---|
123 |
|
---|
124 | <target name="myaddconfigured" depends="init">
|
---|
125 | <myaddconfigured>
|
---|
126 | <myvalue>Value Set</myvalue>
|
---|
127 | </myaddconfigured>
|
---|
128 | </target>
|
---|
129 |
|
---|
130 | <target name="namespacetest" xmlns:prefix="uri">
|
---|
131 | <typedef name="eq" uri="uri"
|
---|
132 | classname="org.apache.tools.ant.taskdefs.condition.Equals"/>
|
---|
133 | <condition property="p">
|
---|
134 | <prefix:eq arg1="a" arg2="b"/>
|
---|
135 | </condition>
|
---|
136 | </target>
|
---|
137 | </project>
|
---|