-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
194 lines (176 loc) · 7.05 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
<?xml version="1.0" ?>
<project name="haven" default="jars">
<property name="arch" value="linux-amd64"/> <!-- linux-amd64/linux-i586/windows-amd64/windows-i586 -->
<property name="name" value="anemone"/>
<tstamp>
<format property="built.date" pattern="dd.MM.yy" />
</tstamp>
<target name="build-env">
<mkdir dir="build" />
<mkdir dir="build/classes" />
<available property="has-res-jar" file="build/haven-res.jar" />
<available property="has-buildinfo" file="build/classes/buildinfo" />
<available property="unpacked-lib" file="build/classes-lib" />
</target>
<target name="pre-src">
<copy file="pre-src/haven/Version.java" toFile="src/haven/Version.java" overwrite="true">
<filterset>
<filter token="DATE" value="${built.date}"/>
</filterset>
</copy>
</target>
<target name="buildinfo" depends="build-env" unless="has-buildinfo">
<exec executable="git" outputproperty="gitrev" failifexecutionfails="false">
<arg line="rev-parse HEAD" />
</exec>
<echo file="build/classes/buildinfo" xml:space="default">git-rev = ${gitrev}</echo>
</target>
<target name="resources">
<exec executable="java" failifexecutionfails="false">
<arg line="-jar resources/LayerUtil.jar -re resources/src resources/compiled/res" />
</exec>
<!-- <jar destfile="build/client-res.jar" update="true">
<fileset dir="resources/compiled" />
</jar>-->
</target>
<target name="haven-client" depends="build-env, pre-src">
<javac srcdir="src" destdir="build/classes" debug="true" debuglevel="lines,vars,source"
source="1.7" target="1.7" includeantruntime="no">
<classpath>
<pathelement path="lib/haven.jar" />
<pathelement path="lib/jogl-all.jar" />
<pathelement path="lib/gluegen-rt.jar" />
<pathelement path="lib/jnlp.jar" />
<pathelement path="lib/jorbis.jar" />
<pathelement path="lib/jogg.jar" />
<pathelement path="lib/antlr.jar" />
<pathelement path="lib/asm.jar" />
<pathelement path="lib/asm-analysis.jar" />
<pathelement path="lib/asm-commons.jar" />
<pathelement path="lib/asm-tree.jar" />
<pathelement path="lib/asm-util.jar" />
<pathelement path="lib/groovy.jar" />
</classpath>
<compilerarg value="-Xlint:unchecked" />
<!-- <compilerarg value="-Xlint:deprecation" /> -->
</javac>
<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" />
<mkdir dir="build/res" />
</target>
<target name="lib-classes" depends="build-env" unless="unpacked-lib">
<mkdir dir="build/classes-lib" />
<unjar src="lib/jogg.jar" dest="build/classes-lib">
<patternset excludes="META-INF/**" />
</unjar>
<unjar src="lib/jorbis.jar" dest="build/classes-lib">
<patternset excludes="META-INF/**" />
</unjar>
</target>
<target name="jar" depends="haven-client,buildinfo,lib-classes,resources">
<jar destfile="build/maid.jar" update="true">
<fileset dir="build/classes" excludes="**/haven/geoloc/GeolocGen*"/>
<fileset dir="build/classes-lib" />
<manifest>
<attribute name="Main-Class" value="haven.MaidFrame" />
<attribute name="Class-Path" value="haven.jar jogl-all.jar gluegen-rt.jar haven-res.jar antlr.jar asm.jar asm-analysis.jar asm-commons.jar asm-tree.jar asm-util.jar groovy.jar" />
</manifest>
</jar>
<chmod file="build/maid.jar" perm="a+x" />
</target>
<target name="geolocgen-jar" depends="haven-client">
<jar destfile="build/geolocgen.jar" update="true">
<fileset dir="build/classes" includes="**/haven/geoloc/**"/>
<manifest>
<attribute name="Main-Class" value="haven.geoloc.GeolocGen" />
</manifest>
</jar>
</target>
<target name="res-jar" depends="build-env" unless="has-res-jar">
<get src="http://legacy.havenandhearth.com/java/haven-res.jar" dest="lib/haven-res.jar"
usetimestamp="true" />
</target>
<target name="jars" depends="build-env, jar, geolocgen-jar, res-jar">
<copy todir="build">
<fileset dir="lib">
<include name="haven.jar" />
<include name="jogl-all.jar" />
<include name="gluegen-rt.jar" />
<include name="haven-res.jar" />
<include name="antlr.jar" />
<include name="asm.jar" />
<include name="asm-analysis.jar" />
<include name="asm-commons.jar" />
<include name="asm-tree.jar" />
<include name="asm-util.jar" />
<include name="groovy.jar" />
</fileset>
<fileset dir="${basedir}" includes="*.conf">
</fileset>
<fileset dir="natives" includes="*${arch}.jar">
</fileset>
</copy>
<copy todir="build/scripts">
<fileset dir="${basedir}/scripts" includes="**">
</fileset>
</copy>
<copy todir="build/res">
<fileset dir="resources/res_working" includes="**">
</fileset>
</copy>
</target>
<target name="run" depends="jars">
<java jar="build/maid.jar" fork="true" />
</target>
<target name="clean">
<delete dir="build/classes" />
<delete dir="build/classes-lib" />
<delete file="build/maid.jar" />
<delete>
<fileset dir="build" includes="*natives*.jar"/>
</delete>
</target>
<target name="rebuild" depends="clean, jars">
</target>
<target name="distall">
<antcall target="dist">
<param name="arch" value="linux-amd64"/>
</antcall>
<antcall target="dist">
<param name="arch" value="linux-i586"/>
</antcall>
<antcall target="dist">
<param name="arch" value="windows-amd64"/>
</antcall>
<antcall target="dist">
<param name="arch" value="windows-i586"/>
</antcall>
<antcall target="dist">
<param name="arch" value="macosx-universal"/>
</antcall>
<zip destfile="${basedir}/${name}-update-${built.date}.zip" update="false">
<fileset dir="build" includes="maid.jar, scripts, scripts/carrots.groovy, scripts/grind.groovy, geoloc.dat"/>
<fileset dir="${basedir}" includes="*.conf"/>
<fileset dir="build" includes="res/gfx/hud/buttons/geoloc.res, res/sfx/alarm.res"/>
</zip>
</target>
<target name="dist" depends="rebuild">
<mkdir dir="build/scripts" />
<zip destfile="${basedir}/${name}-${built.date}-${arch}.zip" update="false">
<fileset dir="build" includes="*.jar, res/**, scripts, scripts/carrots.groovy, scripts/grind.groovy, geoloc.dat" excludes="*natives*.jar, geolocgen.jar"/>
<fileset dir="${basedir}" includes="*.conf, README"/>
<fileset dir="natives" includes="*${arch}.jar"/>
</zip>
</target>
<target name="profile" depends="jars">
<java fork="true" jar="build/haven.jar">
<jvmarg value="${profiler.info.jvmargs.agent}" />
<sysproperty key="haven.dbtext" value="on" />
<sysproperty key="haven.defserv" value="sh.seatribe.se" />
<sysproperty key="haven.resdir" value="build/res" />
</java>
</target>
</project>