-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
166 lines (152 loc) · 6.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" encoding="UTF-8"?>
<project name="bvalid" default="dist" basedir=".">
<loadproperties srcFile="build.properties"/>
<!-- defines bvalid.version -->
<loadproperties srcFile="src/java/net/sf/bvalid/BValid.properties"/>
<path id="compile.path">
<pathelement location="${lib.xml-apis}"/>
<pathelement location="${lib.xerces}"/>
<pathelement location="${lib.log4j}"/>
<pathelement location="${lib.httpclient}"/>
<pathelement location="${lib.codec}"/>
<pathelement location="${lib.logging}"/>
</path>
<path id="test.path">
<path refid="compile.path"/>
<pathelement location="${lib.junit}"/>
<pathelement location="${lib.jetty}"/>
<pathelement location="${lib.servlet}"/>
<pathelement location="${lib.jasper-runtime}"/>
<pathelement location="${lib.jasper-compiler}"/>
<pathelement location="build/classes"/>
<pathelement location="build/testclasses"/>
<pathelement location="src/config"/>
</path>
<target name="classes"
depends="prep"
description="build all java classes into build/classes">
<mkdir dir="build/classes"/>
<javac srcdir="src/java" destdir="build/classes"
includes="**"
classpathref="compile.path"
source="${source}"
target="${target}"
optimize="${optimize}" debug="${debug}">
<compilerarg line="-Xlint:deprecation"/>
</javac>
<copy file="src/java/net/sf/bvalid/BValid.properties" tofile="build/classes/net/sf/bvalid/BValid.properties"/>
<propertyfile file="build/version.properties">
<entry key="buildDate" type="date" value="now"/>
</propertyfile>
<replace file="build/classes/net/sf/bvalid/BValid.properties"
value="value not found in version.properties"
propertyFile="build/version.properties">
<replacefilter token="@buildDate@" property="buildDate"/>
</replace>
</target>
<target name="testclasses"
depends="classes"
description="build all test classes into build/testclasses">
<mkdir dir="build/testclasses"/>
<javac srcdir="src/test" destdir="build/testclasses"
includes="net/sf/bvalid/**"
classpathref="test.path"
optimize="${optimize}" debug="${debug}"/>
</target>
<target name="dist" depends="classes" description="Build the distribution in dist/">
<mkdir dir="dist/lib"/>
<copy todir="dist/lib">
<fileset dir="lib">
<exclude name="junit.jar"/>
<exclude name="org.mortbay.jetty.jar"/>
<exclude name="javax.servlet.jar"/>
<exclude name="jasper-runtime.jar"/>
<exclude name="jasper-compiler.jar"/>
</fileset>
</copy>
<copy todir="dist">
<fileset dir="src/bin"/>
<fileset dir="src/config"/>
</copy>
<chmod dir="dist" perm="ugo+x" includes="bvalid"/>
<jar jarfile="dist/bvalid-${bvalid.version}.jar" basedir="build/classes"/>
</target>
<target name="srcrelease" depends="clean">
<copy todir="dist/release/bvalid-${bvalid.version}-src">
<fileset dir=".">
<exclude name="dist/**"/>
</fileset>
</copy>
<replace file="dist/release/bvalid-${bvalid.version}-src/README.txt"
value="value not found in version.properties"
propertyFile="src/java/net/sf/bvalid/BValid.properties">
<replacefilter token="@bvalid.version@" property="bvalid.version"/>
</replace>
<zip zipfile="dist/release/bvalid-${bvalid.version}-src.zip" basedir="dist/release" includes="bvalid-${bvalid.version}-src/**"/>
<delete dir="dist/release/bvalid-${bvalid.version}-src"/>
</target>
<target name="binrelease" depends="dist,doc">
<copy todir="dist/release/bvalid-${bvalid.version}">
<fileset dir="dist">
<exclude name="release/**"/>
</fileset>
</copy>
<zip zipfile="dist/release/bvalid-${bvalid.version}.zip" basedir="dist/release" includes="bvalid-${bvalid.version}/**"/>
<delete dir="dist/release/bvalid-${bvalid.version}"/>
</target>
<target name="release" depends="srcrelease,binrelease" description="Build the source and binary distributions in dist/release">
<checksum fileext=".md5">
<fileset dir="dist/release">
<include name="*.zip"/>
</fileset>
</checksum>
</target>
<target name="doc"
depends="prep"
description="Build the documentation in dist/doc">
<copy todir="dist/doc">
<fileset dir="src/doc"/>
</copy>
<replace file="dist/doc/index.html"
value="value not found in version.properties"
propertyFile="src/java/net/sf/bvalid/BValid.properties">
<replacefilter token="@bvalid.version@" property="bvalid.version"/>
</replace>
<javadoc packagenames="net.sf.bvalid, net.sf.bvalid.locator, net.sf.bvalid.catalog, net.sf.bvalid.util"
classpathref="compile.path"
sourcepath="src/java"
defaultexcludes="yes"
destdir="dist/doc/api"
windowtitle="BValid Java API">
<doctitle><![CDATA[<h1>BValid Java API</h1>]]></doctitle>
</javadoc>
</target>
<target name="test" description="Run tests" depends="testclasses">
<junit printsummary="no" haltonfailure="yes" showoutput="true" filtertrace="true">
<formatter type="plain" usefile="false"/>
<classpath refid="test.path"/>
<sysproperty key="jetty.fork" value="false"/>
<test name="net.sf.bvalid.BValidPackageTestSuite"/>
</junit>
</target>
<target name="itest" description="Run tests interactively" depends="testclasses">
<java classname="net.sf.bvalid.BValidPackageTestSuite" fork="yes">
<classpath refid="test.path"/>
<sysproperty key="org.apache.commons.logging.LogFactory"
value="org.apache.commons.logging.impl.Log4jFactory"/>
<sysproperty key="org.apache.commons.logging.Log"
value="org.apache.commons.logging.impl.Log4JLogger"/>
<sysproperty key="log4j.ignoreTCL" value="true"/>
</java>
</target>
<target name="prep"
description="prepare for a build">
<mkdir dir="build"/>
<mkdir dir="dist"/>
</target>
<target name="clean"
description="remove all build-generated stuff">
<delete dir="build"/>
<delete dir="dist"/>
</target>
</project>