-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
208 lines (188 loc) · 8 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="oaiprovider" default="dist" basedir=".">
<loadproperties srcFile="build.properties"/>
<property name="oaiprovider.version" value="1.2.2"/>
<path id="base.path">
<pathelement location="${lib.jrdf}"/>
<pathelement location="${lib.trippi}"/>
<pathelement location="${lib.xmlpull}"/>
<pathelement location="${lib.xpp}"/>
<pathelement location="${lib.httpclient}"/>
<pathelement location="${lib.codec}"/>
<pathelement location="${lib.logging}"/>
<pathelement location="${lib.log4j}"/>
<pathelement location="${lib.xerces}"/>
<pathelement location="${lib.xml-apis}"/>
<pathelement location="${lib.axis}"/>
<pathelement location="${lib.activation}"/>
<pathelement location="${lib.wsdl4j}"/>
<pathelement location="${lib.discovery}"/>
<pathelement location="${lib.dbcp}"/>
<pathelement location="${lib.collections}"/>
<pathelement location="${lib.pool}"/>
<pathelement location="${lib.fedoraclient}"/>
<pathelement location="${lib.saaj}"/>
<pathelement location="${lib.jaxrpc}"/>
<pathelement location="${lib.proai}"/>
<pathelement location="${lib.mysqljdbc}"/>
<pathelement location="${lib.postgresjdbc}"/>
<pathelement location="${lib.bvalid}"/>
<pathelement location="${lib.mptstore}"/>
</path>
<path id="compile.path">
<path refid="base.path"/>
<pathelement location="${lib.junit}"/>
</path>
<path id="compiletests.path">
<path refid="compile.path"/>
<pathelement location="build/classes"/>
</path>
<path id="test.path">
<path refid="compiletests.path"/>
<pathelement location="build/testclasses"/>
</path>
<target name="binrelease" depends="dist, doc">
<copy todir="dist/release/oaiprovider-${oaiprovider.version}">
<fileset dir="dist">
<exclude name="release/**"/>
</fileset>
</copy>
<zip zipfile="dist/release/oaiprovider-${oaiprovider.version}.zip" basedir="dist/release" includes="oaiprovider-${oaiprovider.version}/**"/>
<delete dir="dist/release/oaiprovider-${oaiprovider.version}"/>
</target>
<target name="srcrelease" depends="clean">
<copy todir="dist/release/oaiprovider-${oaiprovider.version}-src">
<fileset dir=".">
<exclude name="dist/**"/>
</fileset>
</copy>
<zip zipfile="dist/release/oaiprovider-${oaiprovider.version}-src.zip" basedir="dist/release" includes="oaiprovider-${oaiprovider.version}-src/**"/>
<delete dir="dist/release/oaiprovider-${oaiprovider.version}-src"/>
</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="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"
optimize="${optimize}" debug="${debug}"/>
<copy todir="build/classes">
<fileset dir="src/config"/>
</copy>
</target>
<target name="testclasses"
depends="classes">
<mkdir dir="build/testclasses"/>
<javac srcdir="src/test/junit" destdir="build/testclasses"
includes="**"
classpathref="compiletests.path"
optimize="${optimize}" debug="${debug}"/>
</target>
<target name="testobjects"
depends="testclasses">
<java classname="fedora.services.oaiprovider.GenerateTestObjects">
<arg value="src/test/foxml"/>
<arg value="2500"/>
<classpath>
<pathelement location="build/testclasses"/>
</classpath>
</java>
</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="junit.jar"/>
</fileset>
</copy>
<jar jarfile="dist/oaiprovider.war" basedir="build/webapp"/>
</target>
<target name="javadoc"
depends="prep"
description="Build the documentation in dist/doc/api">
<javadoc packagenames="fedora.services.oaiprovider.*"
classpathref="compile.path"
sourcepath="src/java"
defaultexcludes="yes"
destdir="dist/doc/api"
use="true"
windowtitle="Fedora OAI Provider Javadocs">
<doctitle><![CDATA[<h1>Fedora OAI Provider Javadocs</h1>]]></doctitle>
</javadoc>
</target>
<target name="doc" depends="prep" description="Build the user docs in dist/doc">
<mkdir dir="dist/doc"/>
<copy todir="dist/doc">
<fileset dir="src/doc"/>
</copy>
<java classpath="${lib.propstodocs}" classname="PropsToDocs" output="dist/doc/configuration.html">
<arg path="src/config/proai.properties"/>
</java>
</target>
<target name="test" description="Run tests" depends="testclasses">
<!--
For this task to run, prior to running ant, set CLASSPATH=lib\junit.jar
-->
<junit printsummary="yes" fork="yes" forkmode="once" haltonfailure="yes" showoutput="true">
<formatter type="plain" usefile="false"/>
<classpath refid="test.path"/>
<sysproperty key="driver.fedora.baseURL" value="http://localhost:8080/fedora/"/>
<sysproperty key="driver.fedora.user" value="fedoraAdmin"/>
<sysproperty key="driver.fedora.pass" value="fedoraAdmin"/>
<sysproperty key="driver.fedora.identify" value="http://localhost:8080/fedora/get/demo:MyRepository/Identify.xml"/>
<sysproperty key="driver.fedora.md.formats" value="oai_dc"/>
<sysproperty key="driver.fedora.md.format.oai_dc.loc" value="http://www.openarchives.org/OAI/2.0/oai_dc.xsd"/>
<sysproperty key="driver.fedora.md.format.oai_dc.uri" value="http://www.openarchives.org/OAI/2.0/oai_dc/"/>
<sysproperty key="driver.fedora.md.format.oai_dc.dissType" value="info:fedora/*/oai_dc"/>
<sysproperty key="driver.fedora.itemID" value="http://www.openarchives.org/OAI/2.0/itemID"/>
<sysproperty key="driver.fedora.setSpec" value="http://www.openarchives.org/OAI/2.0/setSpec"/>
<sysproperty key="driver.fedora.setSpec.name" value="http://www.openarchives.org/OAI/2.0/setName"/>
<sysproperty key="driver.fedora.setSpec.desc.dissType" value="info:fedora/*/SetInfo.xml"/>
<sysproperty key="driver.fedora.queryFactory" value="fedora.services.oaiprovider.ITQLQueryFactory"/>
<sysproperty key="driver.fedora.itemSetSpecPath" value="$item <urn:test> $setSpec"/>
<sysproperty key="driver.fedora.queryConnectionTimeout" value="10000"/>
<sysproperty key="driver.fedora.querySocketTimeout" value="10000"/>
<sysproperty key="driver.fedora.disseminationConnectionTimeout" value="10000"/>
<sysproperty key="driver.fedora.disseminationSocketTimeout" value="10000"/>
<test name="fedora.services.oaiprovider.TestFedoraOAIDriver"/>
<!--
<test name="fedora.services.oaiprovider.TestResultCombiner"/>
<test name="fedora.services.oaiprovider.TestITQLQueryFactory"/>
-->
</junit>
</target>
<target name="liveTests" description="Run all live system tests" depends="testclasses">
<junit printsummary="yes" fork="yes" forkmode="once" haltonfailure="yes" showoutput="true">
<formatter type="plain" usefile="false"/>
<classpath refid="test.path"/>
<test name="fedora.services.oaiprovider.AllLiveTests"/>
</junit>
</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>