File: build.xml

package info (click to toggle)
testng 5.11%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,320 kB
  • sloc: java: 48,417; xml: 3,234; makefile: 50; sh: 13
file content (94 lines) | stat: -rw-r--r-- 3,522 bytes parent folder | download | duplicates (2)
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
<project name="testng-spring" default="both" basedir=".">

	<target name="init">
		<tstamp />
    <property file="../build.properties" />
		<property file="build.properties" />
		<!-- Settings -->
		<property name="jdk" value="jdk14" />
    <property name="optimize" value="false" />
    <property name="debug" value="true" />
		
    <!--  Directories -->
    <property name="src.dir" location="src" />
    <property name="topbuild.dir" location="build" />
    <property name="build.dir" location="${topbuild.dir}/${jdk}" />
    <property name="classes.dir" location="${build.dir}/classes" />	  	
    <property name="dependencies.dir" location="3rdparty" />
		<property name="topjavadocs.dir" location="javadocs" />
		<property name="javadocs.dir" location="${topjavadocs.dir}/${jdk}" />
		
	  	<property name="testng.spring.jar" location="testng-spring-${jdk}.jar" />

		<condition property="source.version" value="1.4"><equals arg1="${jdk}" arg2="jdk14"/></condition>
		<condition property="source.version" value="1.5"><equals arg1="${jdk}" arg2="jdk15"/></condition>
	</target>
	
	<target name="paths" depends="init">
		<path id="src.path">
			<pathelement path="${src.dir}/common" />
			<pathelement path="${src.dir}/${jdk}" />
		</path>
		<path id="compile.path">
      <fileset dir="${dependencies.dir}">
        <include name="*.jar" />
      </fileset>
			<pathelement path="../testng-${testng.version}-${jdk}.jar" />
		</path>
	</target>
	
	<target name="compile" depends="paths" description="compile sources">
		<echo message="                                 -- Compiling ${jdk} sources --" />
		<mkdir dir="${classes.dir}"/>
		<javac 	source="${source.version}" target="${source.version}"
				debug="${debug}" optimize="${optimize}" 
		        destdir="${classes.dir}">
			<src refid="src.path" />
			<classpath refid="compile.path" />
		</javac>
	</target>

	<target name="jar" depends="compile">
		<echo message="                                 -- Creating ${jdk} jar --" />
		<jar destfile="${testng.spring.jar}">
			<fileset dir="${classes.dir}" />
		</jar>
	</target>

	<target name="javadoc" depends="paths" description="generate api documentation">
		<echo message="                                 -- Generating javadocs for ${jdk} --" />
		<mkdir dir="${javadocs.dir}" />
	    <javadoc destdir="${javadocs.dir}" source="${source.version}" windowtitle="TestNG Spring Support" classpathref="compile.path">
			<fileset dir="${src.dir}/common" defaultexcludes="yes" includes="**/*.java" />
	      	<fileset dir="${src.dir}/${jdk}" defaultexcludes="yes" includes="**/*.java" />
	    </javadoc>
	</target>
	
	<target name="both">
		<property name="target" value="jar"/>
		<antcall target="${target}">
			<param name="jdk" value="jdk14"/>
		</antcall>
		<antcall target="${target}">
			<param name="jdk" value="jdk15"/>
		</antcall>
	</target>
	
	<target name="dist" description="builds both jdk14 and jdk15 variants">
		<antcall target="both"><param name="target" value="jar"/></antcall>
	</target>
	
	<target name="javadocs" description="builds both jdk14 and jdk15 javadocs">
		<antcall target="both"><param name="target" value="javadoc"/></antcall>
	</target>
	
	<target name="all" depends="dist,javadocs" description="build jar files and javadocs" />
	
	<target name="clean" depends="paths" description="cleans all">
		<delete dir="${topbuild.dir}" />
		<delete dir="${topjavadocs.dir}" />
		<delete file="testng-spring-jdk14.jar" />
		<delete file="testng-spring-jdk15.jar" />
	</target>
	
</project>