-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
147 lines (125 loc) · 5.69 KB
/
build.xml
File metadata and controls
147 lines (125 loc) · 5.69 KB
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
<?xml version="1.0"?>
<project name="mstor" basedir="." default="package">
<!-- Project details -->
<property name="project.version" value="0.9.9" />
<!-- Project paths -->
<property name="source.dir" location="src/main/java" />
<property name="test.source.dir" location="src/test/java" />
<property name="output.dir" location="bin" />
<property name="package.dir" location="build" />
<property name="package.file" value="mstor.jar" />
<property name="javadoc.dir" location="docs/api" />
<property name="javadoc.packages" value="net.fortuna.mstor.*" />
<property name="dist.dir" location=".." />
<property name="dist.name" value="mstor" />
<property name="dist.maven.file" value="${dist.name}-${project.version}-bundle.jar" />
<!-- Load overrides for library paths -->
<property file="build.properties" />
<!-- Library paths -->
<property name="j2se.apiUrl" value="http://java.sun.com/j2se/1.4/docs/api/" />
<property name="javamail.home" location="C:/libs/javamail-1.3.2" />
<property name="javamail.apiUrl" value="http://java.sun.com/products/javamail/javadocs/" />
<property name="jaf.home" location="C:/libs/jaf-1.0.2" />
<property name="jdom.apiUrl" value="http://www.jdom.org/docs/apidocs/" />
<property name="jakarta-commons-logging.apiUrl" value="http://jakarta.apache.org/commons/logging/api/" />
<property name="project.classpath" value="lib/commons-logging.jar;lib/jdom.jar;lib/xstream.jar;${javamail.home}/mail.jar;${output.dir}" />
<!-- Targets -->
<target name="clean-compile">
<mkdir dir="${output.dir}" />
<delete>
<fileset dir="${output.dir}" includes="**/*.class,**/log4j.properties" />
</delete>
</target>
<target name="compile">
<echo message="Compiling source from classpath: ${project.classpath}" />
<mkdir dir="${output.dir}" />
<copy file="${source.dir}/META-INF/javamail.providers" todir="${output.dir}/META-INF"/>
<javac source="1.4" target="1.4" srcdir="${source.dir}" destdir="${output.dir}" debug="false" deprecation="true" classpath="${project.classpath}">
<compilerarg value="-Xlint:unchecked" />
</javac>
</target>
<target name="compile-tests">
<echo message="Compiling tests from classpath: ${project.classpath}" />
<javac srcdir="${test.source.dir}" destdir="${output.dir}" classpath="${project.classpath}" debug="false" deprecation="true" />
</target>
<target name="clean-package">
<mkdir dir="${package.dir}" />
<delete>
<fileset dir="${package.dir}" />
</delete>
</target>
<target name="package" depends="compile, clean-package">
<manifest file="etc/manifest.mf">
<!-- Add manifest attributes here.. -->
<attribute name="Class-Path" value="commons-logging.jar jdom.jar" />
</manifest>
<jar basedir="${output.dir}" compress="true" jarfile="${package.dir}/${package.file}" manifest="etc/manifest.mf" />
</target>
<target name="clean-javadoc">
<mkdir dir="${javadoc.dir}" />
<delete>
<fileset dir="${javadoc.dir}" />
</delete>
</target>
<target name="javadoc" depends="clean-javadoc">
<echo message="Generating Javadocs from classpath: ${project.classpath}" />
<!--
<setproxy proxyhost="10.139.170.10" proxyport="8080" proxyuser="ap\ben_fortuna" proxypassword=""/>
-->
<javadoc sourcepath="${source.dir}" destdir="${javadoc.dir}" packagenames="${javadoc.packages}" Windowtitle="${ant.project.name}" Doctitle="${ant.project.name}" Overview="etc/overview.html" classpath="${project.classpath}">
<link href="${j2se.apiUrl}" />
<link href="${jdom.apiUrl}" />
<link href="${javamail.apiUrl}" />
<link href="${jakarta-commons-logging.apiUrl}" />
</javadoc>
</target>
<target name="clean-all" depends="clean-compile, clean-package">
</target>
<!-- source distribution -->
<target name="dist-src" depends="clean-all, javadoc">
<zip zipfile="${dist.dir}/${dist.name}-${project.version}-src.zip">
<zipfileset dir="." prefix="${dist.name}-${project.version}" excludes="${output.dir}/**" />
</zip>
</target>
<!-- binary distribution -->
<target name="dist" depends="package, javadoc">
<zip zipfile="${dist.dir}/${dist.name}-${project.version}.zip">
<zipfileset dir="." prefix="${dist.name}-${project.version}" includes="LICENSE,CHANGELOG,README" />
<zipfileset dir="docs" prefix="${dist.name}-${project.version}/docs" />
<zipfileset dir="etc" prefix="${dist.name}-${project.version}/etc" includes="FAQ,TODO,mstor.dtd,samples/**" />
<zipfileset dir="${package.dir}" prefix="${dist.name}-${project.version}/lib" />
<zipfileset dir="lib" prefix="${dist.name}-${project.version}/lib" />
</zip>
</target>
<!-- Maven distribution -->
<target name="dist-maven" depends="package">
<jar jarfile="${dist.dir}/${dist.maven.file}">
<zipfileset dir="." includes="LICENSE" fullpath="LICENSE.txt" />
<zipfileset dir="etc" includes="project.xml" />
<zipfileset dir="build" includes="${package.file}" fullpath="${dist.name}-${project.version}.jar" />
</jar>
</target>
<!-- JUnit tests -->
<target name="run-tests" depends="compile, compile-tests">
<echo message="Running tests with classpath: ${project.classpath}" />
<junit printsummary="yes" showoutput="yes" fork="no" haltonfailure="yes">
<formatter type="plain" />
<classpath path="${project.classpath}" />
<test name="net.fortuna.mstor.data.MboxFileTest" />
<!--
<test name="net.fortuna.mstor.MStorStoreTest"/>
<test name="net.fortuna.mstor.MStorFolderTest"/>
<test name="net.fortuna.mstor.MStorMessageTest"/>
-->
</junit>
<!-- // alternative approach..
<junit printsummary="yes" showoutput="no" fork="true">
<formatter type="xml"/>
<classpath refid="test.classpath"/>
<batchtest todir="${test.results}">
<fileset dir="${test.dir}" includes="**/*TestSuite.java"/>
</batchtest>
</junit>
-->
</target>
</project>