forked from bwagner/LiblouisSaxonExtension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
122 lines (102 loc) · 4.03 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="LibLouisSaxonExtension" default="default" basedir=".">
<!-- Copyright (C) 2010 Swiss Library for the Blind, Visually Impaired and Print Disabled -->
<!-- This file is part of LiblouisSaxonExtension. -->
<!-- LiblouisSaxonExtension 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/>. -->
<!--
TODO:
- separate jars for app and factory.
- identify commonalities
- (for now they're both in ${app.jar})
-->
<property name="build.dir" value="bin" />
<property name="app.name" value="LiblouisSaxonExtension" />
<property name="app.jar" value="liblouissaxonx.jar" />
<property name="factory.jar" value="liblouissaxonxfactory.jar" />
<property name="src.dir" value="src" />
<property name="test_src.dir" value="test_src" />
<property name="lib.dir" value="lib" />
<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="${app.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>
<!-- please note that this test fails when run from within eclipse! -->
<target name="test" depends="compile" description="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>
<target name="clean" description="clean">
<delete dir="${build.dir}" />
<delete file="${app.jar}" />
<delete file="${factory.jar}" />
<delete file="utfx_log.xml" />
</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>
</project>