Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 336 lines (288 sloc) 12.47 kb
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
1 <project name="testng" default="dev" basedir=".">
2
3 <!-- ====================================================================== -->
4 <!-- TestNG build file -->
5 <!-- Created cbeust, April 26th, 2004 -->
6 <!-- ====================================================================== -->
7
8 <property file="build.properties" />
9 <property name="optimize" value="false" />
10 <property name="build.compiler" value="javac1.5" />
11
12 <!-- ====================================================================== -->
13 <!-- PREPARE -->
14 <!-- ====================================================================== -->
15 <target name="prepare"
16 description="Performs all preparations required to build.">
17 <tstamp />
18 <mkdir dir="${build.jdk15.dir}" />
19 </target>
20
21 <!-- ====================================================================== -->
22 <!-- DUMP -->
23 <!-- ====================================================================== -->
24 <target name="dump" description="Dumps all properties." depends="prepare">
25 <echoproperties />
26 </target>
27
28 <!-- ====================================================================== -->
29 <!-- VALIDATE -->
30 <!-- ====================================================================== -->
31
32 <target name="validate" description="Validates the build environment.">
33 <!-- java greater than 1.5 required to build -->
34 <condition property="requiredJavaVersion">
35 <or>
36 <equals arg1="${ant.java.version}" arg2="1.5" />
47a9886 Delete Javadoc support.
cbeust authored
37 <equals arg1="${ant.java.version}" arg2="1.6" />
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
38 </or>
39 </condition>
40 <fail unless="requiredJavaVersion"
41 message="Java version 1.5 required." />
42 <!-- validate ant version too ... -->
43 </target>
44
45 <!-- ==================================================================== -->
46 <!-- COPY-RESOURCES -->
47 <!-- ==================================================================== -->
48
49 <target name="copy-resources" description="Copies resources.">
50 <copy verbose="false"
47a9886 Delete Javadoc support.
cbeust authored
51 file="src/testng-1.0.dtd"
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
52 todir="${build.jdk15.dir}" />
53 <copy verbose="false"
54 file="src/testngtasks"
55 todir="${build.jdk15.dir}" />
56 <copy todir="${build.jdk15.dir}">
57 <fileset dir="./resources">
58 <exclude name="**/.*" />
59 <exclude name="**/CVS/*" />
60 </fileset>
61 </copy>
62 </target>
63
64
65 <target name="dev"
47a9886 Delete Javadoc support.
cbeust authored
66 depends="prepare,validate,copy-resources,build,dist-jar,test-15,test-ant" />
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
67
68 <target name="all"
47a9886 Delete Javadoc support.
cbeust authored
69 depends="prepare,validate,copy-resources,build,dist-jar,test-15,test-ant,javadocs,dist" />
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
70
47a9886 Delete Javadoc support.
cbeust authored
71 <target name="build" depends="compile-15,dist-jar" />
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
72
73 <target name="single">
74 <ant antfile="test/build.xml" target="run:single"/>
75 </target>
76
77 <!-- ==================================================================== -->
78 <!-- Compile -->
79 <!-- ==================================================================== -->
80
81 <target name="compile-15"
82 depends="prepare,copy-resources"
83 description="Compiles source for 15">
84 <echo message=" -- Compiling 1.5 sources --" />
85
86 <path id="compile2.cp">
87 <fileset dir="${lib.dir}">
88 <include name="junit.jar" />
89 <include name="${beanshell.jar}" />
90 </fileset>
91 </path>
92
93 <javac classpathref="compile2.cp"
94 verbose="false"
95 target="1.5"
96 debug="true"
97 optimize="${optimize}"
98 destdir="${build.jdk15.dir}">
47a9886 Delete Javadoc support.
cbeust authored
99 <src path="${src.dir}" />
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
100 </javac>
101 </target>
102
47a9886 Delete Javadoc support.
cbeust authored
103 <target name="compile:all" depends="compile-15" />
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
104
105 <target name="examples">
106 <ant inheritall="no" antfile="examples/build.xml" />
107 </target>
108
109 <target name="test-15" depends="compile-15" description="runs all JDK5 tests with JDK5 distro">
110 <ant inheritall="no" antfile="test/build.xml" />
85bc47a Removed v4 tests.
cbeust authored
111 <!--
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
112 <ant inheritall="no" antfile="test/v4/build.xml" />
85bc47a Removed v4 tests.
cbeust authored
113 -->
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
114 </target>
115
116 <!--
117 <target name="tmp">
118 <ant inheritall="no" antfile="test/v4/build.xml" target="run-jdk14" />
119 </target>
120 -->
121
122 <target name="test-ant">
123 <echo message=" -- Testing ant testng task functionality --" />
124 <ant inheritall="no" antfile="test/ant/build.xml" />
125 </target>
126
127 <!-- ==================================================================== -->
128 <!-- Documentation -->
129 <!-- ==================================================================== -->
130
131 <target name="javadocs">
132 <javadoc destdir="javadocs" source="1.5" windowtitle="TestNG">
47a9886 Delete Javadoc support.
cbeust authored
133 <fileset dir="${src.dir}" defaultexcludes="yes">
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
134 <include name="org/testng/*.java" />
135 </fileset>
47a9886 Delete Javadoc support.
cbeust authored
136 <fileset dir="${src.dir}" defaultexcludes="yes">
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
137 <include name="org/testng/xml/Xml*.java" />
138 </fileset>
47a9886 Delete Javadoc support.
cbeust authored
139 <fileset dir="${src.dir}" defaultexcludes="yes">
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
140 <include name="org/testng/annotations/**" />
141 </fileset>
142 </javadoc>
143 </target>
144
145 <!-- ==================================================================== -->
146 <!-- Distribution -->
147 <!-- ==================================================================== -->
148
149 <target name="dist" depends="maven-plugin,dist-all-zip,dist-maven-bundle,eclipse,dtd" />
150
47a9886 Delete Javadoc support.
cbeust authored
151 <target name="dist-jar" depends="dist-15" />
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
152
153 <target name="clean-unjar">
154 <delete quiet="true" dir="${build.3rdparty.dir}" includeemptydirs="true" />
155 <mkdir dir="${build.3rdparty.dir}" />
156 </target>
157
158 <target name="extract-beanshell-jar">
159 <unjar src="3rdparty/${beanshell.jar}"
160 dest="${build.3rdparty.dir}"
161 overwrite="true" />
162 </target>
163
164 <target name="dist-15" depends="compile-15, dist-15-bsh">
165 </target>
166
167 <target name="dist-15-bsh">
168 <antcall target="clean-unjar" />
169 <antcall target="extract-beanshell-jar" />
170 <delete file="${jdk15.testng.jar}" />
171 <jar destfile="${jdk15.testng.jar}">
172 <manifest>
173 <attribute name="Main-Class" value="org.testng.TestNG" />
174 <attribute name="Implementation-Version" value="${testng.version}-${DSTAMP}${TSTAMP}" />
175 </manifest>
176 <fileset dir="${build.jdk15.dir}" />
177 <fileset dir="${build.3rdparty.dir}" />
178 <fileset file="TESTNG-${testng.version}" />
179 </jar>
180 </target>
181
182 <target name="dist-15-nobsh">
183 <antcall target="clean-unjar" />
184 <jar destfile="${other.jars.dir}/${jdk15.testng.nobsh.jar}" update="true">
185 <manifest>
186 <attribute name="Main-Class" value="org.testng.TestNG" />
187 <attribute name="Implementation-Version" value="${testng.version}-${DSTAMP}${TSTAMP}" />
188 </manifest>
189 <fileset dir="${build.jdk15.dir}" />
190 <fileset dir="${build.3rdparty.dir}" />
191 <fileset file="TESTNG-${testng.version}" />
192 </jar>
193 </target>
194
195 <target name="dist-all-zip" depends="dist-prepare,dist-jar,javadocs">
196 <property name="zip.dir" value="testng-${testng.version}" />
197 <zip zipfile="${testng.zip}">
198 <zipfileset prefix="${zip.dir}" dir="${basedir}" includesfile="FILES" />
199 <zipfileset prefix="${zip.dir}" dir="${basedir}">
200 <include name="${jdk15.testng.jar}" />
201 </zipfileset>
202 <zipfileset dir="${other.jars.dir}" prefix="${zip.dir}/${other.jars.dir}"/>
203 <zipfileset dir="javadocs" prefix="${zip.dir}/javadocs" />
204 <zipfileset dir="src" prefix="${zip.dir}/src" />
205 <zipfileset dir="spring" prefix="${zip.dir}/spring" />
206 <zipfileset dir="doc" prefix="${zip.dir}/doc" />
207 <zipfileset dir="resources"
208 prefix="${zip.dir}/resources"
209 includes="**/*.css"/>
210 <zipfileset dir="test"
211 prefix="${zip.dir}/test"
212 includes="**/*.properties,**/*.java,build.xml,testng.xml"
47a9886 Delete Javadoc support.
cbeust authored
213 excludes="test-output/**,report/**" />
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
214 <zipfileset dir="3rdparty"
215 prefix="${zip.dir}/3rdparty"
47a9886 Delete Javadoc support.
cbeust authored
216 includes="${beanshell.jar},${concurrent.jar}" />
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
217 </zip>
218 </target>
219
220 <target name="dist-maven-bundle" depends="dist-all-zip">
221 <mkdir dir="${build.maven-bundle.dir}" />
222 <copy file="bundle-pom.xml" tofile="${build.maven-bundle.dir}/pom.xml" overwrite="true">
223 <filterchain>
224 <expandproperties/>
225 </filterchain>
226 </copy>
227 <jar destfile="${build.maven-bundle.dir}/${sources.testng.jar}">
47a9886 Delete Javadoc support.
cbeust authored
228 <fileset dir="src" />
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
229 </jar>
230 <jar destfile="${testng.maven-bundle}">
231 <fileset file="${build.maven-bundle.dir}/pom.xml" />
232 <fileset file="${jdk15.testng.jar}" />
233 <fileset file="${build.maven-bundle.dir}/${sources.testng.jar}" />
234 </jar>
235 </target>
236
237 <target name="dist-prepare" depends="update-readme">
238 <delete file="{other.jars.dir}/${jdk15.testng.nobsh.jar}" />
239 <mkdir dir="${other.jars.dir}" />
240 </target>
241
242 <target name="update-readme">
243 <copy file="README.template" tofile="README" />
244 <replace file="README" token="${version}" value="${testng.version}" />
245 <touch file="TESTNG-${testng.version}" />
246 </target>
247
248 <target name="eclipse" description="Used by Cedric to build distributions">
249 <property name="jdk15.jar"
250 value="${testng-eclipse.dir}/lib/testng-jdk15.jar" />
251
252 <delete file="${jdk15.jar}" />
253 <copy file="${jdk15.testng.jar}" tofile="${jdk15.jar}" />
254 </target>
255
256 <taskdef name="DTDDoc" classname="DTDDoc.DTDDocTask"
257 classpath="lib/DTDDoc.jar"/>
258
259 <target name="dtd">
260 <DTDDoc showHiddenTags="false"
261 showFixmeTags="false"
47a9886 Delete Javadoc support.
cbeust authored
262 sourceDir="src"
c60f221 [TESTNG-235] Generate a maven bundle during the TestNG build
DanFabulich authored
263 destDir="dtd"
264 docTitle="TestNG DTD">
265 <include name="testng-1.0.dtd"/>
266 </DTDDoc>
267 </target>
268
269 <target name="ftp">
270 <!--
271 <ftp action="put"
272 server="beust.com"
273 remotedir="w/testng/test-output"
274 userid="${userid}"
275 password="${password}">
276 <fileset dir="c:\weblogic\dev\sandbox\cbeust\testng\test\test-output">
277 <include name="index.html" />
278 <include name="main.html" />
279 <include name="toc.html" />
280 <include name="*egression*" />
281 </fileset>
282 </ftp>
283 -->
284 <ftp action="put"
285 server="beust.com"
286 remotedir="w/testng"
287 userid="${userid}"
288 password="${password}">
289 <fileset dir="${root.dir}">
290 <include name="${testng.zip}" />
291 <include name="javadocs/**" />
292 <include name="testng-1.0.dtd" />
293 </fileset>
294 <fileset dir="${root.dir}/doc">
295 <include name="*.html" />
296 </fileset>
297 </ftp>
298
299 </target>
300
301 <target name="ftp2">
302 <ftp action="put"
303 server="beust.com"
304 remotedir="w/testng"
305 userid="${userid}"
306 password="${password}">
307 <fileset dir="${root.dir}/test">
308 <include name="test-output/*" />
309 </fileset>
310 <fileset dir="${root.dir}/test">
311 <include name="test-report/*" />
312 </fileset>
313 </ftp>
314 </target>
315
316 <target name="clean">
317 <delete failonerror="false">
318 <fileset dir="${build.jdk15.dir}" includes="**/*" />
319 <fileset dir="${build.maven-bundle.dir}" includes="**/*" />
320 <fileset dir="." includes="*.jar,*.zip" />
321 </delete>
322 <ant antfile="test/build.xml" target="clean" />
323 <ant dir="examples" target="clean" />
324 </target>
325
326 <!-- ==================================================================== -->
327 <!-- Maven1/2 Distribution -->
328 <!-- ==================================================================== -->
329
330 <target name="maven-plugin">
331 <jar destfile="maven-testng-plugin-${testng-maven.version}.jar"
332 basedir="./maven/" />
333 </target>
334
335 </project>
Something went wrong with that request. Please try again.