-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
89 lines (79 loc) · 3.49 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="xar" name="odd-validation">
<!-- import default properties from file -->
<property file="local.build.properties"/>
<property file="build.properties"/>
<!-- ANT contrib -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<target name="all" depends="xar"/>
<target name="rebuild" depends="clean,all"/>
<target name="clean">
<delete dir="${dist.dir}"/>
<delete file="expath-pkg.xml"/>
</target>
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="download-tei-schemas" depends="init">
<mkdir dir="${dist.dir}/tmp"/>
<propertyselector property="schema.list" delimiter="," match="tei_all\.\d\.\d\.\d"/>
<foreach delimiter="," list="${schema.list}" target="call-download" param="file.name"/>
</target>
<target name="download-tei-p5sources" depends="init">
<mkdir dir="${dist.dir}/tmp"/>
<propertyselector property="p5sources.list" delimiter="," match="p5subset\.\d\.\d\.\d"/>
<foreach delimiter="," list="${p5sources.list}" target="call-download" param="file.name"/>
</target>
<target name="call-download">
<propertycopy name="url" from="${file.name}" />
<get dest="${dist.dir}/tmp/${file.name}" skipexisting="yes" src="${url}"/>
<!--<echo message="${schema.url}" />-->
</target>
<target name="dist" depends="init, download-tei-schemas, download-tei-p5sources">
<copy file="expath-pkg.xml.tmpl" tofile="${dist.dir}/expath-pkg.xml" filtering="true" overwrite="true">
<filterset>
<filter token="project.version" value="${project.version}"/>
<filter token="project.abbrev" value="${project.abbrev}"/>
<filter token="project.app" value="${project.app}"/>
</filterset>
</copy>
<!-- Copy everything from base.dir -->
<copy todir="${dist.dir}">
<fileset dir=".">
<include name="*.*"/>
<include name="modules/**"/>
<include name="resources/**"/>
<include name="templates/**"/>
<exclude name="build.xml"/>
<exclude name="*build.properties"/>
<exclude name=".git*"/>
<exclude name="*.tmpl"/>
<exclude name="*.txt"/>
<exclude name="*.xpr"/>
<exclude name="bower.json"/>
</fileset>
</copy>
<!-- Copy downloaded files from tmp dir to final destination and add file extension suffix -->
<!-- Leave the files in tmp dir to not download them again with every build (Though if you want to, run `ant clean`) -->
<copy todir="${dist.dir}/schemas">
<fileset dir="${dist.dir}/tmp">
<include name="tei_all.*"/>
</fileset>
<globmapper from="*" to="*.rng"/>
</copy>
<copy todir="${dist.dir}/p5sources">
<fileset dir="${dist.dir}/tmp">
<include name="p5subset.*"/>
</fileset>
<globmapper from="*" to="*.xml"/>
</copy>
</target>
<target name="xar" depends="init, dist">
<zip destfile="${build.dir}/${project.abbrev}-${project.version}.xar">
<fileset dir="${dist.dir}">
<exclude name="tmp/**"/>
</fileset>
</zip>
</target>
</project>