-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
63 lines (56 loc) · 2.56 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
<?xml version="1.0"?>
<project name="network builder" default="jar" basedir=".">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="lib.dir" value="lib"/>
<property name="dist.dir" value="dist"/>
<property name="jar.name" value="build-network.jar"/>
<path id="class.path">
<pathelement location="${build.dir}"/>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="clean" description="Remove all generated files.">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="compile" depends="prepare" description="Compile sources">
<javac srcdir="${src.dir}"
includes="**"
destdir="${build.dir}"
debug="true">
<classpath refid="class.path"/>
</javac>
</target>
<target name="jar" depends="compile" description="Generates executable jar file">
<pathconvert refid="class.path" property="class.path.manifest" pathsep=" ">
<mapper>
<chainedmapper>
<!-- remove absolute path -->
<flattenmapper />
<!-- add lib/ prefix -->
<globmapper from="*" to="lib/*" />
</chainedmapper>
</mapper>
</pathconvert>
<jar jarfile="${jar.name}">
<manifest>
<attribute name="Class-Path" value="${class.path.manifest}"/>
</manifest>
<fileset dir="${build.dir}" includes="**/*.class"/>
</jar>
</target>
<target name="dist" depends="jar" description="Copies jar and external libraries to dist path">
<copy file="${jar.name}" toDir="${dist.dir}"/>
<copy toDir="${dist.dir}/lib">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</copy>
</target>
</project>