forked from romovs/amber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
146 lines (130 loc) · 5.17 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
<?xml version="1.0" ?>
<project name="hafen" default="deftgt">
<property name="name" value="amber"/>
<property name="version" value=""/>
<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">${version},${gitrev}</echo>
</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" />
</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" />
</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" />
<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" />
</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="jars" depends="build-env, jar, res-jar, l10n-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" />
<include name="amber-res.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" excludes="*natives*.jar"/>
<fileset dir="${basedir}" includes="README, CHANGELOG"/>
<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" />
<fileset dir="${basedir}" includes="CHANGELOG"/>
</zip>
</target>
<target name="deftgt" depends="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/"/>
</copy>
</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>
<target name="test" depends="jars">
<junit showoutput="true" printsummary="true">
<classpath>
<pathelement location="lib/junit.jar" />
<pathelement location="lib/hamcrest/core.jar" />
<pathelement location="build/hafen.jar" />
</classpath>
<formatter usefile="false" type="plain" />
<batchtest fork="true" >
<fileset dir="src">
<include name="haven/pathfinder/test/PathfinderIsInsideBoundBoxTest.java" />
</fileset>
</batchtest>
</junit>
</target>
</project>