-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
123 lines (108 loc) · 3.77 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
<?xml version="1.0"?>
<!--
$Revision: 1.69 $
$Date: 2003/12/13 12:39:08 $
$Author: billhorsman $
http://proxool.sourceforge.net
-->
<project name="Proxool" default="build-jar" basedir=".">
<!-- Where to build everything. You might want to override
this so that it isn't within your cvs tree. -->
<property name="build-dir" value="build"/>
<!-- Whether we include debug information in JAR file -->
<property name="debug" value="true"/>
<!-- Currect release, e.g. 0.6 -->
<property name="release" value="1.0.0"/>
<!-- Classpath -->
<path id="source" path="${build-dir}/classes">
<fileset dir="lib">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>
<!--
Build necessary directories
-->
<target
name="init"
>
<tstamp>
<format property="TODAY_FULL" pattern="dd-MMM-yyyy HH:mm zzz"/>
</tstamp>
<mkdir dir="${build-dir}/src/java" description="make source directory"/>
<mkdir dir="${build-dir}/etc"/>
<mkdir dir="${build-dir}/classes"/>
</target>
<target
name="clean"
description="Cleans build directory"
>
<delete dir="${build-dir}"/>
</target>
<target
name="build-src"
description="Gathers the source code together ready for compiling"
depends="clean,init"
>
<antcall target="build-src-core"/>
<antcall target="version-stamp"/>
</target>
<target
name="version-stamp"
description="Adds the version and build date to the Version class"
>
<replace
file="${build-dir}/src/java/org/logicalcobwebs/proxool/Version.java"
token="VERSION = null"
value='VERSION = "${release}"'
/>
<replace
file="${build-dir}/src/java/org/logicalcobwebs/proxool/Version.java"
token="BUILD_DATE = null"
value='BUILD_DATE = "${TODAY}"'
/>
</target>
<target
name="compile"
description="Compiles the code"
depends="init,build-src"
>
<javac srcdir="${build-dir}/src/java" destdir="${build-dir}/classes" debug="${debug}" source="1.8" target="1.8">
<classpath refid="source"/>
</javac>
<!-- Copy dtd's and properties into the compiled classes directory. -->
<copy todir="${build-dir}/classes">
<fileset dir="src/java" includes="**/*.dtd"/>
<fileset dir="src/java" includes="**/*.properties"/>
</copy>
</target>
<target
name="build-jar"
description="Compiles and builds the JAR file"
depends="init,build-src,compile"
>
<!-- Copy src into the compiled classes directory. -->
<copy todir="${build-dir}/classes/src" filtering="true">
<fileset dir="${build-dir}/src/java" includes="**/*.java,**/*.xml,**/*.properties,**/*.dtd"/>
</copy>
<manifest file="${build-dir}/etc/MANIFEST.MF">
<attribute name="Proxool-Version" value="${release}"/>
<attribute name="Date" value="${TODAY}"/>
</manifest>
<jar
jarfile="${build-dir}/proxool-${release}.jar"
basedir="${build-dir}/classes"
manifest="${build-dir}/etc/MANIFEST.MF"
/>
</target>
<target
name="build-src-core"
depends="init"
description="Build the core source (all that is required to run Proxool)"
>
<echo level="info" message="Using ${java.vm.vendor} ${java.vm.name} ${java.vm.version} in ${java.home}"/>
<copy todir="${build-dir}/src/java" preservelastmodified="yes">
<fileset dir="src/java" includes="**/*.java"/>
</copy>
</target>
</project>