-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
166 lines (146 loc) · 5.02 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
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
<!--
$ ant -p
Buildfile: build.xml
Main targets:
clean Deletes class files and other generated files.
jar Jars compiled java class files.
javac Compiles java source code.
javadocs Generates javadocs.
Default target: jar
-->
<project name="not-yet-commons-ssl" default="jar" basedir=".">
<property name="src" location="./src/java"/>
<property name="build" location="./build"/>
<property name="lib" location="./lib"/>
<property name="classes" value="${build}/classes"/>
<property name="jar-file" value="${ant.project.name}.jar"/>
<property name="javadocs" value="${build}/javadocs"/>
<property name="rmic.includes" value="**/*RMI.class"/>
<property name="test-src" location="./src/test"/>
<property name="test-classes" value="${build}/test-classes"/>
<property name="test-jar-file" value="${ant.project.name}-tests.jar"/>
<property name="test.report.dir" value="${build}/test-report"/>
<path id="compile-classpath">
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<pathelement location="."/>
<pathelement location="${classes}"/>
<pathelement location="${test-classes}"/>
</path>
<target name="test-jar" depends="jar">
<mkdir dir="${test-classes}"/>
<javac
includeAntRuntime="false"
destdir="${test-classes}"
debug="true"
optimize="false"
srcdir="${test-src}"
>
<classpath refid="compile-classpath"/>
</javac>
<copy todir="${test-classes}">
<fileset dir="${test-src}" excludes="**/*.java"/>
</copy>
<jar
basedir="${test-classes}"
destfile="${build}/${test-jar-file}"
index="true"
whenempty="create"
/>
</target>
<target name="test" depends="test-jar">
<mkdir dir="${test.report.dir}"/>
<junit printsummary="on" haltonfailure="false" errorProperty="junit.failed"
failureProperty="junit.failed" fork="on" forkMode="perBatch"
timeout="600000" showoutput="on">
<syspropertyset><propertyref builtin="commandline"/></syspropertyset>
<formatter type="xml"/>
<classpath refid="compile-classpath"/>
<batchtest todir="${test.report.dir}">
<fileset dir="${test-src}" includes="**/Test*.java"/>
</batchtest>
</junit>
<junitreport todir="${test.report.dir}">
<fileset dir="${test.report.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report todir="${test.report.dir}"/>
</junitreport>
<fail message="JUnit tests failed." if="test.failed"/>
</target>
<target name="init">
<echo>${ant.version}</echo>
<echo>Java version: ${java.version}</echo>
<tstamp>
<format property="date" pattern="zzz:yyyy-MM-dd/HH:mm:ss" locale="en"/>
</tstamp>
<mkdir dir="${build}"/>
</target>
<target name="javac" depends="init" description="Compiles java source code.">
<mkdir dir="${classes}"/>
<javac
compiler="extJavac"
includeAntRuntime="false"
destdir="${classes}"
debug="true"
optimize="false"
srcdir="${src}"
>
<classpath refid="compile-classpath"/>
</javac>
<copy todir="${classes}">
<fileset dir="${src}" excludes="**/*.java"/>
</copy>
</target>
<target name="rmic" depends="javac" description="Rmics java class files named "*RMI.class".">
<rmic
base="${classes}"
includes="${rmic.includes}"
classpathref="compile-classpath"
/>
</target>
<target name="jar" depends="rmic" description="Jars compiled java class files.">
<jar
basedir="${classes}"
destfile="${build}/${jar-file}"
index="true"
duplicate="fail"
>
<manifest>
<attribute name="Built-By" value="Julius Davies"/>
<attribute name="Created-By" value="Julius Davies"/>
<attribute name="Main-Class" value="org.apache.commons.ssl.Ping"/>
</manifest>
</jar>
</target>
<!-- Alias for "javadocs". -->
<target name="javadoc" depends="javadocs"/>
<target name="javadocs" depends="init" description="Generates javadocs.">
<mkdir dir="${javadocs}"/>
<javadoc
sourcepath="${src}"
destdir="${javadocs}"
packagenames="*"
classpathref="compile-classpath"
access="private"
source="yes"
linksource="yes"
>
<link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
<link href="http://java.sun.com/j2ee/1.4/docs/api/"/>
<link href="http://jakarta.apache.org/commons/httpclient/apidocs/"/>
</javadoc>
</target>
<target name="clean" description="Deletes class files and other generated files.">
<delete dir="${build}"/>
</target>
<target name="all" depends="clean,jar"/>
<target name="classpath" depends="cp"/>
<target name='cp' depends='jar' description='Generates classpath.sh file'>
<property name='classdump' refid='compile-classpath'/>
<echo file='classpath.sh'>export CLASSPATH=${classdump}
</echo>
<echo>Created classpath.sh file.</echo>
</target>
</project>