-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.xml
98 lines (83 loc) · 3.26 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
<project name="nla-browse-handler" default="build" basedir=".">
<property name="builddir" location="build"/>
<property name="build.sysclasspath" value="last"/>
<property name="solr.war" value="../solr/jetty/webapps/solr.war"/>
<property name="solr.dir" value="../solr/jetty/webapps/solr/"/>
<path id="classpath">
<pathelement location="${builddir}/common"/>
<fileset dir="${builddir}/deps/"><include name="**/*.jar"/></fileset>
<fileset dir="libs"><include name="**/*.jar"/></fileset>
<fileset erroronmissingdir="false" dir="${solr.dir}"><include name="**/*.jar"/></fileset>
</path>
<target name="setup">
<mkdir dir="${builddir}"/>
<mkdir dir="${builddir}/deps"/>
<mkdir dir="${builddir}/bundled-deps"/>
<antcall target="setup-solr-war"/>
</target>
<target name="setup-solr-war" if="solr.war">
<unwar src="${solr.war}" dest="${builddir}/deps/"/>
</target>
<target name="build" depends="clean, setup, build-common, build-handler, build-indexing">
</target>
<target name="build-common">
<mkdir dir="${builddir}/common"/>
<javac debug="on" srcdir="common/java" destdir="${builddir}/common">
<classpath refid="classpath"/>
<compilerarg value="-Xlint"/>
</javac>
<exec executable="sh" output="${builddir}/common/VERSION">
<arg value="-c"/>
<arg value="which git >/dev/null 2>&1 && git log --oneline -1"/>
</exec>
</target>
<target name="build-handler">
<mkdir dir="${builddir}/browse-handler"/>
<javac debug="on" srcdir="browse-handler/java" destdir="${builddir}/browse-handler">
<classpath refid="classpath"/>
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="build-indexing">
<mkdir dir="${builddir}/browse-indexing"/>
<javac debug="on" srcdir="browse-indexing/" destdir="${builddir}/browse-indexing">
<classpath refid="classpath"/>
<compilerarg value="-Xlint"/>
</javac>
</target>
<target name="clean">
<delete dir="${builddir}"/>
<delete file="browse-handler.jar"/>
<delete file="browse-indexing.jar"/>
</target>
<target name="bundledeps" if="bundle.deps">
<copy todir="${builddir}/bundled-deps">
<fileset dir="libs">
<include name="icu4j-49.1.jar"/>
<include name="marc4j.jar"/>
<include name="sqlitejdbc-v053.jar"/>
</fileset>
</copy>
</target>
<target name="jars" depends="build,bundledeps">
<jar destfile="browse-handler.jar">
<fileset dir="${builddir}/browse-handler/"/>
<fileset dir="${builddir}/common/"/>
</jar>
<jar destfile="browse-indexing.jar">
<fileset dir="${builddir}/browse-indexing/"/>
<fileset dir="${builddir}/common/"/>
<zipgroupfileset dir="${builddir}/deps/" includes="**/lucene-core*.jar"/>
<zipgroupfileset dir="libs">
<include name="commons-codec-1.5.jar"/>
</zipgroupfileset>
<zipgroupfileset dir="${builddir}/bundled-deps" includes="*.jar"/>
</jar>
</target>
<target name="test" depends="build">
<exec executable="sh">
<arg value="-c" />
<arg value="java -Dfile.encoding=UTF-8 -cp 'build/deps/WEB-INF/lib/*:build/common:build/browse-indexing:build/browse-handler:libs/*:' clojure.main tests/tests.clj 2>/dev/null" />
</exec>
</target>
</project>