-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.xml
215 lines (184 loc) · 6.58 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<project default="all" name="Build LWJake2">
<!-- Delete the output directories -->
<target name="clean">
<delete dir="built"/>
</target>
<!-- Classpath list for javac compiling -->
<path id="libPath">
<pathelement location="lib/lwjgl.jar"/>
<pathelement location="lib/lwjgl_util.jar"/>
<pathelement location="lib/flibitEFX.jar"/>
</path>
<!-- FindBugs task definition -->
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
<classpath>
<pathelement location="findbugs/findbugs-2.0.0/lib/findbugs.jar"/>
</classpath>
</taskdef>
<!-- Compile LWJake2 -->
<target name="compile" depends="clean">
<!-- Compile the source code with javac -->
<mkdir dir="built/javac"/>
<javac destdir="built/javac" debug="on" source="1.5" target="1.5" includeantruntime="false">
<src path="src"/>
<classpath refid="libPath"/>
</javac>
<!-- Build the LWJake2 jar -->
<mkdir dir="built/jar"/>
<jar destfile="built/jar/lwjake2.jar">
<manifest>
<attribute name="Main-Class" value="lwjake2.LWJake2"/>
<attribute name="Class-Path" value=". lwjgl.jar lwjgl_util.jar flibitEFX.jar"/>
</manifest>
<fileset dir="built/javac/"/>
</jar>
<!-- Run FindBugs on the current source -->
<findbugs
home="findbugs/findbugs-2.0.0/lib/"
output="html"
outputFile="built/bugs.html"
projectFile="findbugs/LWJake2.fbp"
excludeFilter="findbugs/LWJake2.fbf"
/>
</target>
<!-- Build GNU/Linux version of LWJake2 -->
<target name="linux" depends="compile">
<!-- Copy LWJake2 jar -->
<copy file="built/jar/lwjake2.jar" todir="built/Linux"/>
<!-- Copy libs -->
<copy todir="built/Linux">
<fileset dir="lib">
<include name="lwjgl.jar"/>
<include name="lwjgl_util.jar"/>
<include name="flibitEFX.jar"/>
</fileset>
</copy>
<!-- Copy licenses folder and README files -->
<copy todir="built/Linux/licenses">
<fileset dir="licenses"/>
</copy>
<copy file="README" todir="built/Linux"/>
<copy file="readme.id" todir="built/Linux"/>
<!-- Copy GNU/Linux executable file -->
<copy file="executables/LWJake2.sh" todir="built/Linux"/>
<!-- Copy GNU/Linux native libraries -->
<copy file="lib/lwjgl_native/liblwjgl.so" todir="built/Linux"/>
<copy file="lib/lwjgl_native/liblwjgl64.so" todir="built/Linux"/>
<copy file="lib/lwjgl_native/libopenal.so" todir="built/Linux"/>
<copy file="lib/lwjgl_native/libopenal64.so" todir="built/Linux"/>
<!-- Create the zip distribution -->
<mkdir dir="built/zip"/>
<zip destfile="built/zip/LWJake2-Linux.zip">
<zipfileset dir="built/Linux" prefix="LWJake2"/>
</zip>
</target>
<!-- Build OSX version of LWJake2 -->
<target name="osx" depends="compile">
<!-- Copy LWJake2 jar -->
<copy file="built/jar/lwjake2.jar" todir="built/OSX"/>
<!-- Copy libs -->
<copy todir="built/OSX">
<fileset dir="lib">
<include name="lwjgl.jar"/>
<include name="lwjgl_util.jar"/>
<include name="flibitEFX.jar"/>
</fileset>
</copy>
<!-- Copy licenses folder and README files -->
<copy todir="built/OSX/licenses">
<fileset dir="licenses"/>
</copy>
<copy file="README" todir="built/OSX"/>
<copy file="readme.id" todir="built/OSX"/>
<!-- Copy OSX executable file -->
<copy file="executables/LWJake2.sh" todir="built/OSX"/>
<!-- Copy OSX native libraries -->
<copy file="lib/lwjgl_native/liblwjgl.jnilib" todir="built/OSX"/>
<copy file="lib/lwjgl_native/openal.dylib" todir="built/OSX"/>
<!-- Create the zip distribution -->
<mkdir dir="built/zip"/>
<zip destfile="built/zip/LWJake2-OSX.zip">
<zipfileset dir="built/OSX" prefix="LWJake2"/>
</zip>
</target>
<!-- Build Windows version of LWJake2 -->
<target name="windows" depends="compile">
<!-- Copy LWJake2 jar -->
<copy file="built/jar/lwjake2.jar" todir="built/Windows"/>
<!-- Copy libs -->
<copy todir="built/Windows">
<fileset dir="lib">
<include name="lwjgl.jar"/>
<include name="lwjgl_util.jar"/>
<include name="flibitEFX.jar"/>
</fileset>
</copy>
<!-- Copy licenses folder and README files -->
<copy todir="built/Windows/licenses">
<fileset dir="licenses"/>
</copy>
<copy file="README" todir="built/Windows"/>
<copy file="readme.id" todir="built/Windows"/>
<!-- Copy Windows executable file -->
<copy file="executables/LWJake2.bat" todir="built/Windows"/>
<!-- Copy Windows native libraries -->
<copy file="lib/lwjgl_native/lwjgl.dll" todir="built/Windows"/>
<copy file="lib/lwjgl_native/lwjgl64.dll" todir="built/Windows"/>
<copy file="lib/lwjgl_native/OpenAL32.dll" todir="built/Windows"/>
<copy file="lib/lwjgl_native/OpenAL64.dll" todir="built/Windows"/>
<!-- Create the zip distribution -->
<mkdir dir="built/zip"/>
<zip destfile="built/zip/LWJake2-Windows.zip">
<zipfileset dir="built/Windows" prefix="LWJake2"/>
</zip>
</target>
<!-- Build the server version of LWJake2 -->
<target name="server" depends="compile">
<!--Copy LWJake2 jar -->
<copy file="built/jar/lwjake2.jar" todir="built/Server"/>
<!-- Copy licenses folder and README files -->
<copy todir="built/Server/licenses">
<fileset dir="licenses"/>
</copy>
<copy file="README" todir="built/Server"/>
<copy file="readme.id" todir="built/Server"/>
<!-- Copy executable files -->
<copy file="executables/LWJake2_Server.sh" todir="built/Server"/>
<copy file="executables/LWJake2_Server.bat" todir="built/Server"/>
<!-- Create the zip distribution -->
<mkdir dir="built/zip"/>
<zip destfile="built/zip/LWJake2-Server.zip">
<zipfileset dir="built/Server" prefix="LWJake2"/>
</zip>
</target>
<!-- Build the source distribution -->
<target name="srcdist" depends="clean">
<mkdir dir="built/srcdist"/>
<tar destfile="built/srcdist/LWJake2-src.tar.gz" compression="gzip">
<tarfileset dir="executables" prefix="LWJake2/executables"/>
<tarfileset dir="findbugs" prefix="LWJake2/findbugs"/>
<tarfileset dir="lib" prefix="LWJake2/lib"/>
<tarfileset dir="licenses" prefix="LWJake2/licenses"/>
<tarfileset dir="src" prefix="LWJake2/src"/>
<tarfileset dir="." prefix="LWJake2">
<include name="build.xml"/>
<include name="README"/>
<include name="readme.id"/>
</tarfileset>
</tar>
<zip destfile="built/srcdist/LWJake2-src.zip">
<zipfileset dir="." prefix="LWJake2">
<include name="executables/**"/>
<include name="findbugs/**"/>
<include name="lib/**"/>
<include name="licenses/**"/>
<include name="src/**"/>
<include name="build.xml"/>
<include name="README"/>
<include name="readme.id"/>
</zipfileset>
</zip>
</target>
<target name="all" depends="linux,osx,windows,server,srcdist">
</target>
</project>