forked from ome/openmicroscopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
948 lines (849 loc) · 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
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
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
<?xml version="1.0" encoding="utf-8"?>
<project name="toplevel" default="build-default" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<!--
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# $Id$
#
# Copyright 2008 Glencoe Software, Inc. All rights reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Written by: Josh Moore, josh at glencoesoftware.com
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rewrite of the OMERO build system to allow for building
individual components. Use "ant -p" to see the individual
build-* targets.
-->
<description>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Top-level OMERO build. The default build with a target ("./build.py" will suffice
for most builds. If you need OmeroCpp (the C++ bindings for OMERO) use "build-all"
or "build-cpp" targets:
./build.py build-all
To get started using Eclipse, execute "./build.py build-dev" and import the top-level
.project file. Eclipse projects also exist for each individual java component.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
</description>
<property name="import.dir" value="${basedir}/components/antlib/resources"/>
<import file="${import.dir}/global.xml"/>
<target name="init" depends="check-bioformats,check-ivy,check-scons,check-ice">
<mkdir dir="${blitz.comp}/generated"/>
<mkdir dir="${blitz.comp}/target/generated/src"/>
</target>
<target name="check-bioformats" unless="bioformats.done">
<!-- Prevent future invocations -->
<property name="bioformats.check.done" value="done"/>
<if><not><available file="${basedir}/components/bioformats/build.xml"/></not>
<then>
<fail>No components/bioformats/build.xml!
Use 'git submodule update --init' to checkout the source code.
</fail>
</then></if>
</target>
<target name="check-ivy" unless="ivy.done">
<!-- Prevent future invocations and PermGen errors-->
<property name="ivy.done" value="done"/>
<!-- Touch the local configuration file which is no longer mandatory -->
<if><not><available file="${basedir}/etc/local.properties"/></not>
<then>
<touch file="${basedir}/etc/local.properties"/>
</then></if>
<installIvy/>
<ivy:buildlist reference="all.buildpath" settingsRef="ivy.toplevel">
<fileset dir="${omero.home}/components" includes="*/build.xml" excludes="**/tools/**"/>
</ivy:buildlist>
<ivy:buildlist reference="blitzserver.buildpath" settingsRef="ivy.toplevel">
<fileset dir="${omero.home}/components/blitz/" includes="build.xml"/>
<fileset dir="${omero.home}/components/common/" includes="build.xml"/>
<fileset dir="${omero.home}/components/dsl/" includes="build.xml"/>
<fileset dir="${omero.home}/components/model/" includes="build.xml"/>
<fileset dir="${omero.home}/components/rendering/" includes="build.xml"/>
<fileset dir="${omero.home}/components/romio/" includes="build.xml"/>
<fileset dir="${omero.home}/components/server/" includes="build.xml"/>
<fileset dir="${omero.home}/components/specification/" includes="build.xml"/>
<fileset dir="${omero.home}/components/xsd-fu/" includes="build.xml"/>
</ivy:buildlist>
<ivy:buildlist reference="all-tools.buildpath" settingsRef="ivy.toplevel">
<fileset dir="${omero.home}/components/tools" includes="*/build.xml"/>
</ivy:buildlist>
<!-- Single file paths defined in antlib/resources/directories.xml -->
</target>
<target name="clean" description="Calls 'clean' on all components" depends="check-ivy">
<!-- Calling check-scons here rather than above, so that dependency graph later will re-install
if a user does "ant clean some-target" -->
<antcall target="check-scons" inheritRefs="true" inheritAll="true"/>
<iterate buildpathref="all.buildpath" target="clean"/>
<iterate buildpathref="tools.buildpath" target="clean"/>
<delete dir="${dist.dir}"/>
<delete dir="${lib.dir}/cache"/>
<delete includeemptydirs="true">
<fileset dir="${lib.dir}/repository" includes="omero/**,omero-tools/**"/>
</delete>
<delete dir="${target.dir}" quiet="true"/>
<delete dir="${omero.home}/test-output" quiet="true"/>
<delete includeemptydirs="true" quiet="true">
<fileset dir="${omero.home}/examples" includes="config.log,**/*.o,**/*.class,**/*.exe"/>
</delete>
</target>
<macrodef name="setup-py-install">
<attribute name="tarball"/>
<attribute name="dir"/>
<sequential>
<mkdir dir="${target.dir}"/>
<mkdir dir="${target.dir}/lib/python/site-packages"/>
<untar compression="gzip" src="${lib.dir}/repository/@{tarball}" dest="${target.dir}"/>
<exec executable="python" dir="${target.dir}/@{dir}" failonerror="true">
<env key="PYTHONPATH" value="${env.PYTHONPATH}:${target.dir}/lib/python/site-packages"/>
<arg value="setup.py"/>
<arg value="install"/>
<arg value="--prefix=${target.dir}"/>
</exec>
</sequential>
</macrodef>
<target name="check-scons" description="Checks for scons and sets executable or installs">
<available property="scons.py" value="${target.dir}/scons/scons.py" filepath="${target.dir}/scons" file="scons.py" />
<antcall target="build-scons" inheritAll="true" inheritRefs="true"/>
</target>
<target name="build-scons" description="Installs the scons build tool" unless="scons.py">
<unzip src="${lib.dir}/repository/scons-local-2.1.0.zip" dest="target/scons"/>
</target>
<target name="check-ice" description="Checks for slice/include files and unpacks">
<available property="slice.dir" value="true" filepath="${target.dir}" file="Ice" />
<antcall target="build-ice" inheritAll="true" inheritRefs="true"/>
<!-- Checking the slice2* version before continuing. See #1185 -->
<exec outputproperty="executable.ice.version" executable="slice2java">
<arg value="--version"/>
</exec>
<if>
<not>
<or>
<matches pattern="^${ice.compatibility}" string="${executable.ice.version}"/>
<matches pattern="^${ice.compatibility}" string="auto"/>
</or>
</not>
<then><fail>WRONG ICE VERSION!
slice2java version = ${executable.ice.version}
Expected version = ${ice.compatibility}
If you would like to configure which Ice to use,
set ice.compatibility=3.3 or ice.compatibility=3.4
in your etc/local.properties file or on the command-
line: ./build.py -Dice.compatibility=3.3
</fail></then>
</if>
</target>
<target name="build-ice" depends="check-scons" description="Installs the Ice code generation executables" unless="slice2java.exe">
<if><not><available file="${target.dir}/Ice"/></not><then>
<mkdir dir="${target.dir}/Ice"/>
<untar compression="gzip" src="${lib.dir}/repository/ice-includes-${versions.ice}.tar.gz" dest="target/Ice"/>
</then></if>
</target>
<target name="build-default" description="Default build calls build" depends="build"/>
<target name="build" description="Build all components except for C++" depends="init">
<property name="env.NOMAKE" value="1"/>
<iterate buildpathref="all.buildpath" target="dist"/>
<iterate buildpathref="all-tools.buildpath" target="tools-dist"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
<antcall target="build-dist" inheritRefs="true" inheritAll="true"/>
</target>
<!-- includes C++ -->
<target name="build-all" description="Build everything and copy to dist" depends="init">
<iterate buildpathref="all.buildpath" target="dist"/>
<iterate buildpathref="tools.buildpath" target="build"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
<antcall target="build-dist" inheritRefs="true" inheritAll="true"/>
</target>
<target name="build-dev" description="build-default, then test-compile and build-eclipse"
depends="clean,init,build-default,test-compile,build-eclipse"/>
<target name="build-all-dev" description="build-all, then test-compile and build-eclipse"
depends="clean,init,build-default,test-compile,build-eclipse"/>
<target name="build-blitz" description="Alias for 'build-server'" depends="build-server"/>
<target name="build-server" description="Build blitz and copy to dist/blitz" depends="init">
<iterate buildpathref="blitzserver.buildpath" target="dist"/>
<!-- Must also build python since it provides our command lines -->
<iterate buildpathref="OmeroPy.buildpath" target="tools-dist"/>
<iterate buildpathref="OmeroFs.buildpath" target="tools-dist"/>
<!-- TODO: importer too?? -->
<iterate buildpathref="tools.buildpath" target="dist"/>
<!-- Parts of build-dist -->
<antcall target="copy-licenses" inheritRefs="true" inheritAll="true"/>
<antcall target="copy-etc" inheritRefs="true" inheritAll="true"/>
<antcall target="copy-sql" inheritRefs="true" inheritAll="true"/>
<antcall target="copy-server" inheritRefs="true" inheritAll="true"/>
<antcall target="update-version" inheritRefs="true" inheritAll="true"/>
</target>
<target name="build-java" description="Build Java bindings to the OMERO server" depends="init">
<iterate buildpathref="blitzserver.buildpath" target="dist"/>
<iterate buildpathref="OmeroJava.buildpath" target="tools-dist"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
</target>
<target name="build-py" description="Build Python bindings to the OMERO server" depends="init">
<iterate buildpathref="blitzserver.buildpath" target="dist"/>
<iterate buildpathref="OmeroPy.buildpath" target="tools-dist"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
</target>
<target name="build-importer" description="Build importer and copy to dist/lib and dist/bin. May require 'build-java'" depends="init">
<iterate buildpathref="OmeroImporter.buildpath" target="tools-dist"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
<!-- Parts of build-dist -->
<antcall target="copy-client" inheritRefs="true" inheritAll="true"/>
<antcall target="copy-etc" inheritRefs="true" inheritAll="true"/>
<antcall target="update-version" inheritRefs="true" inheritAll="true"/>
</target>
<target name="build-insight" description="Build insight and copy to dist/lib and dist/bin. May require 'build-java'" depends="init">
<iterate buildpathref="tools.buildpath" target="dist"/>
<iterate buildpathref="insight.buildpath" target="dist"/>
<!-- Parts of build-dist -->
<antcall target="copy-client" inheritRefs="true" inheritAll="true"/>
<antcall target="copy-etc" inheritRefs="true" inheritAll="true"/>
<antcall target="update-version" inheritRefs="true" inheritAll="true"/>
</target>
<target name="build-web" description="Build OmeroWeb and copy to dist. May require 'build-py'" depends="init">
<iterate buildpathref="OmeroWeb.buildpath" target="tools-dist"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
<!-- Parts of build-dist -->
<antcall target="copy-etc" inheritRefs="true" inheritAll="true"/>
<antcall target="update-version" inheritRefs="true" inheritAll="true"/>
</target>
<target name="build-cpp" description="Build OmeroCpp bindings and copy to dist/lib" depends="init">
<iterate buildpathref="blitzserver.buildpath" target="dist"/>
<iterate buildpathref="OmeroCpp.buildpath" target="tools-dist"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
<!-- Parts of build-dist -->
<antcall target="copy-etc" inheritRefs="true" inheritAll="true"/>
<if><isset property="env.NOMAKE"/><then>
<echo>
+------------------------------------------------------------------------+
| |
| ==================================================================== |
| |
| WARNING: NOMAKE was set. C++ bindings will not have built correctly. |
| |
| If you used, 'build-default build-cpp' either use two |
| commands './build.py build-default; ./build.py build-cpp' |
| or use './build.py build-all' |
| ==================================================================== |
| |
+-------------------------------------------------------------------------
</echo></then>
</if>
</target>
<target name="build-schema" description="Build new DB schema and copy to sql/" depends="init">
<iterate buildpathref="dsl.buildpath" target="clean"/>
<iterate buildpathref="model.buildpath" target="clean"/>
<iterate buildpathref="dsl.buildpath" target="install"/>
<iterate buildpathref="model.buildpath" target="install"/>
<iterate buildpathref="model.buildpath" target="publish-schema"/>
<!-- Parts of build-dist -->
<antcall target="copy-sql" inheritRefs="true" inheritAll="true"/>
</target>
<target name="build-model" description="Generate model code for all language bindings" depends="init">
<ant antfile="${blitz.comp}/build.xml" dir="${blitz.comp}" target="icegen" inheritAll="false"/>
<!-- Parts of build-dist: updates both server and client -->
<antcall target="build-dist" inheritRefs="true" inheritAll="true"/>
</target>
<target name="build-matlab" description="Provides a matlab toolbox under target. May required 'build-java'" depends="init">
<iterate buildpathref="OmeroMatlab.buildpath" target="tools-dist"/>
<iterate buildpathref="tools.buildpath" target="dist"/>
<!-- Parts of build-dist -->
<antcall target="copy-etc" inheritRefs="true" inheritAll="true"/>
<antcall target="update-version" inheritRefs="true" inheritAll="true"/>
</target>
<target name="eclipse" depends="init">
<tryEclipse settingsRef="ivy.toplevel" filter="true"/>
</target>
<target name="build-eclipse" description="Creates all source directories needed by eclipse in case default build is failing." depends="init">
<iterate buildpathref="all.buildpath" target="eclipse"/>
<iterate buildpathref="insight.buildpath" target="eclipse"/>
<iterate buildpathref="OmeroJava.buildpath" target="eclipse"/>
<iterate buildpathref="OmeroImporter.buildpath" target="eclipse"/>
<tryEclipse settingsRef="ivy.toplevel" filter="true"/>
</target>
<macrodef name="launchSuite">
<attribute name="suite"/>
<attribute name="excludes" default="**/tools/build.xml"/>
<sequential>
<ivy:settings id="ivy.@{suite}" file="${etc.dir}/ivysettings.xml"/>
<ivy:buildlist reference="@{suite}.buildpath" settingsRef="ivy.@{suite}" ivyfilepath="test.xml">
<fileset dir="${omero.home}/components" includes="*/build.xml" excludes="**/insight/*/**/*.xml,@{excludes}"/>
<fileset dir="${omero.home}/components/tools" includes="*/build.xml"/>
</ivy:buildlist>
<iterate buildpathref="@{suite}.buildpath" target="@{suite}"/>
</sequential>
</macrodef>
<target name="test-compile" description="Compile all non-native tests" depends="init">
<property name="env.NOMAKE" value="1"/>
<launchSuite suite="test-compile"/>
</target>
<target name="test-compile-all" description="Compile all tests (including C++)" depends="init">
<launchSuite suite="test-compile"/>
</target>
<target name="test-unit" description="Run all non-native unit tests" depends="init">
<property name="env.NOMAKE" value="1"/>
<launchSuite suite="test"/>
</target>
<target name="test-unit-all" description="Run all unit (including C++) tests" depends="init">
<launchSuite suite="test"/>
</target>
<target name="test-integration" description="Run all non-native integration tests" depends="init">
<property name="env.NOMAKE" value="1"/>
<launchSuite suite="integration"/>
</target>
<target name="test-integration-all" description="Run all integration (including C++) tests" depends="init">
<launchSuite suite="integration"/>
</target>
<target name="test-server" description="Run all non-tools/ tests" depends="init">
<launchSuite suite="integration" excludes="**/tools/build.xml,**/tools/**/build.xml"/>
</target>
<target name="test-report" description="Joins test results into a single report">
<mkdir dir="${target.dir}/reports"/>
<junitreport todir="${target.dir}/reports">
<fileset dir="${basedir}/components">
<include name="*/target/reports/xml/*.xml"/>
</fileset>
<fileset dir="${basedir}/components/tools/">
<include name="*/target/reports/xml/*.xml"/>
</fileset>
<report format="frames" todir="${target.dir}/reports/html"/>
</junitreport>
</target>
<target name="test-dist" description="Copy test files into dist for further testing" depends="test-compile">
<ivy:resolve file="test.xml" type="jar" conf="test" settingsRef="ivy.toplevel" log="quiet"/>
<ivy:retrieve conf="test" pattern="${dist.dir}/lib/client/[artifact].[ext]" sync="false" log="quiet" settingsRef="ivy.toplevel"/>
</target>
<target name="examples-cpp" description="Build and run OmeroCpp examples">
<scons_py dir="${basedir}/examples">
<arg value="builddir=${dist.dir}"/>
<arg value="run_cpp=1"/>
<arg value="no_java=1"/>
</scons_py>
</target>
<target name="examples-java" description="Build and run OmeroJava examples">
<scons_py dir="${basedir}/examples">
<arg value="run_java=1"/>
<arg value="no_cpp=1"/>
</scons_py>
</target>
<target name="examples-py" description="Build and run OmeroPy examples">
<scons_py dir="${basedir}/examples" pythonpath="${env.PYTHONPATH}"><!-- omit OmeroPy/src -->
<arg value="run_py=1"/>
<arg value="no_cpp=1"/>
<arg value="no_java=1"/>
</scons_py>
</target>
<target name="release-zip" description="Zip the dist directory into ${product.name}-${omero.version}.zip">
<zip destfile="${omero.home}/target/${product.name}-${omero.version}.zip">
<zipfileset dir="${dist.dir}" prefix="${product.name}-${omero.version}"
excludes="bin/omero"/>
<zipfileset dir="${dist.dir}" prefix="${product.name}-${omero.version}"
includes="bin/omero"
filemode="755"/>
</zip>
<zip destfile="${omero.home}/target/OMERO.py-${omero.version}.zip">
<zipfileset dir="${dist.dir}" prefix="OMERO.py-${omero.version}"
includes="bin/**,etc/**,lib/python/**,lib/fallback/**,sql/**" excludes="bin/omero"/>
<zipfileset dir="${dist.dir}" prefix="OMERO.py-${omero.version}"
includes="bin/omero" filemode="755"/>
</zip>
<zip destfile="${omero.home}/target/OMERO.java-${omero.version}.zip">
<zipfileset dir="${blitz.comp}/src" prefix="OMERO.java-${omero.version}/src" includes="**/*.java"/>
<zipfileset dir="${blitz.comp}/target" prefix="OMERO.java-${omero.version}/src" includes="**/*.java"/>
<zipfileset dir="${blitz.comp}/generated" prefix="OMERO.java-${omero.version}/src" includes="**/*.java"/>
<zipfileset dir="${insight.comp}/SRC" prefix="OMERO.java-${omero.version}/src" includes="**/*.java"/>
<zipfileset dir="${OmeroJava.comp}/src" prefix="OMERO.java-${omero.version}/src" includes="**/*.java"/>
<zipfileset dir="${dist.dir}/lib/client" prefix="OMERO.java-${omero.version}/libs" includes="**/*.jar"/>
</zip>
<copy todir="target">
<fileset dir="components/tools/OmeroImporter/target" includes="*.zip"/>
</copy>
<copy file="components/tools/OmeroM/target/OmeroMatlab.zip" tofile="target/OMERO.matlab-${omero.version}.zip"/>
<copy todir="target">
<fileset dir="components/tools/OmeroPy/dist" includes="*.egg"/>
<fileset dir="components/tools/OmeroFS/dist" includes="*.egg"/>
</copy>
<!-- These should eventually be removed in favor of an ivy-based approach -->
<copy todir="target">
<fileset dir="components/insight/target" includes="insight*.zip" excludes="*-ij*.zip"/>
<mapper type="regexp" from="insight(.*).zip" to="OMERO.insight-${omero.version}\1.zip"/>
</copy>
<copy todir="target">
<fileset dir="components/insight/target" includes="editor*.zip"/>
<mapper type="regexp" from="editor(.*).zip" to="OMERO.editor-${omero.version}\1.zip"/>
</copy>
<copy todir="target">
<fileset dir="components/insight/target" includes="importer*.zip"/>
<mapper type="regexp" from="importer(.*).zip" to="OMERO.importer -${omero.version}\1.zip"/>
</copy>
<copy file="components/insight/target/insight-ij.zip" tofile="target/OMERO.insight-ij-${omero.version}.zip"/>
</target>
<target name="release-src" description="Zip the git source into OMERO.source-${omero.version}.zip">
<git command="archive" output="release-src-command" failonerror="true">
<args>
<arg value="--format=zip"/>
<arg value="HEAD"/>
<arg value="-o"/>
<arg value="${target.dir}/OMERO.source-${omero.version}.zip"/>
</args>
</git>
</target>
<target name="release-clients">
<!-- This replaces the previous OMERO-trunk-clients build -->
<mkdir dir="target/pkg"/>
<delete includeemptydirs="true">
<fileset dir="target/pkg" includes="**/*"/>
</delete>
<apply executable="python" dir="${target.dir}/pkg" failonerror="true">
<env key="OMERO_VERSION" value="${omero.version}"/>
<fileset dir="${omero.home}/lib" includes="composite.py"/>
</apply>
</target>
<target name="release-tar" description="Tar the dist directory into ${product-name}-${omero.version}.tar.bz2">
<tar destfile="${product.name}-${omero.version}.tar.bz2" compression="bzip2">
<zipfileset dir="${dist.dir}" prefix="${product.name}-${omero.version}"
excludes="bin/omero"/>
<zipfileset dir="${dist.dir}" prefix="${product.name}-${omero.version}"
includes="bin/omero"
filemode="755"/>
</tar>
</target>
<target name="release-headers" description="Generates headers.xml for all components" depends="init">
<iterate buildpathref="all.buildpath" target="headers"/>
<iterate buildpathref="tools.buildpath" target="headers"/>
<taskdef resource="checkstyletask.properties" classpathref="omero.classpath"/>
<checkstyle config="${omero.home}/docs/styles/checkstyle-header.xml" failOnViolation="true">
<fileset dir="${basedir}" includes="*,docs/**/*,etc/**/*,sql/**/*"/>
<formatter type="xml" toFile="${target.dir}/headers.xml"/>
</checkstyle>
</target>
<target name="release-findbugs" description="Generates findbugs.xml and checkstyle.xml for all components" depends="init">
<iterate buildpathref="all.buildpath" target="findbugs"/>
<iterate buildpathref="tools.buildpath" target="findbugs"/>
</target>
<target name="release-jdepend" description="Generates jdepend.xml for all components" depends="init">
<path id="omero.classpath">
<fileset dir="${omero.home}/lib/repository"/>
</path>
<jdepend outputfile="target/jdepend.txt" fork="yes" classpathref="omero.classpath">
<exclude name="java.*"/>
<exclude name="java.lang.*"/>
<exclude name="java.io.*"/>
<exclude name="java.util.*"/>
<exclude name="javax.*"/>
<exclude name="org.springframework.*"/>
<exclude name="org.springframework.orm.*"/>
<exclude name="org.apache.*"/>
<exclude name="net.ehcache.*"/>
<classespath>
<!--pathelement location="components/model/target/classes"/-->
<pathelement location="components/server/target/classes"/>
<!--pathelement location="components/blitz/target/classes"/-->
</classespath>
</jdepend>
<jdepend outputfile="target/jdepend.xml" fork="yes" format="xml" classpathref="omero.classpath">
<exclude name="java.*"/>
<exclude name="java.lang.*"/>
<exclude name="java.io.*"/>
<exclude name="java.util.*"/>
<exclude name="javax.*"/>
<exclude name="org.springframework.*"/>
<exclude name="org.springframework.orm.*"/>
<exclude name="org.apache.*"/>
<exclude name="net.ehcache.*"/>
<classespath>
<!--pathelement location="components/model/target/classes"/-->
<pathelement location="components/server/target/classes"/>
<!--pathelement location="components/blitz/target/classes"/-->
</classespath>
</jdepend>
<style in="target/jdepend.xml" out="target/jdepend.dot" style="lib/repository/jdepend2dot.xsl"/>
<exec executable="dot" failifexecutionfails="false"> <!-- In case dot is missing -->
<arg value="-Tpng"/>
<arg value="target/jdepend.dot"/>
<arg value="-o"/>
<arg value="target/jdepend.png"/>
</exec>
</target>
<target name="release-coverage" depends="build-eclipse"
description="Merge code coverage reports into single top-level report">
<path id="omero.classpath">
<fileset dir="${omero.home}/target/libs" />
</path>
<taskdef resource="emma_ant.properties" classpathref="omero.classpath" />
<emma>
<merge outfile="${target.dir}/coverage.es" >
<fileset dir="components" includes="**/target/coverage.emma,**/target/metadata.emma"/>
</merge>
<report sourcepath="${src.dir}" >
<fileset dir="${target.dir}" includes="coverage.es"/>
<html outfile="${target.dir}/coverage.html" />
<xml outfile="${target.dir}/coverage.xml" />
</report>
</emma>
</target>
<target name="release-docs" depends="release-javadoc,release-epydoc,release-slice2html" description="Generate Docs for all components under dist/docs/api">
<zip destfile="${omero.home}/target/OMERO.docs-${omero.version}.zip">
<zipfileset dir="${dist.dir}/docs" prefix="OMERO.docs-${omero.version}"/>
</zip>
<gitdescribe select="\2"> </gitdescribe>
<exec executable="make" failonerror="true" dir="${sphinx.dir}">
<env key="SOURCE_BRANCH" value="v.${version.describe}"/>
<env key="OMERO_RELEASE" value="${version.describe}"/>
<arg line="clean html latexpdf"/>
</exec>
<copy file="${sphinx.dir}/_build/latex/OMERO-${version.describe}.pdf" tofile="${omero.home}/target/OMERO-${version.describe}.pdf" overwrite="true"/>
<zip destfile="${omero.home}/target/OMERO.sphinx-${omero.version}.zip">
<zipfileset dir="${sphinx.dir}/_build/html/" prefix="OMERO.sphinx-${omero.version}"/>
</zip>
</target>
<target name="release-slice2html" description="The Ice API Documentation">
<mkdir dir="${omero.home}/target/docs"/>
<copy file="${blitz.comp}/resources/header.txt" tofile="${omero.home}/target/docs/header.txt" overwrite="true"/>
<copy file="${blitz.comp}/resources/footer.txt" tofile="${omero.home}/target/docs/footer.txt" overwrite="true"/>
<replace file="${omero.home}/target/docs/header.txt" token="@VERSION@" value="${omero.version}"/>
<replace file="${omero.home}/target/docs/footer.txt" token="@VERSION@" value="${omero.version}"/>
<mkdir dir="${dist.dir}/docs/api/slice2html"/>
<apply executable="slice2html" parallel="true" failonerror="true">
<arg value="--hdr"/>
<arg value="${omero.home}/target/docs/header.txt"/>
<!-- <arg value="-REMOVETHISTEXTBETWEENDASHES-ftr"/> Commented out as causing a crash in slice2html
<arg value="${omero.home}/target/docs/footer.txt"/> -->
<arg value="-I"/>
<arg value="${blitz.comp}/generated"/>
<arg value="-I"/>
<arg value="${blitz.comp}/resources"/>
<arg value="-I"/>
<arg value="${omero.home}/target/Ice/slice"/>
<arg value="--output-dir"/>
<arg value="${dist.dir}/docs/api/slice2html"/>
<!-- The order here is important. Later docs overwrite earlier ones -->
<fileset dir="${omero.home}/components/tools" includes="**/resources/**/*.ice"/>
<fileset dir="${omero.home}/components/server/src" includes="**/*.ice"/>
<fileset dir="${omero.home}/components/blitz/generated" includes="**/*.ice"/>
<fileset dir="${omero.home}/components/blitz/resources" includes="**/*.ice"/>
<fileset dir="${omero.home}/components/blitz/resources" includes="README.ice"/>
</apply>
</target>
<target name="release-epydoc" description="The OmeroPy API Documentation">
<mkdir dir="${dist.dir}/docs/api/epydoc"/>
<exec executable="epydoc" failonerror="true">
<arg value="--verbose"/>
<arg value="--parse-only"/>
<arg value="--show-imports"/>
<arg value="--navlink=@NAVLINK@"/>
<arg value="--html"/>
<arg value="--graph=all"/>
<arg value="--exclude-introspect=monitors"/><!-- causes a crash if included, review with next release -->
<arg value="-n"/>
<arg value="OmeroPy API Documentation"/>
<arg value="--css"/>
<arg value="docs/epydocstyle.css"/>
<arg value="-o"/>
<arg value="${dist.dir}/docs/api/epydoc"/>
<arg value="${dist.dir}/lib/python/omero"/>
<arg value="${dist.dir}/lib/python/omeroweb"/>
</exec>
<replace dir="${dist.dir}/docs/api/epydoc"
token="@NAVLINK@"
value="<div id="name-and-version">OmeroPy API ${omero.version}</div><div id="top-logo" style="display:none">&nbsp;<a href="http://hudson.openmicroscopy.org.uk/job/OMERO/javadoc/" target="_top"><div id="ome-logo-inner"><img src="http://hudson.openmicroscopy.org.uk/userContent/ome_docs_trac_banner.png" alt="OME Docs"></a></div>"/>
<replace dir="${dist.dir}/docs/api/epydoc">
<replacetoken><![CDATA[<head>]]></replacetoken>
<replacevalue><![CDATA[<head profile="http://www.w3.org/2005/10/profile" >
<link rel="icon"
type="image/vnd.microsoft.icon"
href="http://hudson.openmicroscopy.org.uk/userContent/favicon.ico">]]></replacevalue>
</replace>
</target>
<target name="release-javadoc" description="Generate Javadocs for all components under dist/docs/api">
<mkdir dir="${dist.dir}/docs/api"/>
<patternset id="all.java.files">
<!-- Includes prefixed with "**" in order to pick up
tools/ components -->
<include name="src/**/*.java"/>
<include name="target/generated/src/**/*.java"/>
<exclude name="xxx/**"/>
</patternset>
<mkdir dir="target/docs"/>
<copy file="docs/overview.html" tofile="target/docs/overview.html" overwrite="true"/>
<replace file="target/docs/overview.html" token="@VERSION@" value="${omero.version}"/>
<javadoc
failonerror="true"
Verbose="false"
maxmemory="${javadoc.maxmem}"
destdir="${dist.dir}/docs/api"
author="true"
version="true"
use="true"
breakiterator="true"
windowtitle="OMERO (OME Remote Objects) Server"
overview="target/docs/overview.html"
stylesheetfile="docs/javadocsstyle.css">
<classpath>
<fileset dir="lib">
<include name="**/*.jar"/>
<exclude name="repository/omero/**"/>
<exclude name="repository/omero-tools/**"/>
</fileset>
</classpath>
<fileset dir="components/common/" defaultexcludes="yes">
<patternset refid="all.java.files"/>
</fileset>
<fileset dir="components/server/" defaultexcludes="yes">
<patternset refid="all.java.files"/>
</fileset>
<fileset dir="components/romio/" defaultexcludes="yes">
<patternset refid="all.java.files"/>
</fileset>
<fileset dir="components/rendering/" defaultexcludes="yes">
<patternset refid="all.java.files"/>
</fileset>
<!-- Skipping generated files for blitz. Just too many -->
<fileset dir="components/blitz/src" defaultexcludes="yes" includes="**/*.java"/>
<fileset dir="components/tools/OmeroJava" defaultexcludes="yes">
<patternset refid="all.java.files"/>
</fileset>
<doctitle><![CDATA[<h1> Omero API </h1>]]></doctitle>
<bottom><![CDATA[
<div id="ome-logo-for-top" style="display:none"><a href="http://hudson.openmicroscopy.org.uk/job/OMERO/javadoc/" target="_top"><div id="ome-logo-inner"><img src="http://hudson.openmicroscopy.org.uk/userContent/ome_docs_trac_banner.png" alt="OME Docs"></a></div></div>
<div id="doc-name-right" style="position: absolute;top: 90px;right: 20px;"><b>OmeroJava Api</b></div>
<p><i>Version: ${omero.version}</i></p>
<p><b><i>Copyright © @@YEAR@@ The University of Dundee & Open Microscopy Environment. All Rights Reserved.</i></b></p>
]]></bottom>
<tag name="DEV.TODO" scope="all" description="To do:"/>
<group title="A. Core System"
packages="ome.api:ome.conditions*:ome.parameters*:ome.system*"/>
<group title="B. Model"
packages="ome.model*"/>
<group title="C. Client Packages"
packages="ome.client*:ome.adapters*:pojos*"/>
<group title="D. Server Packages"
packages="ome.api.local*:ome.services*:ome.logic*:ome.tools*:ome.security*:ome.io*:ome.annotations*"/>
<group title="E. Blitz Server"
packages="ome.services.blitz*"/>
<group title="E. Blitz Client"
packages="omero*:omeroj*"/>
<group title="G. Rendering Engine"
packages="omeis*"/>
<group title="H. Utilities"
packages="ome.util*"/>
<group title="I. Deprecated"
packages="ome.dynamic*:ome.rules*"/>
<link href="http://java.sun.com/j2se/1.5/docs/api/"/>
<link href="http://www.springframework.org/docs/api/"/>
<link href="http://www.hibernate.org/hib_docs/v3/api/"/>
<link href="http://aopalliance.sourceforge.net/doc/"/>
<link href="http://lucene.apache.org/java/2_2_0/api"/>
</javadoc>
<replace dir="${dist.dir}/docs/api">
<replacetoken><![CDATA[<HEAD>]]></replacetoken>
<replacevalue><![CDATA[<HEAD profile="http://www.w3.org/2005/10/profile">
<link rel="icon"
type="image/vnd.microsoft.icon"
href="http://hudson.openmicroscopy.org.uk/userContent/favicon.ico">]]></replacevalue>
</replace>
<tstamp>
<format property="yearvalue" pattern="yyyy"/>
</tstamp>
<replace dir="${dist.dir}/docs/api" value="${yearvalue}">
<replacetoken><![CDATA[@@YEAR@@]]></replacetoken>
</replace>
</target>
<target name="release-hudson" depends="check-ivy" description="Saves to the hudson repository for dependent builds">
<ivy:resolve settingsRef="ivy.toplevel"
file="${omero.home}/ivy.xml" type="zip" log="quiet"/>
<ivy:publish settingsRef="ivy.toplevel"
artifactspattern="${omero.home}/OMERO.server-${omero.version}.zip"
srcivypattern="${omero.home}/ivy.xml"
resolver="test-resolver"
pubrevision="${omero.version}"
pubdate="${now}"
status="integration"
overwrite="true"/>
<!-- This causes the ivy file to be modified -->
<!--forcedeliver="true"-->
<ivy:install settingsRef="ivy.toplevel"
organisation="omero" module="main" revision="${omero.version}"
from="omero-resolver" to="hudson-repository"
transitive="true" overwrite="true"/>
</target>
<target name="release-nsis" description="Creates a Windows installer with NSIS">
<taskdef name="nsis" classname="net.sf.nsisant.Task">
<classpath location="lib/repository/nsisant-${versions.nsisant}.jar"/>
</taskdef>
<property name="nsis.dir" value="${omero.home}/components/antlib/nsis"/>
<nsis script="${nsis.dir}/omero.nsi" verbosity="4" noconfig="yes" nocd="yes"><!-- out="target/nsis.log"-->
<define name="VERSION" value="4.1.0.0"/><!--${omero.version} Last digit build?"-->
<define name="OMERO_VERSION" value="${omero.version}"/>
<define name="DBVERSION" value="${omero.db.version}"/>
<define name="DBPATCH" value="${omero.db.patch}"/>
<define name="INCLUDE_DIR" value="${nsis.dir}"/>
<define name="INSTALLER_NAME" value="${omero.home}/target/omero_installer-${omero.version}.exe"/>
<!--scriptcmd cmd="AutoCloseWindow true"/-->
</nsis>
</target>
<target name="release-training" description="Produces a zip with the examples/Training files">
<zip destfile="${omero.home}/target/OMERO.training-${omero.version}.zip">
<zipfileset dir="${omero.home}/examples/Training" prefix="OMERO.training-${omero.version}" includes="**" excludes="markup.py"/>
<zipfileset dir="${omero.home}" prefix="OMERO.training-${omero.version}" includes="LICENSE.txt"/>
</zip>
</target>
<!--
Top-level helpers (shared helpers are in components/antlib/resources)
=====================================================================
-->
<target name="build-dist" depends="init,copy-licenses,copy-etc,copy-sql,copy-server,copy-client,update-version"
description="Copy all components to dist/; called at the end of build-* targets"/>
<target name="copy-licenses" depends="init">
<copy file="${omero.home}/LICENSE.txt" todir="${dist.dir}/"/>
<copy todir="${dist.dir}">
<fileset dir="${omero.home}/lib/" includes="licenses/**"/>
</copy>
</target>
<target name="copy-etc" depends="init">
<copy todir="${dist.dir}/etc">
<fileset dir="${omero.home}/etc">
<exclude name="local.properties"/>
</fileset>
</copy>
<replace dir="${dist.dir}/etc" token="@ICE_LIB_VERSION@" value="${versions.ice_lib}"/>
</target>
<target name="copy-sql" depends="init">
<copy todir="${dist.dir}">
<fileset dir="${omero.home}">
<include name="sql/**"/>
</fileset>
</copy>
</target>
<target name="copy-client" depends="init">
<mkdir dir="${dist.dir}/lib/client"/>
<!-- sync="true" deletes any other files like services.jar or extensions.jar which may be under lib -->
<ivy:resolve file="ivy.xml" type="jar,egg" conf="client" settingsRef="ivy.toplevel" log="quiet"/>
<ivy:retrieve conf="client" pattern="${dist.dir}/lib/client/[artifact].[ext]" sync="false" log="quiet" settingsRef="ivy.toplevel"/>
</target>
<target name="copy-server" depends="init">
<mkdir dir="${dist.dir}/lib/server"/>
<!-- sync="true" deletes any other files like services.jar or extensions.jar which may be under lib -->
<ivy:resolve file="ivy.xml" type="jar,egg" conf="server" settingsRef="ivy.toplevel" log="quiet"/>
<ivy:retrieve conf="server" pattern="${dist.dir}/lib/server/[artifact].[ext]" sync="false" log="quiet" settingsRef="ivy.toplevel"/>
</target>
<macrodef name="jar_update_if">
<attribute name="destfile"/>
<element name="filesets" implicit="yes"/>
<sequential>
<if>
<available file="@{destfile}"/>
<then>
<jar update="true" destfile="@{destfile}">
<filesets/>
</jar>
<signjar alias="${jarsign.alias}"
keystore="${jarsign.keystore}"
storepass="${jarsign.storepass}"
preservelastmodified="true"
jar="@{destfile}"/>
</then>
</if>
</sequential>
</macrodef>
<target name="update-version">
<loadproperties srcFile="${dist.dir}/etc/omero.properties">
<filterchain>
<headfilter skip="20" lines="-1"/>
<prefixlines prefix="dist.check."/>
</filterchain>
</loadproperties>
<if><not><equals arg1="${dist.check.omero.version}" arg2="${omero.version}"/></not>
<then>
<!-- Setting version -->
<copy todir="${dist.dir}/etc" overwrite="true">
<fileset dir="${omero.home}/etc" includes="omero.properties"/>
</copy>
<echo file="${dist.dir}/etc/omero.properties" append="true">
omero.version=${omero.version}
</echo>
<!-- Must update the jars with the modified omero.properties file in order for the version to be updated -->
<jar_update_if destfile="${dist.dir}/lib/server/blitz.jar">
<fileset dir="${dist.dir}/etc" includes="omero.properties"/>
</jar_update_if>
<jar_update_if destfile="${dist.dir}/lib/client/omero_client.jar">
<fileset dir="${dist.dir}/etc" includes="omero.properties"/>
</jar_update_if>
<jar_update_if destfile="${dist.dir}/lib/client/OmeroImporter.jar">
<fileset dir="${dist.dir}/etc" includes="omero.properties"/>
</jar_update_if>
</then>
</if>
</target>
<target name="keystore" depends="init" description="Create keystore">
<genkey alias="${jarsign.alias}"
keystore="${jarsign.keystore}"
storepass="${jarsign.storepass}"
validity="${jarsign.validity}">
<dname>
<param name="CN" value="omedev"/>
<param name="OU" value="Open Microscopy Team"/>
<param name="O" value="openmicroscopy.org"/>
<param name="C" value="UK"/>
</dname>
</genkey>
</target>
<target name="server-verify">
<apply executable="jarsigner" failonerror="true">
<fileset dir="${dist.dir}/lib/server" includes="*.jar"/>
<arg value="-verify"/>
</apply>
</target>
<target name="webstart-sign">
<signjar alias="${jarsign.alias}" keystore="${jarsign.keystore}" storepass="${jarsign.storepass}" preservelastmodified="false">
<path>
<fileset dir="${dist.dir}/lib/insight" includes="*.jar"/>
</path>
</signjar>
</target>
<target name="webstart-verify">
<apply executable="jarsigner" failonerror="true">
<fileset dir="${dist.dir}/lib/insight" includes="*.jar"/>
<arg value="-verify"/>
</apply>
</target>
<target name="release-webstart" depends="init" description="Generates webstart jars under dist/lib/insight">
<unzip src="components/insight/OUT/dist/OMERO.insight-${omero.version}.zip" dest="${dist.dir}/lib/insight">
<patternset>
<include name="**/*.jar"/>
</patternset>
<flattenmapper/>
</unzip>
<antcall target="webstart-sign" inheritAll="true" inheritRefs="true"/>
<copy file="components/insight/SRC/org/openmicroscopy/shoola/env/ui/graphx/omeabout-bk.png" tofile="${dist.dir}/lib/insight/ome.png"/>
</target>
<macrodef name="gitdescribe">
<attribute name="regexp" default="^(v.)?(.*?)(-[0-9]+)?((-)g(.*?))?$"/>
<attribute name="select" default="\2"/>
<sequential>
<trycatch>
<try>
<git command="describe" output="fullversion" failonerror="true">
<args>
<arg line="--dirty"/>
</args>
</git>
<propertyregex property="version.describe" input="${fullversion}" regexp="@{regexp}" select="@{select}"/>
</try>
<catch>
<echo>UNKNOWN</echo>
</catch>
</trycatch>
</sequential>
</macrodef>
<target name="version">
<gitdescribe select="\2\3\5\6">
</gitdescribe>
<echo>${version.describe}-ice${versions.ice_lib}</echo>
</target>
<target name="print-mem">
<echo>
javac.maxmem=${javac.maxmem}
javadoc.maxmem=${javadoc.maxmem}
</echo>
</target>
</project>