-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
118 lines (98 loc) · 3.91 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="liblouis-javabindings" default="default" basedir=".">
<!-- Copyright (C) 2010 Swiss Library for the Blind, Visually Impaired and Print Disabled -->
<!-- This file is part of liblouis-javabindings. -->
<!-- liblouis-javabindings 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/>. -->
<!--
NOTE: the "zip" target assumes that ${ant.project.name} is equal to the
directory name of this project.
-->
<property name="app.jar" value="louis.jar" />
<property name="fat.jar" value="louisFat.jar" />
<property name="main.class" value="org.liblouis.Louis" />
<property name="dist.zip" value="${ant.project.name}.zip" />
<property name="build.dir" value="bin" />
<property name="src.dir" value="src" />
<property name="test_src.dir" value="test_src" />
<property name="junit.jar" value="junit-4.8.2.jar" />
<property name="lib.dir" value="lib" />
<path id="classpath.path">
<pathelement location="${build.dir}" />
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<presetdef name="my.javac">
<javac includeantruntime="false" />
</presetdef>
<target name="default" depends="jar" />
<target name="jar" depends="compile" description="make jar of only our classes">
<jar jarfile="${app.jar}" basedir="${build.dir}" includes="**/*.class" excludes="**/*Test.class" />
</target>
<target name="fatjar" depends="jar" description="make jar of classes and includes 3rd party jars">
<property name="tmp" location="tmp"/>
<delete dir="${tmp}"/>
<mkdir dir="${tmp}"/>
<unjar dest="${tmp}">
<fileset dir="${lib.dir}">
<exclude name="**/${junit.jar}"/>
</fileset>
</unjar>
<unjar src="${app.jar}" dest="${tmp}"/>
<jar jarfile="${fat.jar}" basedir="${tmp}" >
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
</manifest>
</jar>
<delete dir="${tmp}"/>
</target>
<target name="compile">
<mkdir dir="${build.dir}"/>
<my.javac srcdir="${src.dir}:${test_src.dir}" destdir="${build.dir}" deprecation="on" debug="on" target="1.5">
<classpath>
<path refid="classpath.path" />
</classpath>
</my.javac>
</target>
<target name="zip" description="creates a zip file of sources and lib needed to compile">
<delete file="${dist.zip}" />
<zip destfile="${dist.zip}" basedir=".."
includes="${ant.project.name}/**"
excludes="**/${app.jar}, **/${fat.jar}, **/.git/**, **/*.class, **/${dist.zip}, **/bin/**, **/.settings/**, **/${junit.jar}"
update="false">
</zip>
</target>
<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}/${junit.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="${fat.jar}" />
</target>
</project>