-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
741 lines (686 loc) · 30.4 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
<!--
* Copyright (C) 2009 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Author: [email protected] (Dhanji R. Prasanna)
* [email protected] (Alex North)
-->
<project name="waveinabox" default="dist">
<description>Wave in a Box</description>
<property file="build.properties"/>
<!-- Import classpath definitions. -->
<import file="${build.classpath.path}"/>
<!-- Pull in the Emma tasks -->
<taskdef resource="emma_ant.properties" classpathref="test.libpath"/>
<!-- Import macros -->
<import file="${build.macros.path}"/>
<property name="gwt.args" value=""/>
<!-- Standard time properties and a timestamp pattern -->
<tstamp>
<format property="DSTAMP_INT" pattern="-yyyy-MM-dd"/>
</tstamp>
<tstamp>
<format property="LOG_STAMP" pattern="yyyy-MM-dd_HH-mm-ss"/>
</tstamp>
<property name="release.name" value="wave-${DSTAMP_INT}.zip"/>
<property name="release.robot.name" value="wave-robot-client${DSTAMP_INT}.zip"/>
<property name="release.robot.python.name" value="wave-robot-python-client${DSTAMP_INT}.zip"/>
<property name="build.log.filename" value="build_${LOG_STAMP}.log"/>
<!--=====
Initialization
=====-->
<target name="clean" description="Cleans up the build artifacts and temporary directories">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${doc.dir}"/>
<delete dir="${gen.dir}"/>
<delete dir="${test.out.dir}"/>
<delete dir="war/waveharness"/>
<delete dir="war/webclient"/>
</target>
<target name="init-logging" description="Enable logging to file">
<mkdir dir="${build.log.dir}"/>
<record name="${build.log.dir}/${build.log.filename}"
loglevel="verbose" append="false"/>
<echo message="Logging to ${build.log.dir}/${build.log.filename}"/>
</target>
<target name="init" depends="init-logging">
<mkdir dir="${build.proto.dir}"/>
<mkdir dir="${build.messages.dir}"/>
<mkdir dir="${build.src.dir}"/>
<mkdir dir="${build.test.dir}"/>
<mkdir dir="${coverage.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${staging.dir}"/>
<mkdir dir="${dep}"/>
<mkdir dir="${test.out.dir}"/>
</target>
<!-- === IDE helper targets === -->
<!-- TODO(danilatos): Make this work on Windows as well. For now,
windows users can just copy the .project_template file manually. -->
<target name="eclipse" description="Generates an eclipse .project file">
<exec executable="tools/eclipse.sh"/>
</target>
<!--=====
Builds
======-->
<!-- ===
Protocol buffer targets.
Compiles generated proto sources. See build-proto.xml for generating
proto sources from .proto files.
=== -->
<target name="compile-proto-dep">
<uptodate targetfile="${dep}/compile-proto" property="skip.compile-proto">
<srcfiles dir="${lib.dir}"/>
<srcfiles dir="${src.proto.dir}" includes="**/*.java"/>
</uptodate>
</target>
<target name="compile-proto" depends="init, compile-proto-dep"
unless="skip.compile-proto" description="Compiles protocol buffers">
<buildjava destdir="${build.proto.dir}">
<src path="${src.proto.dir}"/>
<classpath>
<path refid="libpath"/>
</classpath>
</buildjava>
<touch file="${dep}/compile-proto"/>
</target>
<!-- === GXP targets === -->
<target name="gen-gxp-dep">
<uptodate targetfile="${dep}/gen-gxp" property="skip.gen-gxp">
<srcfiles dir="${lib.runtime}/gxp"/>
<srcfiles dir="${src.dir}" includes="org/waveprotocol/box/server/gxp/*.gxp"/>
</uptodate>
</target>
<!-- Generates the Java files from templates -->
<target name="gen-gxp" description="Generates GXP files"
depends="init, gen-gxp-dep" unless="skip.gen-gxp">
<gxpc srcdir="${src.dir}" srcpaths="${src.dir}" destdir="${gen.dir}/gxp"
target="org.waveprotocol.box.server.gxp" />
<touch file="${dep}/gen-gxp"/>
</target>
<target name="compile-gxp-dep">
<uptodate targetfile="${dep}/compile-gxp" property="skip.compile-gxp">
<srcfiles dir="${gen.dir}/gxp"/>
</uptodate>
</target>
<target name="compile-gxp" depends="init, gen-gxp, compile-gxp-dep"
unless="skip.compile-gxp" description="Compiles GXP classes">
<buildjava destdir="${build.src.dir}">
<src path="${gen.dir}/gxp" />
<classpath>
<path refid="libpath"/>
</classpath>
</buildjava>
<touch file="${dep}/compile-gxp"/>
</target>
<!-- === PST targets === -->
<target name="dist-pst-dep">
<uptodate targetfile="${dep}/dist-pst" property="skip.dist-pst">
<srcfiles dir="${lib.dir}"/>
<srcfiles dir="${src.dir}" includes="org/waveprotocol/pst/**/*.java"/>
</uptodate>
</target>
<target name="dist-pst" depends="init, dist-pst-dep, compile-proto"
unless="skip.dist-pst" description="Builds the PST tool">
<delete dir="${build.dir}/pst"/>
<mkdir dir="${build.dir}/pst"/>
<javac srcdir="${src.dir}" destdir="${build.dir}/pst" includes="org/waveprotocol/pst/**/*">
<classpath>
<path refid="libpath"/>
<path location="${build.proto.dir}/"/>
</classpath>
</javac>
<copy todir="${build.dir}/pst">
<fileset dir="${src.dir}">
<include name="org/waveprotocol/pst/**/*.st"/>
<include name="org/waveprotocol/pst/**/properties"/>
</fileset>
</copy>
<jar destfile="${dist.dir}/pst.jar" basedir="${build.dir}/pst"/>
<touch file="${dep}/dist-pst"/>
</target>
<target name="gen-messages-dep">
<uptodate targetfile="${dep}/gen-messages" property="skip.gen-messages">
<srcfiles dir="${src.dir}" includes="org/waveprotocol/pst/**/*.st"/>
<srcfiles dir="${lib.dir}"/>
<srcfiles dir="${dist.dir}" includes="pst.jar"/>
<srcfiles dir="${build.proto.dir}"/>
</uptodate>
</target>
<target name="gen-messages" depends="dist-pst, compile-proto, gen-messages-dep"
unless="skip.gen-messages"
description="Generates the DTO message source">
<delete dir="${gen.dir}/messages"/>
<mkdir dir="${gen.dir}/messages"/>
<pstmessage proto="${build.proto.dir}/org/waveprotocol/box/common/comms/WaveClientRpc.class"/>
<pstmessage proto="${build.proto.dir}/org/waveprotocol/box/search/SearchProto.class"/>
<pstmessage proto="${build.proto.dir}/org/waveprotocol/box/profile/ProfilesProto.class"/>
<pstmessage proto="${build.proto.dir}/org/waveprotocol/box/server/rpc/Rpc.class"/>
<pstmessage proto="${build.proto.dir}/org/waveprotocol/wave/federation/Proto.class"/>
<pstmessage proto="${build.proto.dir}/org/waveprotocol/wave/concurrencycontrol/ClientServer.class"/>
<pstmessage proto="${build.proto.dir}/org/waveprotocol/wave/diff/Diff.class"/>
<touch file="${dep}/gen-messages"/>
</target>
<target name="compile-messages-dep">
<uptodate targetfile="${dep}/compile-messages" property="skip.compile-messages">
<srcfiles dir="${gen.dir}/messages"/>
<srcfiles dir="${src.dir}" includes="org/waveprotocol/wave/communication/**"/>
</uptodate>
</target>
<target name="compile-messages" depends="gen-messages, compile-messages-dep"
unless="skip.compile-messages" description="Compiles the DTO messages">
<!--
The generated DTOs depend on code in wave/communication. At this stage of
the build process, that code is still in source form, so it is exposed to
javac via sourcepath not classpath. Since javac is too aggressive, and
gobbles up those files and compiles them too, a subsequent step has to
go and delete those overzealously compiled files, because they will be
compiled again later.
-->
<javac srcdir="${gen.dir}/messages"
destdir="${build.messages.dir}"
sourcepath="${src.dir}">
<classpath>
<path refid="libpath"/>
<pathelement location="${build.proto.dir}"/>
</classpath>
</javac>
<delete dir="${build.messages.dir}/org/waveprotocol/wave/communication"/>
<touch file="${dep}/compile-messages"/>
</target>
<!-- === Java targets === -->
<target name="compile-dep">
<uptodate targetfile="${dep}/compile" property="skip.compile">
<srcfiles dir="${lib.dir}"/>
<srcfiles dir="${src.dir}" includes="**"/>
<srcfiles dir="${gen.dir}" includes="**"/>
</uptodate>
</target>
<target name="compile" depends="compile-proto, compile-gxp, compile-messages, compile-dep"
unless="skip.compile" description="Compiles all source">
<subant target="compile" inheritall="true">
<property name="build.common.path" location="build-common.xml"/>
<fileset dir="${src.dir}" includes="*/**/build.xml"/>
</subant>
<!-- copy non binary resources in src tree to output classpath. Why? -->
<copy todir="${build.src.dir}">
<fileset dir="${src.dir}">
<include name="**/*.xml"/>
<include name="**/*.html"/>
<include name="**/*.properties"/>
<include name="**/*.proto"/>
</fileset>
</copy>
<touch file="${dep}/compile"/>
</target>
<target name="compile-tests" depends="compile"
description="Compiles all unit tests">
<buildjava destdir="${build.test.dir}">
<src path="${test.dir}" />
<classpath>
<path refid="libpath"/>
<path refid="test.libpath"/>
<pathelement location="${build.src.dir}"/>
<pathelement location="${build.proto.dir}"/>
</classpath>
</buildjava>
<!-- copy non binary resources in src tree to output classpath -->
<copy todir="${build.test.dir}">
<fileset dir="${test.dir}">
<include name="**/*.xml"/>
<include name="**/*.html"/>
<include name="**/*.properties"/>
</fileset>
</copy>
</target>
<!--=====
Tests
======-->
<target name="test" depends="compile-tests" description=
"Runs all the unit tests in the project excluding external persistence">
<!-- EMMA disabled due to incompatibility with EventSerializer -->
<!-- Tests are run in a single new VM, when forkmode is set to once -->
<runtests forkmode="once" coverage="true">
<fileset dir="${test.dir}">
<include name="**/*Test.java"/>
<exclude name="**/*GwtTest.java"/>
<exclude name="**/*LargeTest.java"/>
<!-- Exclude all persistence tests -->
<exclude name="**/server/persistence/**"/>
</fileset>
<!-- Include the persistence tests that aren't run elsewhere -->
<fileset dir="${test.dir}">
<include name="**/server/persistence/memory/*Test.java"/>
<include name="**/server/persistence/file/*Test.java"/>
</fileset>
</runtests>
</target>
<target name="test-large" depends="compile-tests" description="Runs large tests (slow)">
<runtests forkmode="perTest" coverage="true">
<fileset dir="${test.dir}">
<include name="**/*LargeTest.java"/>
</fileset>
</runtests>
</target>
<target name="test-gwt" depends="compile-tests" description="Runs GWT tests (slow)">
<!-- Fork per test due to GWT test failure in shared JVM -->
<!-- EMMA disabled due to GWT incompatibility -->
<runtests forkmode="perTest" coverage="false">
<fileset dir="${test.dir}">
<include name="**/*GwtTest.java"/>
</fileset>
</runtests>
</target>
<target name="test-mongodb" depends="compile-tests" description="Runs the MongoDb tests">
<runtests forkmode="once" coverage="true">
<fileset dir="${test.dir}">
<!-- Include the mongoDb tests -->
<include name="**/server/persistence/mongodb/**/*Test.java"/>
</fileset>
</runtests>
</target>
<target name="test-all" depends="compile-tests, test, test-gwt, test-large, test-mongodb"
description="Run all tests, including GWT"/>
<target name="compile-gwt-dep">
<uptodate targetfile="${dep}/compile-gwt" property="skip.compile-gwt">
<srcfiles dir="${lib.dir}"/>
<srcfiles dir="${src.dir}"/>
<srcfiles dir="${gen.dir}/messages"/>
</uptodate>
</target>
<target name="compile-gwt" depends="compile, compile-gwt-dep"
description="GWT compile to production JavaScript" unless="skip.compile-gwt">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="${src.dir}"/>
<pathelement location="${gen.dir}/messages"/>
<path refid="libpath"/>
<path refid="test.libpath"/>
</classpath>
<jvmarg value="-Xmx512M"/>
<!-- Small Javascript size. -->
<arg line="-style OBFUSCATED"/>
<!-- Do not include class and package names in compiled JS. -->
<arg line="-XdisableClassMetadata"/>
<arg line="-XdisableCastChecking"/>
<arg line="${gwt.args}"/>
<arg value="org.waveprotocol.box.webclient.WebClientProd"/>
</java>
<!-- Only one GWT compile output is valid at any one time. -->
<delete file="${dep}/compile-gwt-dev"/>
<touch file="${dep}/compile-gwt"/>
</target>
<target name="compile-gwt-dev-dep">
<uptodate targetfile="${dep}/compile-gwt-dev" property="skip.compile-gwt-dev">
<srcfiles dir="${lib.dir}"/>
<srcfiles dir="${src.dir}"/>
<srcfiles dir="${gen.dir}/messages"/>
</uptodate>
</target>
<target name="compile-gwt-demo" depends="compile, compile-gwt-dev-dep"
description="GWT compile to a 'demo' production JavaScript with remote logging enabled."
unless="skip.compile-gwt-dev">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="${src.dir}"/>
<pathelement location="${gen.dir}/messages"/>
<path refid="libpath"/>
<path refid="test.libpath"/>
</classpath>
<jvmarg value="-Xmx1024M"/>
<!-- Human-readable JS. -->
<arg line="-style PRETTY"/>
<!-- Assertions on. -->
<arg line="-ea"/>
<arg line="${gwt.args}"/>
<arg value="org.waveprotocol.box.webclient.WebClientDemo"/>
</java>
<!-- Only one GWT compile output is valid at any one time. -->
<delete file="${dep}/compile-gwt"/>
<touch file="${dep}/compile-gwt-dev"/>
</target>
<target name="compile-gwt-dev" depends="compile, compile-gwt-dev-dep"
description="GWT compile of a restricted set of permutations suitable for development."
unless="skip.compile-gwt-dev">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="${src.dir}"/>
<pathelement location="${gen.dir}/messages"/>
<path refid="libpath"/>
<path refid="test.libpath"/>
</classpath>
<jvmarg value="-Xmx512M"/>
<!-- Human-readable JS. -->
<arg line="-style PRETTY"/>
<!-- Less optimal JS, but faster compile. -->
<arg line="-draftCompile"/>
<!-- Assertions on. -->
<arg line="-ea"/>
<arg line="${gwt.args}"/>
<arg value="org.waveprotocol.box.webclient.WebClientDev"/>
</java>
<!-- Only one GWT compile output is valid at any one time. -->
<delete file="${dep}/compile-gwt"/>
<touch file="${dep}/compile-gwt-dev"/>
</target>
<target name="hosted-gwt" depends="compile"
description="Runs the hosted mode server, for debugging the GWT client in a JVM.">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode">
<classpath>
<pathelement location="${src.dir}"/>
<pathelement location="${gen.dir}/messages"/>
<path refid="libpath"/>
</classpath>
<jvmarg value="-Xmx512M"/>
<jvmarg value="-ea"/>
<jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8001"/>
<arg value="-noserver" />
<arg line="-bindAddress 0.0.0.0" />
<arg line="${gwt.args}"/>
<arg value="org.waveprotocol.box.webclient.WebClientProd"/>
</java>
</target>
<target name="editor-hosted" depends="compile" description="Runs the editor harness through the GWT hosted mode server, for debugging in a JVM.">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode">
<classpath>
<pathelement location="${src.dir}"/>
<path refid="libpath"/>
</classpath>
<jvmarg value="-Xmx512M"/>
<jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8001"/>
<arg line="${gwt.args}"/>
<arg line="-war war"/>
<arg line="-startupUrl org.waveprotocol.wave.client.editor.harness.EditorTest/EditorTest.html"/>
<arg value="org.waveprotocol.wave.client.editor.harness.EditorTest"/>
</java>
</target>
<target name="waveharness-hosted" depends="compile" description="Runs the wave panel harness through the GWT hosted mode server, for debugging in a JVM.">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.DevMode">
<classpath>
<pathelement location="${src.dir}"/>
<path refid="libpath"/>
</classpath>
<jvmarg value="-Xmx512M"/>
<jvmarg value="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8001"/>
<arg line="${gwt.args}"/>
<arg line="-war war"/>
<arg line="-startupUrl waveharness/UndercurrentHarness.html"/>
<arg value="org.waveprotocol.wave.client.testing.UndercurrentHarness"/>
</java>
</target>
<target name="check-server-config" description="Checks server configuration is available">
<available file="server.config" property="server.config.present"/>
<fail message="You need to copy server.config.example to server.config and edit it."
unless="server.config.present"/>
</target>
<target name="run-server" depends="compile, check-server-config"
description="Runs Wave in a Box server">
<java failonerror="true" fork="true" classname="org.waveprotocol.box.server.ServerMain">
<classpath>
<path refid="libpath"/>
<path location="${build.src.dir}"/>
<path location="${build.proto.dir}"/>
<path location="${build.messages.dir}"/>
</classpath>
<jvmarg value="-Dorg.eclipse.jetty.util.log.DEBUG=true"/>
<jvmarg value="-Djava.security.auth.login.config=jaas.config"/>
<jvmarg value="-Dwave.server.config=server.config"/>
</java>
</target>
<target name="debug-server" depends="compile, check-server-config"
description="Runs Wave in a Box server with debugging">
<java failonerror="true" fork="true" classname="org.waveprotocol.box.server.ServerMain">
<classpath>
<path refid="libpath"/>
<path location="${build.src.dir}"/>
<path location="${build.proto.dir}"/>
<path location="${build.messages.dir}"/>
</classpath>
<jvmarg value="-Dorg.eclipse.jetty.util.log.DEBUG=true"/>
<jvmarg value="-Djava.security.auth.login.config=jaas.config"/>
<jvmarg value="-Dwave.server.config=server.config"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=10898"/>
</java>
</target>
<target name="stage-dep">
<uptodate targetfile="${dep}/stage" property="skip.stage">
<srcfiles dir="${lib.runtime}" includes="**/*.jar"/>
<srcfiles dir="${lib.codegen}" includes="gwt/gwt-user.jar"/>
<srcfiles dir="${build.src.dir}"/>
</uptodate>
</target>
<target name="stage" depends="compile, stage-dep"
description="Copy classes and runtime depenencies to the staging directory" unless="skip.stage">
<!-- Unzip and copy all the runtime deps into a staging dir -->
<unzip dest="${staging.dir}">
<fileset dir="${lib.runtime}">
<include name="*/*.jar"/>
</fileset>
<fileset dir="${lib.codegen}">
<include name="gwt/gwt-user.jar"/>
</fileset>
</unzip>
<copy todir="${staging.dir}" preservelastmodified="true">
<fileset dir="${build.src.dir}"/>
<fileset dir="${build.proto.dir}"/>
<fileset dir="${build.messages.dir}"/>
</copy>
<touch file="${dep}/stage"/>
</target>
<target name="dist" depends="test, dist-libraries, dist-server,
dist-client-console, dist-robot-client-api, compile-gwt"
description="Compiles, tests and assembles artifacts">
</target>
<target name="dist-proto" depends="compile-proto" description="Builds the proto jar">
<jar destfile="${dist.dir}/proto.jar" basedir="${build.proto.dir}"/>
<jar destfile="${dist.dir}/proto-src.jar" basedir="${src.proto.dir}"/>
<jar destfile="${dist.dir}/proto-msg.jar" basedir="${gen.dir}/messages"/>
</target>
<target name="dist-libraries" depends="compile, dist-proto, dist-pst" description="Builds the distribution libraries">
<subant target="dist" inheritall="true">
<fileset dir="${src.dir}" includes="*/**/build.xml"/>
</subant>
</target>
<target name="dist-robot-client-api" depends="compile">
<jar destfile="${robotclient.jar.out}">
<fileset dir="${staging.dir}">
<include name="com/google/wave/api/*" />
<include name="com/google/wave/api/event/**/*" />
<include name="com/google/wave/api/impl/**/*" />
<include name="com/google/wave/api/oauth/**/*" />
<include name="com/google/wave/api/v2/**/*" />
</fileset>
</jar>
</target>
<!-- dist-api is broken due to non-runnable dependencies in the waveserver directory. TODO: fix. -->
<target name="dist-api" depends="stage" description="Assembles the Wave in a Box API">
<jar destfile="${api.jar.out}">
<fileset dir="${staging.dir}">
<include name="org/waveprotocol/**/*" />
<!-- Only exclude runnable targets -->
<exclude name="org/waveprotocol/box/consoleclient/**/*" />
<exclude name="org/waveprotocol/box/server/waveserver/**/*" />
</fileset>
<manifest>
<attribute name="Implementation-Vendor" value="Google, Inc."/>
<attribute name="Implementation-Title" value="Google Wave Reference Impl API"/>
<attribute name="Implementation-Version" value="${waveinabox.version}"/>
</manifest>
</jar>
</target>
<!-- A healthy mix of hyphens and underscores never hurt anyone. Sigh. -->
<target name="dist-server-dep">
<!-- Note: this check is still very slow (~30secs) -->
<uptodate targetfile="${dep}/dist-server" property="skip.dist-server">
<srcfiles dir="${staging.dir}"/>
</uptodate>
</target>
<target name="dist-server" depends="stage, dist-server-dep" description="Assembles the Wave in a Box server" unless="skip.dist-server">
<jar destfile="${server.jar.out}">
<fileset dir="${staging.dir}">
<include name="META-INF/services/*" />
<include name="com/mongodb/**/*" />
<include name="com/glines/socketio/**/*" />
<include name="com/google/common/**/*" />
<include name="com/google/gson/**/*" />
<include name="com/google/gxp/**/*" />
<include name="com/google/gwt/core/client/**/*" />
<include name="com/google/gwt/logging/**/*" />
<include name="com/google/gwt/user/server/**/*" />
<include name="com/google/gwt/user/client/rpc/**/*" />
<include name="com/google/inject/**/*" />
<include name="com/google/protobuf/**/*" />
<include name="com/google/wave/**/*" />
<include name="gnu/inet/**/*" />
<include name="javax/inject/**/*" />
<include name="javax/servlet/**/*" />
<include name="javax/xml/**/*" />
<include name="net/oauth/**/*" />
<include name="org/aopalliance/**/*" />
<include name="org/apache/commons/cli/**/*" />
<include name="org/apache/commons/codec/**/*" />
<include name="org/apache/commons/collections/**/*" />
<include name="org/apache/commons/configuration/**/*" />
<include name="org/apache/commons/httpclient/**/*" />
<include name="org/apache/commons/lang/**/*" />
<include name="org/apache/commons/logging/**/*" />
<include name="org/bson/**/*" />
<include name="org/codehaus/jackson/**/*" />
<include name="org/dom4j/**/*" />
<include name="org/eclipse/**/*" />
<include name="org/jdom/**/*" />
<include name="org/jivesoftware/**/*" />
<include name="org/joda/time/**/*" />
<include name="org/json/**/*" />
<include name="org/waveprotocol/**/*" />
<include name="org/xmlpull/**/*" />
<include name="org/xmpp/**/*" />
<exclude name="org/waveprotocol/box/webclient/**/*"/>
<exclude name="org/waveprotocol/box/consoleclient/**/*"/>
<exclude name="org/waveprotocol/wave/client/*"/>
<exclude name="org/waveprotocol/wave/client/account/**/*"/>
<exclude name="org/waveprotocol/wave/client/autohide/**/*"/>
<exclude name="org/waveprotocol/wave/client/clipboard/**/*"/>
<exclude name="org/waveprotocol/wave/client/common/**/*"/>
<exclude name="org/waveprotocol/wave/client/concurrencycontrol/**/*"/>
<exclude name="org/waveprotocol/wave/client/debug/**/*"/>
<exclude name="org/waveprotocol/wave/client/doodad/**/*"/>
<exclude name="org/waveprotocol/wave/client/paging/**/*"/>
<exclude name="org/waveprotocol/wave/client/render/**/*"/>
<exclude name="org/waveprotocol/wave/client/scheduler/**/*"/>
<exclude name="org/waveprotocol/wave/client/scroll/**/*"/>
<exclude name="org/waveprotocol/wave/client/state/**/*"/>
<exclude name="org/waveprotocol/wave/client/testing/**/*"/>
<exclude name="org/waveprotocol/wave/client/uibuilder/**/*"/>
<exclude name="org/waveprotocol/wave/client/uibuilder/**/*"/>
<exclude name="org/waveprotocol/wave/client/util/**/*"/>
<exclude name="org/waveprotocol/wave/client/wave/**/*"/>
<exclude name="org/waveprotocol/wave/client/wavepanel/**/*"/>
<exclude name="org/waveprotocol/wave/client/widget/**/*"/>
</fileset>
<manifest>
<!-- Application entry point -->
<attribute name="Main-Class"
value="org.waveprotocol.box.server.ServerMain"/>
<attribute name="Implementation-Vendor" value="Google, Inc."/>
<attribute name="Implementation-Title" value="Wave in a Box Server"/>
<attribute name="Implementation-Version" value="${waveinabox.version}"/>
</manifest>
</jar>
<touch file="${dep}/dist-server"/>
</target>
<target name="dist-client-console" depends="stage" description="Assembles the Wave in a Box console client">
<jar destfile="${consoleclient.jar.out}">
<fileset dir="${staging.dir}">
<include name="com/google/common/**/*" />
<include name="com/google/gson/**/*" />
<include name="com/google/inject/**/*" />
<include name="com/google/protobuf/**/*" />
<include name="com/sixfire/websocket/*" />
<include name="javax/inject/**/*" />
<include name="jline/**/*" />
<include name="org/apache/commons/codec/**/*" />
<include name="org/codehaus/jackson/**/*" />
<include name="org/waveprotocol/**/*" />
</fileset>
<manifest>
<!-- Application entry point -->
<attribute name="Main-Class"
value="org.waveprotocol.box.consoleclient.ConsoleClient"/>
<attribute name="Implementation-Vendor" value="Google, Inc."/>
<attribute name="Implementation-Title" value="Wave in a Box Console Client"/>
<attribute name="Implementation-Version" value="${waveinabox.version}"/>
</manifest>
</jar>
</target>
<!-- This rule should be run whenever the build configuration (i.e. build files, libraries) is changed -->
<target name="dist-test" depends="dist, test" description="Runs all the unit tests in the project against the jar files">
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
<classpath refid="test.libpath"/>
</taskdef>
<junit fork="yes" showoutput="no" haltonerror="yes">
<classpath>
<path refid="libpath"/>
<path refid="test.libpath"/>
<pathelement location="${server.jar.out}"/>
<pathelement location="${build.test.dir}"/>
</classpath>
<batchtest>
<fileset dir="${test.dir}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
<formatter type="xml"/>
</junit>
</target>
<target name="release" depends="dist, release-robot-client-api, release-robot-client-python-api" description="Creates a zip for a release">
<delete file="${dist.dir}/${release.name}"/>
<zip destfile="${dist.dir}/${release.name}">
<zipfileset dir="${dist.dir}" includes="*.jar"/>
<zipfileset dir="${basedir}" includes="COPYING"/>
</zip>
</target>
<target name="release-robot-client-api" depends="dist" description="Creates a zip for the java robot client release">
<delete file="${dist.dir}/${release.robot.name}"/>
<zip destfile="${dist.dir}/${release.robot.name}">
<zipfileset dir="${dist.dir}" includes="model.jar"/>
<zipfileset dir="${dist.dir}" includes="wave-api-${waveinabox.version}.jar"/>
<zipfileset dir="${lib.dir}/runtime/commons_codec" includes="*.jar"/>
<zipfileset dir="${lib.dir}/runtime/gson" includes="*.jar"/>
<zipfileset dir="${lib.dir}/runtime/jdo" includes="*.jar"/>
<zipfileset dir="${lib.dir}/runtime/oauth" includes="*.jar"/>
<zipfileset dir="${basedir}" includes="COPYING"/>
</zip>
</target>
<target name="release-robot-client-python-api" description="Creates a zip for the python robot client release">
<delete file="${dist.dir}/${release.robot.python.name}"/>
<zip destfile="${dist.dir}/${release.robot.python.name}">
<zipfileset dir="${src.dir}/python/api" includes="**/*.py"/>
<zipfileset dir="${basedir}" includes="COPYING"/>
</zip>
</target>
<target name="doc" depends="stage" description="Builds the Java documentation for the mode, protocol, and Wave in a Box">
<javadoc sourcepath="${src.dir}" destdir="${docs.dir}" linksource="yes" author="yes" protected="yes"
windowtitle="${ant.project.name} Documentation">
<classpath>
<pathelement location="${staging.dir}" />
<path refid="libpath"/>
<path location="${build.proto.dir}"/>
</classpath>
<doctitle>${ant.project.name}</doctitle>
<footer><a href="http://www.waveprotocol.org/">Wave Project<a/></footer>
</javadoc>
</target>
</project>