forked from fcrepo3/proai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
213 lines (198 loc) · 8.42 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?xml version="1.0" encoding="UTF-8"?>
<project name="proai" default="dist" basedir=".">
<!-- defines build options and lib paths -->
<loadproperties srcFile="build.properties"/>
<!-- defines proai.version -->
<loadproperties srcFile="src/java/proai/Proai.properties"/>
<path id="base.path">
<pathelement location="${lib.bvalid}"/>
<pathelement location="${lib.log4j}"/>
<pathelement location="${lib.dbcp}"/>
<pathelement location="${lib.collections}"/>
<pathelement location="${lib.pool}"/>
</path>
<path id="compile.path">
<path refid="base.path"/>
<pathelement location="${lib.servlet}"/>
<pathelement location="${lib.junit}"/>
</path>
<path id="test.path">
<path refid="compile.path"/>
<pathelement location="${lib.codec}"/>
<pathelement location="${lib.httpclient}"/>
<pathelement location="${lib.logging}"/>
<pathelement location="${lib.mckoidb}"/>
<pathelement location="${lib.mckoijdbc}"/>
<pathelement location="${lib.mysqljdbc}"/>
<pathelement location="${lib.gnuregexp}"/>
<pathelement location="${lib.mysql-jdbc}"/>
<pathelement location="${lib.postgres-jdbc}"/>
<pathelement location="${lib.xerces}"/>
<pathelement location="build/classes"/>
</path>
<target name="classes"
depends="prep"
description="build all java classes into build/">
<mkdir dir="build/classes"/>
<javac srcdir="src/java" destdir="build/classes"
includes="**"
classpathref="compile.path"
source="${source}"
target="${target}"
optimize="${optimize}" debug="${debug}"/>
<copy todir="build/classes">
<fileset dir="src/config"/>
</copy>
<copy todir="build/classes/schemas">
<fileset dir="src/schemas"/>
</copy>
<copy file="src/java/proai/Proai.properties"
tofile="build/classes/proai/Proai.properties"/>
<propertyfile file="build/version.properties">
<entry key="buildDate" type="date" value="now"/>
</propertyfile>
<replace file="build/classes/proai/Proai.properties"
value="value not found in version.properties"
propertyFile="build/version.properties">
<replacefilter token="@buildDate@" property="buildDate"/>
</replace>
</target>
<target name="dist" depends="classes" description="Build the distribution in dist/">
<copy todir="build/webapp">
<fileset dir="src/webapp"/>
</copy>
<mkdir dir="build/webapp/WEB-INF/classes"/>
<copy todir="build/webapp/WEB-INF/classes">
<fileset dir="build/classes"/>
</copy>
<mkdir dir="build/webapp/WEB-INF/lib"/>
<copy todir="build/webapp/WEB-INF/lib">
<fileset dir="lib">
<exclude name="javax.servlet-2.3.jar"/>
<exclude name="junit.jar"/>
</fileset>
</copy>
<jar jarfile="dist/proai.war" basedir="build/webapp"/>
<jar jarfile="dist/proai-${proai.version}.jar" basedir="build/webapp/WEB-INF/classes" includes="proai/** dbspec.xml schemas/**"/>
</target>
<target name="doc"
depends="prep"
description="Build the documentation in dist/doc">
<javadoc packagenames="proai.*"
classpathref="compile.path"
sourcepath="src/java"
defaultexcludes="yes"
destdir="dist/doc/api"
windowtitle="Proai Javadocs">
<doctitle><![CDATA[<h1>Proai Javadocs</h1>]]></doctitle>
</javadoc>
<mkdir dir="dist/doc"/>
<copy todir="dist/doc">
<fileset dir="src/doc"/>
</copy>
<replace file="dist/doc/index.html"
token="@proai.version@"
value="${proai.version}"/>
<java classpath="${lib.propstodocs}" classname="PropsToDocs" output="dist/doc/configuration.html">
<arg path="src/config/proai.properties"/>
<arg value="Proai"/>
</java>
</target>
<target name="test" description="Run tests" depends="clean,classes">
<!--
For this task to run, prior to running ant, set CLASSPATH=lib\junit.jar
-->
<mkdir dir="build/test"/>
<mkdir dir="build/test/input"/>
<copy todir="build/test/input">
<fileset dir="src/test"/>
</copy>
<!--
-->
<mkdir dir="build/test/mckoi"/>
<copy todir="build/test/mckoi" file="src/config/mckoi.conf"/>
<!-- <junit printsummary="yes" fork="yes" forkmode="once" haltonfailure="yes" showoutput="true"> -->
<junit printsummary="yes" haltonfailure="yes" showoutput="true">
<formatter type="plain" usefile="false"/>
<!--
-->
<classpath refid="test.path"/>
<sysproperty key="proai.useTransactions" value="true"/>
<sysproperty key="proai.cacheBaseDir" value="${basedir}/build/test/cache"/>
<sysproperty key="proai.sessionBaseDir" value="${basedir}/build/test/sessions"/>
<sysproperty key="proai.secondsBetweenRequests" value="5"/>
<sysproperty key="proai.incompleteRecordListSize" value="2"/>
<sysproperty key="proai.incompleteSetListSize" value="2"/>
<sysproperty key="proai.incompleteIdentifierListSize" value="2"/>
<sysproperty key="proai.driverClassName"
value="proai.driver.impl.OAIDriverImpl"/>
<sysproperty key="proai.driverPollSeconds" value="120"/>
<!--
<sysproperty key="proai.db.url" value="jdbc:mysql://localhost/proai?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true"/>
<sysproperty key="proai.db.driverClassName" value="com.mysql.jdbc.Driver"/>
<sysproperty key="proai.db.url" value="jdbc:postgresql://localhost/proai"/>
<sysproperty key="proai.db.driverClassName" value="org.postgresql.Driver"/>
-->
<sysproperty key="proai.db.url" value="jdbc:mckoi:local://${basedir}/build/test/mckoi/mckoi.conf?create_or_boot=true"/>
<sysproperty key="proai.db.driverClassName" value="com.mckoi.JDBCDriver"/>
<sysproperty key="proai.db.username" value="proai"/>
<sysproperty key="proai.db.password" value="proai"/>
<sysproperty key="com.mckoi.JDBCDriver.ddlConverter" value="proai.util.McKoiDDLConverter"/>
<sysproperty key="com.mysql.jdbc.Driver.ddlConverter" value="proai.util.MySQLDDLConverter"/>
<sysproperty key="org.postgresql.Driver.ddlConverter" value="proai.util.PostgresDDLConverter"/>
<sysproperty key="proai.driver.simple.baseDir" value="${basedir}/build/test/input"/>
<sysproperty key="proai.driverPollingEnabled" value="true"/>
<sysproperty key="proai.maxWorkers" value="5"/>
<sysproperty key="proai.maxWorkBatchSize" value="10"/>
<sysproperty key="proai.maxFailedRetries" value="3"/>
<sysproperty key="proai.maxCommitQueueSize" value="120"/>
<sysproperty key="proai.maxRecordsPerTransaction" value="60"/>
<sysproperty key="proai.schemaDir" value="${basedir}/build/test/schemas"/>
<!--
<test name="proai.test.OAIDriverImplTest"/>
<test name="proai.test.RecordCacheTest"/>
-->
<test name="proai.test.ResponderTest"/>
</junit>
</target>
<target name="srcrelease" depends="clean">
<copy todir="dist/release/proai-${proai.version}-src">
<fileset dir=".">
<exclude name="dist/**"/>
</fileset>
</copy>
<replace file="dist/release/proai-${proai.version}-src/README.txt"
value="value not found in version.properties"
propertyFile="src/java/proai/Proai.properties">
<replacefilter token="@proai.version@" property="proai.version"/>
</replace>
<zip zipfile="dist/release/proai-${proai.version}-src.zip" basedir="dist/release" includes="proai-${proai.version}-src/**"/>
<delete dir="dist/release/proai-${proai.version}-src"/>
</target>
<target name="binrelease" depends="dist,doc">
<copy todir="dist/release/proai-${proai.version}">
<fileset dir="dist">
<exclude name="release/**"/>
</fileset>
</copy>
<zip zipfile="dist/release/proai-${proai.version}.zip" basedir="dist/release" includes="proai-${proai.version}/**"/>
<delete dir="dist/release/proai-${proai.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="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>