-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
160 lines (136 loc) · 5.44 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?xml version="1.0" encoding="UTF-8"?>
<project name="dtbook2sbsform" default="default" basedir=".">
<!-- Copyright (C) 2010 Swiss Library for the Blind, Visually Impaired and Print Disabled -->
<!-- This file is part of dtbook2sbsform. -->
<!-- dtbook2sbsform is free software: you can redistribute it -->
<!-- and/or modify it under the terms of the GNU Lesser General Public -->
<!-- License as published by the Free Software Foundation, either -->
<!-- version 3 of the License, or (at your option) any later version. -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -->
<!-- Lesser General Public License for more details. -->
<!-- You should have received a copy of the GNU Lesser General Public -->
<!-- License along with this program. If not, see -->
<!-- <http://www.gnu.org/licenses/>. -->
<property name="build.dir" value="bin" />
<property name="app.name" value="${ant.project.name}" />
<property name="utility.jar" value="linebreaker.jar" />
<property name="src.dir" value="src" />
<property name="test_src.dir" value="test_src" />
<property name="lib.dir" value="lib" />
<property name="zipfile" value="${app.name}.zip" />
<!-- used for utfx -->
<property name="testrunner" value="utfx.runner.TestRunner" />
<presetdef name="my.javac">
<javac includeantruntime="false" />
</presetdef>
<path id="classpath.path">
<pathelement location="${build.dir}" />
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<target name="init">
<mkdir dir="${build.dir}" />
</target>
<target name="default" depends="jar" />
<target name="jar" depends="compile, git.revision" description="build jar">
<jar jarfile="${utility.jar}" basedir="${build.dir}" includes="**/*.class" excludes="**/*Test.class">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Implementation-Version" value="${repository.version}" />
</manifest>
</jar>
</target>
<target name="compile" depends="init">
<my.javac destdir="${build.dir}" deprecation="on" debug="on" includeAntRuntime="no">
<src path="${src.dir}" />
<src path="${test_src.dir}" />
<classpath>
<path refid="classpath.path" />
</classpath>
</my.javac>
</target>
<target name="src_test" depends="compile" description="run src test">
<junit printsummary="yes" fork="yes" haltonfailure="no" haltonerror="no">
<formatter type="plain" usefile="false" />
<classpath>
<!-- classes to test -->
<pathelement location="${build.dir}" />
<!-- 3rd party libs -->
<pathelement location="${lib.dir}/jna.jar" />
<pathelement location="${lib.dir}/louis.jar" />
<pathelement location="${lib.dir}/saxon9he.jar" />
<!-- junit -->
<pathelement location="${lib.dir}/junit-4.8.2.jar" />
</classpath>
<batchtest>
<formatter type="plain" usefile="false" />
<fileset dir="${test_src.dir}">
<include name="**/*Test.java" />
</fileset>
</batchtest>
</junit>
</target>
<path id="runtime.classpath">
<pathelement location="lib/saxon9he.jar"/>
<pathelement location="lib/louis.jar"/>
<pathelement location="lib/jna.jar"/>
<pathelement location="lib/liblouissaxonx.jar"/>
<pathelement location="lib/utfxFat.jar"/>
<pathelement location="."/>
</path>
<target name="utfx" description="run utfx tests">
<java classname="${testrunner}" fork="yes">
<jvmarg value="-enableassertions" />
<jvmarg value="-Xmx128m" />
<jvmarg value="-Djavax.xml.transform.TransformerFactory=org.liblouis.transformerfactory.LouisExtensionTransformerFactoryImpl" />
<jvmarg value="-Dutfx.test.dir=test_xsl" />
<arg value="utfx.framework.XSLTRegressionTest" />
<classpath refid="runtime.classpath" />
</java>
</target>
<target name="test" depends="src_test, utfx" description="run src_test and utfx_tests"/>
<target name="clean" description="clean">
<delete dir="${build.dir}" />
<delete file="${utility.jar}" />
<delete file="utfx_log.xml" />
<delete file="${zipfile}" />
</target>
<available file=".git" type="dir" property="git.present" />
<target name="git.revision" description="Store git revision in ${repository.version}" if="git.present">
<exec executable="git" outputproperty="git.revision" failifexecutionfails="false" errorproperty="">
<arg value="describe" />
<arg value="--tags" />
<arg value="--always" />
<arg value="--dirty" />
</exec>
<condition property="repository.version" value="${git.revision}" else="unknown">
<and>
<isset property="git.revision" />
<length string="${git.revision}" trim="yes" length="0" when="greater" />
</and>
</condition>
</target>
<target name="dist" depends="jar"
description="Builds a zipfile containing everything needed to run the shell scripts">
<zip destfile="${zipfile}">
<zipfileset dir="${lib.dir}" prefix="${app.name}/${lib.dir}">
<include name="*.jar"/>
</zipfileset>
<zipfileset dir="." prefix="${app.name}">
<include name="*.jar"/>
<include name="COPYING.LESSER"/>
<include name="README"/>
</zipfileset>
<zipfileset dir="." prefix="${app.name}" filemode="755">
<include name="*.sh"/>
<exclude name="utfx.sh"/>
</zipfileset>
<zipfileset dir="xsl" prefix="${app.name}/xsl">
<include name="dtbook2sbsform.xsl"/>
</zipfileset>
</zip>
</target>
</project>