This repository has been archived by the owner on Apr 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
75 lines (65 loc) · 2.5 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
<project name="exist-bcrypt" default="xar">
<property name="dist.dir" value="dist"/>
<property name="src.dir" value="src"/>
<property name="java.src.dir" value="${src.dir}/main/java"/>
<property name="test.src.dir" value="${src.dir}/test/java"/>
<property name="package.src.dir" value="${src.dir}/main/expath-pkg"/>
<property name="lib.dir" value="lib"/>
<property name="build.dir" value="build"/>
<property name="java.build.dir" value="${build.dir}/java"/>
<property name="exist.version" value="2.2"/>
<property name="exist.href" value="https://github.com/eXist-db/mvn-repo/blob/master/org/exist-db/existdb-core/${exist.version}/existdb-core-${exist.version}.jar?raw=true"/>
<property name="xmldb.href" value="http://xmldb.exist-db.org/resources/xmldb.jar"/>
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<condition property="haveLibs">
<and>
<available file="${lib.dir}/xmldb.jar"/>
<available file="${lib.dir}/exist-core.jar"/>
</and>
</condition>
<target name="dependencies" unless="${haveLibs}">
<mkdir dir="${lib.dir}"/>
<get src="${xmldb.href}" dest="${lib.dir}/xmldb.jar"/>
<get src="${exist.href}" dest="${lib.dir}/exist-core.jar"/>
</target>
<target name="compile" depends="dependencies">
<mkdir dir="${java.build.dir}"/>
<javac srcdir="${java.src.dir}" destdir="${java.build.dir}" classpathref="classpath"/>
</target>
<target name="compile-test" depends="compile">
<javac srcdir="${test.src.dir}" destdir="${java.build.dir}"/>
</target>
<target name="test" depends="compile-test">
<junit printsummary="on" showoutput="on" failureproperty="test-fail">
<classpath>
<pathelement path="${java.build.dir}"/>
<path refid="classpath"/>
</classpath>
<batchtest>
<fileset dir="${test.src.dir}" includes="**/*.java"/>
</batchtest>
</junit>
<fail if="test-fail"/>
</target>
<target name="jar" depends="compile">
<mkdir dir="${dist.dir}"/>
<jar basedir="${java.build.dir}" destfile="${dist.dir}/${ant.project.name}.jar"/>
</target>
<target name="xar" depends="jar">
<zip destfile="${dist.dir}/${ant.project.name}.xar">
<zipfileset dir="${package.src.dir}"/>
<zipfileset dir="${dist.dir}" includes="${ant.project.name}.jar" prefix="content"/>
</zip>
</target>
<target name="dist" depends="xar"/>
<target name="dist-xar" depends="xar"/>
<target name="all" depends="xar"/>
<target name="clean">
<delete dir="${dist.dir}"/>
<delete dir="${build.dir}"/>
</target>
</project>