-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
100 lines (95 loc) · 3.82 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="help" name="mishnah" xmlns:if="ant:if">
<property name="project.version" value="0.1"/>
<property name="project.app" value="mishnah-data"/>
<property file="local.build.properties"/>
<target name="help">
<!-- Tell user to either get data from eXist or send it there -->
<echo message="Use `ant get` to save db data to the file system `ant updatedb` [updates db from file system]"/>
<echo message="Use `ant updatedb` to update db from file system"/>
</target>
<target name="get">
<path id="classpath.core">
<fileset dir="${exist.home}/lib/core">
<include name="*.jar"/>
</fileset>
<pathelement path="${exist.home}/exist.jar"/>
<pathelement path="${exist.home}/exist-optional.jar"/>
</path>
<typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
<classpath refid="classpath.core"/>
</typedef>
<condition property="exists">
<xdb:exist xmlns:xdb="http://exist-db.org/ant"
uri="${exist.db}/digitalmishnah-tei" />
</condition>
<echo if:set="exists" message="Copying data from eXist DB"/>
<xdb:extract if:set="exists" xmlns:xdb="http://exist-db.org/ant"
uri="${exist.db}/digitalmishnah-tei"
destdir="." subcollections="true" createdirectories="true"/>
</target>
<target name="updatedb">
<path id="classpath.core">
<fileset dir="${exist.home}/lib/core">
<include name="*.jar"/>
</fileset>
<pathelement path="${exist.home}/exist.jar"/>
<pathelement path="${exist.home}/exist-optional.jar"/>
</path>
<typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant">
<classpath refid="classpath.core"/>
</typedef>
<condition property="exists">
<xdb:exist xmlns:xdb="http://exist-db.org/ant"
uri="${exist.db}/digitalmishnah-tei" />
</condition>
<input
if:set="exists"
message="All previously existing data will is going to be deleted from DB continue (y/n)?"
validargs="y,n"
addproperty="do.delete"/>
<condition if:set="exists" property="do.abort">
<equals arg1="n" arg2="${do.delete}"/>
</condition>
<fail if="do.abort">Build aborted by user.</fail>
<xdb:remove
if:set="exists" xmlns:xdb="http://exist-db.org/ant"
uri="${exist.db}" collection="digitalmishnah-tei"
user="${exist.user}"
password="${exist.pass}"
failonerror="true"/>
<xdb:store xmlns:xdb="http://exist-db.org/ant"
uri="${exist.db}/digitalmishnah-tei/mishnah"
createcollection="true"
createsubcollections="true"
user="${exist.user}"
password="${exist.pass}"
failonerror="true">
<fileset dir="mishnah">
<exclude name="*.bak" />
</fileset>
</xdb:store>
<xdb:store xmlns:xdb="http://exist-db.org/ant"
uri="${exist.db}/digitalmishnah-tei/standoff"
createcollection="true"
createsubcollections="true"
user="${exist.user}"
password="${exist.pass}"
failonerror="true">
<fileset dir="standoff">
<exclude name="*.bak" />
</fileset>
</xdb:store>
<xdb:store xmlns:xdb="http://exist-db.org/ant"
uri="${exist.db}/digitalmishnah-tei/tosefta"
createcollection="true"
createsubcollections="true"
user="${exist.user}"
password="${exist.pass}"
failonerror="true">
<fileset dir="tosefta">
<exclude name="*.bak" />
</fileset>
</xdb:store>
</target>
</project>