-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
195 lines (164 loc) · 7.46 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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="dist" name="wonderland-video">
<!-- current directory needed in all scripts -->
<dirname property="current.dir" file="${ant.file.wonderland-video}"/>
<property name="wonderland.dir" location="${current.dir}/../wonderland"/>
<target name="build">
<!-- unzip libraries -->
<unzip-native-zip platform="linux"/>
<unzip-native-zip platform="linux64"/>
<unzip-native-zip platform="macosx"/>
<unzip-native-zip platform="win32"/>
<unzip-native-zip platform="win64"/>
<mkdir dir="build/classes"/>
<javac debug="true" srcdir="src" destdir="build/classes"
source="6" target="6">
<classpath location="lib/xuggle-xuggler.jar"/>
</javac>
</target>
<target name="jar" depends="build">
<mkdir dir="build/lib"/>
<jar jarfile="build/lib/wonderland-video.jar">
<fileset dir="build/classes"/>
<fileset dir=".">
<include name="logging.properties"/>
</fileset>
</jar>
</target>
<!-- package -->
<target name="dist" depends="jar, package-webstart" description="Build server distribution"/>
<target name="run" depends="dist">
<!-- defaul to no debug unless set previously -->
<property name="debug.args" value=""/>
<java fork="true" classname="org.jdesktop.wonderland.video.client.SwingVideoPlayer">
<classpath>
<dirset dir="build/classes"/>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${wonderland.dir}/core/ext/sgs/sgs-client-0.9.10/lib">
<include name="slf4j*.jar"/>
</fileset>
</classpath>
<jvmarg value="-Djava.library.path=${current.dir}/lib/native/macosx/native"/>
<jvmarg value="-Djava.util.logging.config.file=${current.dir}/logging.properties"/>
<jvmarg line="${debug.args}"/>
<!--jvmarg value="-server"/>
<jvmarg value="-Xincgc"/>
<jvmarg value="-ms300m"/>
<jvmarg value="-mx300m"/>
<jvmarg value="-XX:NewSize=5m"/>
<jvmarg value="-XX:MaxNewSize=5m"/-->
<!--jvmarg value="-XX:+UseParNewGC"/-->
<!--jvmarg value="-XX:+UseConcMarkSweepGC"/-->
<!--jvmarg value="-XX:+PrintClassHistogram"/-->
<jvmarg value="-XX:+PrintGCDetails"/>
<jvmarg value="-XX:+PrintGCTimeStamps"/>
<!--jvmarg value="-XX:+TraceGen0Time"/>
<jvmarg value="-XX:+TraceGen1Time"/-->
</java>
</target>
<target name="run-audio" depends="build">
<!-- defaul to no debug unless set previously -->
<property name="debug.args" value=""/>
<java fork="true" classname="org.jdesktop.wonderland.video.client.AudioPlayer">
<classpath>
<dirset dir="build/classes"/>
<fileset dir="lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${wonderland.dir}/core/ext/sgs/sgs-client-0.9.10/lib">
<include name="slf4j*.jar"/>
</fileset>
</classpath>
<jvmarg value="-Djava.library.path=${current.dir}/lib/native/macosx/native"/>
<jvmarg value="-Djava.util.logging.config.file=${current.dir}/logging.properties"/>
<jvmarg line="${debug.args}"/>
</java>
</target>
<target name="debug" depends="debug-setup, run"/>
<target name="debug-audio" depends="debug-setup, run-audio"/>
<target name="debug-setup">
<property name="debug.args"
value="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8890,suspend=n"/>
</target>
<target name="package-webstart" depends="jar">
<mkdir dir="build/web"/>
<!-- copy web content -->
<copy todir="build/web">
<fileset dir="web"/>
</copy>
<!-- copy jars, signing as we go -->
<sign-and-copy src.jar="lib/commons-cli-1.1.jar"
dest.jar="build/web/app/commons-cli-1.1.jar"/>
<sign-and-copy src.jar="lib/xuggle-xuggler.jar"
dest.jar="build/web/app/xuggle-xuggler.jar"/>
<sign-and-copy src.jar="build/lib/wonderland-video.jar"
dest.jar="build/web/app/wonderland-video.jar"/>
<sign-and-copy src.jar="${wonderland.dir}/core/ext/sgs/sgs-client-0.9.10/lib/slf4j-api-1.4.0.jar"
dest.jar="build/web/app/slf4j-api-1.4.0.jar"/>
<sign-and-copy src.jar="${wonderland.dir}/core/ext/sgs/sgs-client-0.9.10/lib/slf4j-jdk14-1.4.0.jar"
dest.jar="build/web/app/slf4j-jdk14-1.4.0.jar"/>
<!-- create native jars for each platform -->
<create-native-jar platform="linux"/>
<create-native-jar platform="linux64"/>
<create-native-jar platform="macosx"/>
<create-native-jar platform="win32"/>
<create-native-jar platform="win64"/>
<!-- copy download servlet to web/WEB-INF/lib -->
<mkdir dir="build/web/WEB-INF/lib"/>
<copy todir="build/web/WEB-INF/lib" file="lib/deployment-servlet-1.0beta.jar"/>
<!-- create a war file -->
<jar jarfile="build/lib/wonderland-video.war">
<fileset dir="build/web"/>
</jar>
<!-- create wonderland module -->
<mkdir dir="dist"/>
<jar jarfile="dist/wonderland-video.jar">
<fileset dir="module"/>
<zipfileset dir="build/lib" prefix="web">
<include name="wonderland-video.war"/>
</zipfileset>
</jar>
</target>
<macrodef name="sign-and-copy">
<attribute name="src.jar"/>
<attribute name="dest.jar"/>
<sequential>
<signjar jar="@{src.jar}"
keystore="${wonderland.dir}/build-tools/keystore/wonderlandKeystore.jks"
alias="wonderlandsig"
storepass="wonderland"
signedjar="@{dest.jar}"/>
</sequential>
</macrodef>
<macrodef name="create-native-jar">
<attribute name="platform"/>
<sequential>
<mkdir dir="build/lib/@{platform}"/>
<jar jarfile="build/lib/@{platform}/wonderland-native.jar">
<fileset dir="lib/native/@{platform}/native"/>
</jar>
<mkdir dir="build/web/app/@{platform}"/>
<sign-and-copy src.jar="build/lib/@{platform}/wonderland-native.jar"
dest.jar="build/web/app/@{platform}/wonderland-native.jar"/>
</sequential>
</macrodef>
<macrodef name="unzip-native-zip">
<attribute name="platform"/>
<sequential>
<mkdir dir="lib/native/@{platform}"/>
<unzip src="lib/zip/@{platform}/xuggler.zip" dest="lib/native/@{platform}"
overwrite="false"/>
</sequential>
</macrodef>
<!-- clean -->
<target name="clean">
<delete dir="build"/>
<delete dir="dist"/>
</target>
<!-- remove libraries too -->
<target name="scrub" depends="clean">
<delete dir="lib/native"/>
</target>
</project>