-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.xml
59 lines (52 loc) · 1.67 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="build-cleanup" name="Create distributable jar">
<!-- build input -->
<property name="main.class" value="org.delaunay.Demo" />
<property name="src.dir" value="${basedir}/src" />
<property name="lib.dir" value="${basedir}/lib" />
<!-- build output -->
<property name="dist.dir" value="${basedir}/dist" />
<property name="build.dir" value="${basedir}/build" />
<target name="clean">
<delete dir="${dist.dir}" failonerror="false" />
<delete dir="${build.dir}" failonerror="false" />
</target>
<target name="compile" depends="clean">
<mkdir dir="${build.dir}" />
<javac destdir="${build.dir}">
<src path="${src.dir}" />
<classpath>
<fileset dir="${lib.dir}" includes="**/*.jar" />
</classpath>
</javac>
</target>
<target name="unjar_deps" depends="compile">
<unzip dest="${build.dir}">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</unzip>
</target>
<target name="copy_deps" depends="compile">
<mkdir dir="${dist.dir}" />
<copy todir="${dist.dir}">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</copy>
</target>
<target name="build" depends="compile,copy_deps">
<mkdir dir="${dist.dir}" />
<jar destfile="${dist.dir}/delaunay.jar" duplicate="preserve">
<manifest>
<attribute name="Main-Class" value="${main.class}" />
<attribute name="Class-Path" value="." />
</manifest>
<fileset dir="${build.dir}" />
<fileset dir="${src.dir}" includes="**/*.java"/>
</jar>
</target>
<target name="build-cleanup" depends="build">
<delete dir="${build.dir}" failonerror="false" />
</target>
</project>