-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
92 lines (80 loc) · 3.24 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="buildLyricalBallads" default="all">
<property name="debug" value="0"/>
<property name="host" value="https://dhil.lib.sfu.ca/lyrical-ballads"/>
<property environment="env"/>
<property name="tmp" value="${basedir}/tmp"/>
<property name="src.dir" value="${basedir}/ballad_data"/>
<property name="src.xml.dir" value="${src.dir}/data"/>
<property name="src.facs.dir" value="${src.dir}/facs"/>
<property name="dist.dir" value="${basedir}/public"/>
<property name="dist.xml.dir" value="${dist.dir}/xml"/>
<property name="dist.facs.dir" value="${dist.dir}/facs"/>
<property name="code.dir" value="${basedir}/static"/>
<property name="xsl.dir" value="${code.dir}/xsl"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="saxon.jar" value="${lib.dir}/saxon10HE.jar"/>
<target name="init">
<delete dir="${dist.dir}" failonerror="false"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="copyXML">
<description>Copies all of the necessary XML files over</description>
<mkdir dir="${dist.xml.dir}"/>
<copy todir="${dist.xml.dir}">
<fileset dir="${src.xml.dir}">
<include name="*.xml"/>
<exclude name="*.MODS.xml"/>
</fileset>
</copy>
</target>
<target name="copyFacs">
<description>Copies all of the facsimile files over</description>
<mkdir dir="${dist.facs.dir}"/>
<apply executable="convert" dest="${dist.facs.dir}">
<srcfile/>
<targetfile/>
<fileset dir="${src.facs.dir}">
<include name="*"/>
</fileset>
<globmapper from="*.png" to="*.jpg"/>
</apply>
</target>
<target name="assets">
<description>Copies over the site assets and processes them.</description>
<copy todir="${dist.dir}">
<fileset dir="${code.dir}">
<include name="**/**"/>
<exclude name="template.html"/>
<exclude name="xsl/**"/>
</fileset>
</copy>
<!--Need to prepend the sassDir so that if it's not installed,
it can still be run-->
<exec executable="sass" failOnError="true">
<arg line="${dist.dir}/scss:${dist.dir}/css"/>
</exec>
</target>
<target name="html">
<description>Converts all of the XML files to HTML.</description>
<exec executable="saxon">
<arg line="-xsl:${xsl.dir}/html_master.xsl"/>
<arg line="-it:go"/>
<arg line="dist=${dist.dir}"/>
<arg line="host=${host}"/>
</exec>
</target>
<target name="search">
<ant antfile="staticSearch/build.xml" inheritall="no">
<property name="ssConfigFile" value="${basedir}/staticSearch_config.xml"/>
</ant>
<exec executable="saxon">
<arg line="-xsl:${xsl.dir}/postprocess-search.xsl"/>
<arg line="-s:${dist.dir}/search.html"/>
<arg line="-o:${dist.dir}/search.tmp.html"/>
</exec>
<move file="${dist.dir}/search.tmp.html" tofile="${dist.dir}/search.html"/>
</target>
<target name="quick" depends="copyXML, assets, html"/>
<target name="all" depends="init, copyXML, copyFacs, assets, html, search"/>
</project>