forked from romovs/amber
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
263 lines (240 loc) · 10.3 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<?xml version="1.0" ?>
<project name="hafen" default="deftgt">
<property name="name" value="ArdClient"/>
<property name="version" value="1.00.165"/>
<target name="build-env">
<mkdir dir="build" />
<!-- <mkdir dir="build/lib" /> -->
<mkdir dir="build/classes" />
<available property="has-res-jar" file="build/hafen-res.jar" />
<available property="has-buildinfo" file="build/classes/buildinfo" />
<available property="unpacked-lib" file="build/classes-lib" />
</target>
<target name="buildinfo" depends="build-env">
<exec executable="git" outputproperty="gitrev" failifexecutionfails="false">
<arg line="rev-parse HEAD" />
</exec>
<copy todir="build/classes">
<fileset dir="${basedir}" includes="changelog.txt"/>
</copy>
<echo file="build/classes/buildinfo">
git-rev = ${gitrev}
version = ${version}
</echo>
</target>
<target name="build-custom-res">
<delete dir="etc/res/built/" includes="**"/>
<exec executable="etc/res/hafen-layer-util.exe">
<arg value="ENCODE"/>
<arg value="etc/res/unbuilt/"/>
<arg value="etc/res/built/"/>
<arg value="etc/res/layers/hafen"/>
</exec>
</target>
<target name="hafen-client" depends="build-env">
<javac srcdir="src" destdir="build/classes" debug="on"
source="1.8" target="1.8" includeantruntime="no" encoding="UTF-8">
<classpath>
<pathelement path="lib/jogl.jar" />
<pathelement path="lib/gluegen-rt.jar" />
<pathelement path="lib/jglob.jar" />
<pathelement path="lib/junit.jar" />
<pathelement path="lib/HavenDiscord.jar" />
<pathelement path="lib/rxjava-1.1.5.jar" />
<pathelement path="lib/flogger-0.3.1.jar" />
<pathelement path="lib/flogger-system-backend-0.3.1.jar" />
<pathelement path="lib/sql-jdbc-3.26.0.jar" />
<pathelement path="lib/graal-sdk.jar" />
<pathelement path="lib/graaljs.jar" />
<pathelement path="lib/tregex.jar" />
<pathelement path="lib/truffle-api.jar" />
</classpath>
<compilerarg value="-Xlint:unchecked" />
<compilerarg value="-Xlint:-options" />
<!-- <compilerarg value="-Xbarda" /> -->
</javac>
<copy todir="build/classes">
<fileset dir="src" excludes="**/*.java" />
</copy>
<copy todir="build/classes/haven" file="etc/ressrv.crt" />
<copy todir="build/classes/haven" file="etc/authsrv.crt" />
<copy todir="build/classes/haven" file="etc/res-preload" />
<copy todir="build/classes/haven" file="etc/res-bgload" />
<copy todir="build/classes/haven" file="etc/icon.png" />
<!-- <copy todir="build" file="etc/grid_ids.txt" /> -->
<!-- <copy todir="build" file="CHANGELOG.txt" /> -->
<!-- <copy todir="build" file="lib/static.sqlite" /> -->
</target>
<target name="lib-classes" depends="build-env" unless="unpacked-lib">
<mkdir dir="build/classes-lib" />
<unjar src="lib/jglob.jar" dest="build/classes-lib">
<patternset excludes="META-INF/**" />
</unjar>
</target>
<target name="jar" depends="hafen-client,buildinfo,lib-classes">
<jar destfile="build/hafen.jar" update="true">
<fileset dir="build/classes" />
<fileset dir="build/classes-lib" />
<fileset file="changelog.txt" />
<manifest>
<attribute name="Main-Class" value="haven.MainFrame" />
<attribute name="Class-Path" value="jogl.jar gluegen-rt.jar amber-res.jar builtin-res.jar hafen-res.jar l10n.jar HavenDiscord.jar rxjava-1.1.5.jar rxjava-1.1.5-javadoc.jar sqlite-jdbc-3.26.0.jar flogger-0.3.1.jar flogger-system-backend-0.3.1.jar
jackson-core.jar graal-sdk.jar graaljs.jar tregex.jar truffle-api.jar" />
</manifest>
</jar>
<chmod file="build/hafen.jar" perm="a+x" />
</target>
<target name="res-jar" depends="build-env" unless="has-res-jar">
<get src="http://game.havenandhearth.com/java/builtin-res.jar" dest="lib/builtin-res.jar"
usetimestamp="true" />
<get src="http://game.havenandhearth.com/java/hafen-res.jar" dest="lib/hafen-res.jar"
usetimestamp="true" />
</target>
<target name="l10n-jar" depends="build-env">
<jar destfile="build/l10n.jar">
<fileset dir="." includes="l10n/*.properties" excludes="l10n/*_new.properties"/>
</jar>
</target>
<target name="custom-encode" depends="build-env">
<mkdir dir ="build/custom-res"/>
<java jar="lib/LayerUtil.jar" fork="true">
<arg line="-re custom-res build/custom-res"/>
</java>
</target>
<target name="custom-jar" depends="custom-encode">
<jar basedir="build/custom-res" destfile="build/pasta-res.jar"/>
<delete dir="build/custom-res"/>
</target>
<target name="scripts" depends="build-env">
<mkdir dir="build/scripts"/>
<copy todir="build/scripts">
<fileset dir="scripts/" includes="*">
</fileset>
</copy>
</target>
<target name="jars" depends="build-env, jar, res-jar, l10n-jar, custom-jar, scripts">
<copy todir="build">
<fileset dir="lib">
<include name="jogl.jar" />
<include name="gluegen-rt.jar" />
<include name="hafen-res.jar" />
<include name="builtin-res.jar" />
<include name="amber-res.jar" />
<include name="HavenDiscord.jar" />
<include name="rxjava-1.1.5.jar" />
<include name="rxjava-1.1.5-javadoc.jar" />
<include name="flogger-0.3.1.jar" />
<include name="flogger-system-backend-0.3.1.jar" />
<include name="sqlite-jdbc-3.26.0.jar"/>
<include name="graaljs.jar" />
<include name="graal-sdk.jar" />
<include name="jackson-core.jar" />
<include name="l10n.jar" />
<include name="tregex.jar" />
<include name="truffle-api.jar" />
</fileset>
<fileset dir="lib/jogl-natives" includes="*.jar">
</fileset>
</copy>
</target>
<target name="dist" depends="rebuild">
<zip destfile="${basedir}/${name}-${version}.zip" update="false">
<fileset dir="build" includes="*.jar,grid_ids.txt" excludes="*natives*.jar"/>
<fileset dir="${basedir}" includes="README, CHANGELOG, changelog.txt"/>
<fileset dir="lib/jogl-natives" includes="*.jar"/>
<fileset dir="etc" includes="*.bat,run.sh,run.command"/>
</zip>
<zip destfile="${basedir}/${name}-${version}-upd.zip" update="false">
<fileset dir="build" includes="amber-res.jar, hafen.jar, l10n.jar, builtin-res.jar, grid_ids.txt" />
<fileset dir="${basedir}" includes="CHANGELOG, changelog.txt"/>
</zip>
</target>
<target name="New Distribute">
<delete file="D:\GithubFolder\Ardenneslol.github.io\Hafen\amber-res.jar"/>
<delete file="D:\GithubFolder\Ardenneslol.github.io\Hafen\hafen.jar"/>
<delete file="D:\GithubFolder\Ardenneslol.github.io\Hafen\ArdClient.rar"/>
<copy todir="${basedir}">
<fileset dir="build/classes" includes="changelog.txt" />
</copy>
<zip destfile="D:\GithubFolder\Ardenneslol.github.io\Hafen\ArdClient.rar" update="true">
<fileset dir="build" includes="*.jar,grid_ids.txt, *.bat, changelog.txt, static.sqlite" excludes="chatlog.txt, *.log, *.dat"/>
</zip>
<copy todir="D:\GithubFolder\Ardenneslol.github.io\Hafen">
<fileset dir="build" includes="amber-res.jar, hafen.jar, l10n.jar" />
</copy>
</target>
<target name="New Beta Distribute">
<delete file="D:\GithubFolder\Ardenneslol.github.io\Hafen-Beta\amber-res.jar"/>
<delete file="D:\GithubFolder\Ardenneslol.github.io\Hafen-Beta\hafen.jar"/>
<copy todir="${basedir}">
<fileset dir="build/classes" includes="changelog.txt" />
</copy>
<copy todir="D:\GithubFolder\Ardenneslol.github.io\Hafen-Beta">
<fileset dir="build" includes="amber-res.jar, hafen.jar" />
</copy>
</target>
<target name="deftgt" depends="buildinfo, jars" />
<target name="run" depends="jars">
<java jar="build/hafen.jar" fork="true" />
</target>
<target name="clean">
<delete dir="build" />
</target>
<target name="rebuild" depends="clean, jars">
<copy todir="build/res">
<fileset dir="custom_res/"/>
<fileset dir="custom-res/"/>
</copy>
</target>
<target name="prep-update">
<copy todir="update">
<fileset dir="lib">
<include name="amber-res.jar" />
<include name="graaljs.jar" />
<include name="graal-sdk.jar" />
<include name="HavenDiscord.jar" />
<include name="jackson-core.jar" />
<include name="rxjava-1.1.5.jar" />
<include name="rxjava-1.1.5-javadoc.jar" />
<include name="tregex.jar" />
<include name="truffle-api.jar" />
<include name="jogl.jar" />
<include name="gluegen-rt.jar" />
<include name="hafen-res.jar" />
<include name="builtin-res.jar" />
<include name="flogger-0.3.1.jar" />
<include name="flogger-system-backend-0.3.1.jar" />
<include name="sqlite-jdbc-3.26.0.jar"/>
<include name="bcprov-jdk15on-160.jar"/>
<include name="abcl.jar"/>
<include name="abcl-contrib.jar"/>
</fileset>
<fileset dir="lib/jogl-natives" />
<fileset dir="build">
<include name="hafen.jar"/>
<include name="l10n.jar"/>
<include name="logging.properties"/>
<include name="static.sqlite"/>
<include name="grid_ids.txt"/>
<include name="amber-res.jar"/>
</fileset>
<fileset dir="build/classes">
<include name="changelog.txt" />
</fileset>
</copy>
<copy todir="update/scripts">
<fileset dir="build/scripts/" includes="**"/>
</copy>
</target>
<target name="update" depends="prep-update">
<exec executable="git" outputproperty="gitrev" failifexecutionfails="false">
<arg line="rev-parse HEAD" />
</exec>
<java jar="update/hafen-updater.jar" fork="true">
<arg value="hash"/>
<arg value="update/"/>
<arg value="${gitrev}"/>
</java>
<move file="ver" todir="update"/>
</target>
</project>