-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
161 lines (140 loc) · 5.16 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
161
<project name="sparql-check" default="jar">
<description>sparql-check</description>
<!-- Allow property overriding -->
<property file=".ant.properties"/>
<property file="${user.home}/.ant.properties"/>
<property file="version.properties"/>
<property name="build" value="./build"/>
<property name="build.classes" value="${build}/classes"/>
<property name="build.tests" value="${build}/tests"/>
<property name="build.dist" value="${build}/dist"/>
<property name="build.dist.lib" value="${build}/dist/lib"/>
<!-- Project Directories -->
<property name="java.dir" value="src/main"/>
<property name="test.dir" value="src/tests"/>
<property name="docs.dir" value="${build}/docs"/>
<property name="javadoc.dir" value="${docs.dir}/api"/>
<property name="lib.dir" value="lib"/>
<property name="reports" value="${build}/reports"/>
<property name="reports.junit" value="${reports}/junit"/>
<property name="etc.dir" value="etc"/>
<!-- Java Build Properties -->
<property name="debug" value="on"/>
<property name="optimize" value="on"/>
<property name="deprecation" value="on"/>
<property name="nowarn" value="on"/>
<property name="app.name" value="sparql-check"/>
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<path id="test.classpath">
<path refid="classpath" />
<pathelement location="${build.classes}"/>
</path>
<path id="unit-test.classpath">
<path refid="classpath" />
<pathelement location="${build.classes}"/>
<pathelement location="${build.tests}"/>
</path>
<target name="clean" description="Clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir="${build}"/>
</delete>
</target>
<target name="init">
<mkdir dir="${build}" />
<mkdir dir="${build.dist}"/>
<mkdir dir="${build.classes}" />
<mkdir dir="${build.tests}" />
<mkdir dir="${reports}"/>
</target>
<target name="build" depends="init" description="Compile the application">
<javac srcdir="${java.dir}"
destdir="${build.classes}"
debug="${debug}"
optimize="${optimize}"
deprecation="${deprecation}"
nowarn="${nowarn}">
<classpath refid="classpath"/>
</javac>
</target>
<target name="build.tests" depends="build" description="Compile the tests">
<javac srcdir="${test.dir}"
destdir="${build.tests}"
debug="${debug}"
optimize="${optimize}"
deprecation="${deprecation}"
nowarn="${nowarn}">
<classpath refid="test.classpath"/>
</javac>
<copy todir="${build.tests}" >
<fileset dir="${test.dir}" excludes="**/*.java"/>
</copy>
</target>
<target name="build.all" depends="build, build.tests" description="Compile app and tests">
</target>
<target name="javadoc" description="Generate javadocs">
<javadoc
defaultexcludes="yes"
destdir="${javadoc.dir}"
author="true"
version="true"
use="true"
windowtitle="${app.name} API">
<fileset dir="${java.dir}" defaultexcludes="yes">
<include name="**/*.java" />
</fileset>
</javadoc>
</target>
<target name="run-tests" depends="build.tests" description="run unit tests">
<mkdir dir="${reports.junit}"/>
<junit printsummary="yes" fork="yes" haltonerror="yes" haltonfailure="yes">
<sysproperty key="file.encoding" value="UTF-8" />
<classpath refid="unit-test.classpath"/>
<formatter type="xml"/>
<batchtest haltonfailure="no" todir="${reports.junit}">
<fileset dir="${build.tests}">
<include name="**/*AllTest*"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="jar" depends="build" description="make jar file">
<!--
<pathconvert property="jar.classpath">
<path refid="classpath"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="lib/*"/>
</chainedmapper>
</pathconvert>
-->
<manifestclasspath property="jar.classpath"
jarfile="${app.name}.jar">
<classpath refid="classpath"/>
</manifestclasspath>
<manifest file="${build}/MANIFEST.MF">
<attribute name="Main-Class" value="com.ldodds.sparql.check.Main"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
</manifest>
<jar destfile="${app.name}.jar"
basedir="${build.classes}"
manifest="${build}/MANIFEST.MF">
</jar>
</target>
<target name="make-release" depends="clean, jar" description="make a numbered release">
<mkdir dir="${build.dist}"/>
<echo>Making src distribution</echo>
<zip destfile="${build.dist}/${app.name}-${version}-src.zip"
basedir="."
excludes="${build.dist}/**">
</zip>
<echo>Making binary distribution</echo>
<zip destfile="${build.dist}/${app.name}-${version}-bin.zip"
basedir="."
excludes="${build.dist}/**,${reports.dir}/**,src/**">
</zip>
</target>
</project>