forked from k-t/hafen-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
156 lines (137 loc) · 5.39 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
<?xml version="1.0" ?>
<project name="hafen" default="deftgt">
<property environment="env" />
<condition property="buildversion" value="${env.TRAVIS_TAG}" else="dev">
<isset property="env.TRAVIS_TAG" />
</condition>
<target name="build-env">
<mkdir dir="build" />
<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" 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="hafen-client" depends="build-env">
<javac srcdir="src" destdir="build/classes" debug="on"
source="1.5" target="1.5" includeantruntime="no">
<classpath>
<pathelement path="lib/jogl.jar" />
<pathelement path="lib/gluegen-rt.jar" />
<pathelement path="lib/jnlp.jar" />
<pathelement path="lib/jglob.jar" />
<pathelement path="lib/commons-io-2.4.jar" />
<pathelement path="lib/gson-2.3.1.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/classes/" file="etc/custom-icons.config" />
<copy todir="build/classes/haven" file="etc/curio.config" />
<copy todir="build/classes/haven" file="etc/gob-paths.config" />
</target>
<target name="appletview" depends="build-env">
<copy file="etc/applet.html" todir="build" />
</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>
<unjar src="lib/gson-2.3.1.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" />
<zipgroupfileset dir="lib" includes="commons-io-2.4.jar gson-2.3.1.jar"/>
<manifest>
<attribute name="Main-Class" value="haven.MainFrame" />
<attribute name="Class-Path" value="jogl-all.jar gluegen-rt.jar custom-res.jar builtin-res.jar hafen-res.jar" />
<attribute name="Implementation-Version" value="${buildversion}" />
</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://www.havenandhearth.com/java/hafen-res.jar" dest="lib/hafen-res.jar"
usetimestamp="true" />
<get src="http://www.havenandhearth.com/java/builtin-res.jar" dest="lib/builtin-res.jar"
usetimestamp="true" />
<available property="lib-res-jar" file="lib/hafen-res.jar" />
<fail unless="lib-res-jar" message="hafen-res.jar not available" />
<available property="lib-builtin-jar" file="lib/builtin-res.jar" />
<fail unless="lib-builtin-jar" message="builtin-res.jar not available" />
</target>
<target name="custom-res">
<exec executable="tools/restool/restool.exe" osfamily="windows">
<arg value="pack" />
<arg value="res" />
<arg value="build/custom-res/res" />
</exec>
<exec executable="mono" osfamily="unix">
<arg value="tools/restool/restool.exe" />
<arg value="pack" />
<arg value="./res" />
<arg value="./build/custom-res/res" />
</exec>
<copy todir="build/custom-res/res">
<fileset dir="res">
<include name="**/*.res"/>
</fileset>
</copy>
</target>
<target name="custom-res-jar" depends="custom-res">
<jar destfile="build/custom-res.jar">
<fileset dir="build/custom-res" />
</jar>
</target>
<target name="jars" depends="build-env, jar, custom-res-jar">
<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" />
</fileset>
</copy>
</target>
<target name="deftgt" depends="jars, appletview" />
<target name="run" depends="jars">
<java jar="build/hafen.jar" fork="true" />
</target>
<target name="clean">
<delete dir="build" />
</target>
<target name="clean-res">
<delete dir="build/custom-res" />
</target>
<target name="profile" depends="jars">
<nbprofiledirect>
</nbprofiledirect>
<java fork="true" jar="build/hafen.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="/home/fredrik/src/hafen/res" />
</java>
</target>
</project>