-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.xml
94 lines (68 loc) · 3.5 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
<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- build file -->
<!-- ======================================================================= -->
<project name="nms-corba" default="jar" basedir=".">
<!-- ======================================================================= -->
<!-- Sets up property variables. Can be thought of as constants in script. -->
<!-- ======================================================================= -->
<property environment="env" />
<property name="src.dir" value="${basedir}/src/" />
<property name="lib.dir" value="${basedir}/lib/" />
<property name="build.dir" value="${basedir}/bin" />
<property name="build.classes.dir" value="${build.dir}" />
<property name="jarfile" value="nms-corba.jar" />
<property name="dist.dir" value="${basedir}/dist" />
<property name="dist.file" value="nms-corba.zip" />
<!-- Build classpath -->
<path id="classpath">
<pathelement location="${build.classes.dir}" />
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<property name="build.classpath" refid="classpath" />
<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare" description="Creates build directories">
<mkdir dir="${build.dir}" />
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${dist.dir}" />
</target>
<!-- =================================================================== -->
<!-- Compiles the source code -->
<!-- =================================================================== -->
<target name="compile" depends="prepare" description="Compiles source code to build directory">
<javac srcdir="${src.dir}" destdir="${build.classes.dir}" debug="on" deprecation="on" optimize="off" includes="**">
<classpath refid="classpath" />
</javac>
</target>
<!-- ======================================================================= -->
<!-- Creates jar files, ready for deployment -->
<!-- ======================================================================= -->
<target name="jar" depends="compile" description="Creates deployable jar file">
<jar jarfile="${dist.dir}/${jarfile}">
<fileset dir="${build.classes.dir}">
<include name="**/*.class" />
</fileset>
</jar>
</target>
<!-- ======================================================================= -->
<!-- Deploys application to server -->
<!-- ======================================================================= -->
<target name="package" depends="jar" description="Create package to distribute">
<delete file="${dist.dir}/${dist.file}" />
<zip destfile="${dist.dir}/${dist.file}">
<zipfileset dir="${basedir}" excludes=".git/, dist/, **/*.class"/>
<zipfileset file="${dist.dir}/${jarfile}" prefix="lib"/>
</zip>
</target>
<!-- =================================================================== -->
<!-- Cleans up generated stuff -->
<!-- =================================================================== -->
<target name="clean" description="Cleans build output, also undeploys application">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
</project>