-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
206 lines (172 loc) · 7.79 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="package" name="wonderland">
<!-- set the current directory -->
<dirname property="current.dir" file="${ant.file.wonderland}"/>
<!-- import generic setup -->
<import file="build-tools/build-scripts/setup.xml"/>
<target name="build" description="Build everything">
<!-- build areas in correct order, use default build target -->
<ant dir="utils" inheritall="false"/>
<ant dir="core" inheritall="false"/>
<ant dir="web" inheritall="false"/>
<ant dir="modules" inheritall="false"/>
<!-- if wonderland-video exists and is a sibling of wonderland, build
it too -->
<if>
<available file="${wonderland.dir}/../wonderland-video/build.xml"/>
<then>
<ant dir="${wonderland.dir}/../wonderland-video" inheritall="false"/>
</then>
</if>
<!-- if wonderland-modules exists and is a sibling of wonderland, build
it too -->
<if>
<available file="${wonderland-modules.stable.dir}/build.xml"/>
<then>
<ant dir="${wonderland-modules.stable.dir}" inheritall="false"/>
</then>
</if>
</target>
<target name="package" depends="build" description="Assemble into final package">
<mkdir dir="dist"/>
<!-- create the final jar in the dist directory -->
<ant dir="web" target="-package" inheritall="false">
<property name="server.package.dir" value="${basedir}/dist"/>
</ant>
</target>
<target name="javadoc" description="Build javadoc">
<ant dir="core" target="javadoc" inheritall="false"/>
</target>
<target name="clean" description="Clean all rebuildable stuff.">
<!-- delete top-level dist directory -->
<delete dir="dist"/>
<!-- clean individual components -->
<ant dir="utils" target="clean" inheritall="false"/>
<ant dir="core" target="clean" inheritall="false"/>
<ant dir="web" target="clean" inheritall="false"/>
<ant dir="modules" target="clean" inheritall="false"/>
<!-- if wonderland-video exists and is a sibling of wonderland, clean
it too -->
<if>
<available file="${wonderland.dir}/../wonderland-video/build.xml"/>
<then>
<ant dir="${wonderland.dir}/../wonderland-video" target="clean" inheritall="false"/>
</then>
</if>
<!-- if wonderland-modules exists and is a sibling of wonderland, clean
it too -->
<if>
<available file="${wonderland-modules.stable.dir}/build.xml"/>
<then>
<ant dir="${wonderland-modules.stable.dir}" target="clean" inheritall="false"/>
</then>
</if>
</target>
<target name="scrub" depends="clean"
description="Remove anything that is not part of the default distribution">
<!-- right now, only core needs scrubbing -->
<ant dir="core" target="scrub" inheritall="false"/>
</target>
<target name="release" depends="package, javadoc" description="Build release">
</target>
<target name="daily-build" depends="release" description="Do the daily build">
<fail unless="daily.build.dir" message="No ${daily.build.dir} directory specified"/>
<tstamp>
<format property="daily.build.date" pattern="yyyy-MM-dd"/>
</tstamp>
<property name="daily.build.today.dir" location="${daily.build.dir}/daily-${wonderland.version}/${daily.build.date}"/>
<mkdir dir="${daily.build.today.dir}"/>
<!-- copy javadoc to javadoc directory -->
<copy todir="${daily.build.dir}/api-update">
<fileset dir="core/release/javadoc"/>
</copy>
<!-- copy Wonderland.jar -->
<copy todir="${daily.build.today.dir}" file="${dist.dir}/Wonderland.jar"/>
</target>
<target name="run-server" depends="package, -run-setup,
-run-args-with-properties,
-run-args-without-properties,
-run-with-wrapper,
-run-without-wrapper"
description="Run the Wonderland Server"/>
<target name="-run-setup">
<!-- Use my.run.properties to override default values in web-default.properties.
You can specify an alternate run.properties override file by
running with "ant -Drun.properties.file=<file>" -->
<property name="run.properties.file" location="${basedir}/my.run.properties"/>
<condition property="run.properties.exists">
<available file="${run.properties.file}"/>
</condition>
<condition property="run.with.wrapper">
<or>
<equals arg1="${system.type}" arg2="windows-x86"
casesensitive="false"/>
<equals arg1="${system.type}" arg2="windows-amd64"
casesensitive="false"/>
</or>
</condition>
</target>
<target name="-run-args-with-properties" if="run.properties.exists">
<path id="run.properties.path">
<pathelement location="${run.properties.file}"/>
</path>
</target>
<target name="-run-args-without-properties" unless="run.properties.exists">
<path id="run.properties.path"/>
</target>
<target name="-run-without-wrapper" unless="run.with.wrapper">
<java dir="dist" jar="dist/Wonderland.jar" fork="true">
<arg pathref="run.properties.path"/>
</java>
</target>
<!-- workaround for issues with shutdown on Windows. Use a wrapper
so that the webserver shuts down cleanly -->
<target name="-run-with-wrapper" if="run.with.wrapper">
<property name="wonderland.jar.location"
location="${current.dir}/dist/Wonderland.jar"/>
<java dir="dist" classname="org.jdesktop.wonderland.utils.ant.RunWrapper"
fork="true">
<classpath>
<pathelement path="${current.dir}/utils/ant/build/lib/wonderland-ant-utils.jar"/>
</classpath>
<arg value="${wonderland.jar.location}"/>
<arg pathref="run.properties.path"/>
</java>
</target>
<!--Netbeans debugging -->
<target name="debug-server" depends="package, -run-setup,
-run-args-with-properties,
-run-args-without-properties,
-debug-with-wrapper,
-debug-without-wrapper"
description="Run the Wonderland Server"/>
<!-- workaround for issues with shutdown on Windows. Use a wrapper
so that the webserver shuts down cleanly -->
<target name="-debug-with-wrapper" if="run.with.wrapper">
<property name="wonderland.jar.location"
location="${current.dir}/dist/Wonderland.jar"/>
<nbjpdastart addressproperty="jpda.address" name="wonderland" transport="dt_socket">
<classpath>
<pathelement path="${current.dir}/utils/ant/build/lib/wonderland-ant-utils.jar"/>
</classpath>
</nbjpdastart>
<java dir="dist" classname="org.jdesktop.wonderland.utils.ant.RunWrapper" fork="true">
<classpath>
<pathelement path="${current.dir}/utils/ant/build/lib/wonderland-ant-utils.jar"/>
</classpath>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
<arg value="${wonderland.jar.location}"/>
<arg pathref="run.properties.path"/>
</java>
</target>
<target name="-debug-without-wrapper" unless="run.with.wrapper">
<nbjpdastart addressproperty="jpda.address" name="wonderland" transport="dt_socket">
</nbjpdastart>
<java dir="dist" jar="dist/Wonderland.jar" fork="true">
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
<arg pathref="run.properties.path"/>
</java>
</target>
</project>