forked from rjo1970/dumbster
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
144 lines (121 loc) · 5.38 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
<?xml version="1.0"?>
<!--
Dumbster - a dummy SMTP server
Copyright 2004 Jason Paul Kitchen
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="dumbster" default="test">
<!-- === project configuration ========================================== -->
<property name="release" value="1.9.0.2-SNAPSHOT"/>
<property name="srcdir" value="src"/>
<property name="etcdir" value="etc"/>
<property name="builddir" value="build"/>
<property name="docdir" value="doc"/>
<property name="stagedir" value="${builddir}/stage"/>
<property name="compiledir" value="${builddir}/classes"/>
<property name="libdir" value="lib"/>
<property name="testsrcdir" value="test-src"/>
<property name="testcompiledir" value="${builddir}/test"/>
<property name="testreportdir" value="${testcompiledir}/report"/>
<property name="build.compiler" value="modern"/>
<path id="compile.path">
<fileset dir="${libdir}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${compiledir}"/>
</path>
<!-- === compile ======================================================== -->
<target name="compile" depends="init">
<javac srcdir="${srcdir}"
destdir="${compiledir}"
debug="true"
includeantruntime="false"
debuglevel="lines,vars,source">
<classpath refid="compile.path"/>
<include name="com/dumbster/smtp/"/>
</javac>
</target>
<!-- === jar ============================================================ -->
<target name="jar" depends="compile">
<delete file="${builddir}/dumbster.jar"/>
<echo file="${builddir}/manifest.txt">Main-Class: com.dumbster.smtp.Main</echo>
<jar jarfile="${builddir}/dumbster.jar" basedir="${compiledir}/" manifest="${builddir}/manifest.txt"/>
</target>
<!-- === clean ========================================================== -->
<target name="clean">
<delete dir="${builddir}"/>
<delete dir="target"/>
<delete>
<fileset dir="." includes="**/*~" defaultexcludes="no"/>
</delete>
</target>
<!-- === init =========================================================== -->
<target name="init">
<mkdir dir="${compiledir}"/>
<mkdir dir="${testcompiledir}"/>
<mkdir dir="${testreportdir}"/>
</target>
<!-- === Unit test ====================================================== -->
<target name="compile-tests" depends="init">
<javac srcdir="${testsrcdir}"
destdir="${testcompiledir}"
debug="true"
includeantruntime="false"
debuglevel="lines,vars,source">
<classpath refid="compile.path"/>
<include name="com/dumbster/smtp/"/>
</javac>
</target>
<target name="test" depends="clean, jar, compile-tests">
<junit fork="yes" printsummary="yes"
errorProperty="test.failed"
failureProperty="test.failed">
<sysproperty key="net.sourceforge.cobertura.datafile"
file="${builddir}/cobertura.ser"/>
<classpath>
<pathelement path="${builddir}/instrumented"/>
<pathelement path="${testcompiledir}"/>
<pathelement path="${compiledir}"/>
<fileset dir="${libdir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="${testcompiledir}">
<fileset dir="${testsrcdir}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${testreportdir}">
<fileset dir="${testcompiledir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${testreportdir}"/>
</junitreport>
<fail message="Something bad happened." if="test.failed"/>
</target>
<!-- == Generate javadoc ================================================ -->
<target name="javadoc" depends="compile">
<javadoc destdir="${docdir}">
<fileset dir="src" defaultexcludes="yes">
<include name="com/dumbster/**"/>
</fileset>
</javadoc>
</target>
<!-- == Prepare release ================================================= -->
<target name="release" depends="jar">
<zip destfile="${builddir}/dumbster${release}-all.zip" basedir="."
includes="*.txt, *.xml, test-src/**, src/**, lib/**">
<zipfileset dir="." includes="build/dumbster.jar" fullpath="dumbster${release}.jar"/>
</zip>
</target>
</project>