-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
56 lines (42 loc) · 1.75 KB
/
build.xml
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
<project default="test">
<property name="src.dir" location="src"/>
<property name="build.dir" location="build"/>
<property name="build.classes.dir" location="${build.dir}/classes"/>
<property name="lib.dir" location="lib"/>
<path id="cp">
<pathelement location="${lib.dir}/testng-6.8.8.jar"/>
<pathelement location="${lib.dir}/jcommander-1.19.jar"/>
<pathelement location="${build.classes.dir}"/>
</path>
<target name="prepare" description=" 准备 : 创建各种文件夹.">
<echo> ==================================================
||
|| 创建各种文件夹.
||
================================================== </echo>
<!-- 创建源程序文件夹 -->
<mkdir dir="${src.dir}"/>
<!-- 创建目标程序文件夹 -->
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes.dir}"/>
<!-- 创建其他文件夹 -->
<mkdir dir="${lib.dir}"/>
</target>
<target name="compile" depends="prepare" description=" 编译 : 编译所有源程序." unless="final.version">
<echo> ==================================================
||
|| 编译所有源程序.
||
==================================================</echo>
<javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="on" deprecation="on" encoding="UTF-8">
<compilerarg value="-Xlint:unchecked"/>
<classpath refid="cp"/>
</javac>
</target>
<taskdef name="testng" classpathref="cp" classname="org.testng.TestNGAntTask" />
<target name="test" depends="compile">
<testng classpathref="cp" listener="com.stone.testNG.CustomReporter">
<classfileset dir="${build.classes.dir}" includes="com/stone/testNG/SampleTest.class"/>
</testng>
</target>
</project>