Skip to main content
summaryrefslogtreecommitdiffstats
blob: a3788215755f7baaa7655b55a31a72bbb7399f6c (plain) (blame)
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
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
<?xml version="1.0" encoding="UTF-8"?>

<!--
    Copyright (c) 2009, 2011 IBM Corporation and others.
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    http://www.eclipse.org/legal/epl-v10.html
   
    Contributors:
        IBM Corporation - initial API and implementation
 -->

<!-- 
 
	TAG: a tag param can be passed in to work on branch. If no tag is set master is used.
		For example: ant -f buildSWT.xml increment_version -DTAG=R3_5_maintenance
		
	natives_changed: when starting a integration build the increment of the version 
		can be forced by setting this project. If property is not defined the increment 
		is determine automatically based on changes in the native code since the last 
		revision in the swp.map.
		for Example: ant -f buildSWT.xml increment_version -Dnatives_changed=true
	
	To build the libraries of a fragment, run
		ant -f <fragment dir>/build.xml build_libraries 
	
	Notes:
	 To void clean after build define a property named "clean" to empty ("").
	 To run only clean define a property named "targets" to empty ("").
	 
 -->

<project name="swtbuild" basedir="../../..">
	<property name="gitroot" value="fheidric@dev.eclipse.org:/gitroot/platform/"/>
	<property name="keyfile" value="C:\BUILD\ssh\swtbuild_dsa_private" /> 
	<property name="TAG" value="master"/>
	<property name="src.repo" value="eclipse.platform.swt"/>
	<property name="bin.repo" value="eclipse.platform.swt.binaries"/>
	<property name="releng.repo" value="eclipse.platform.releng"/>
	<property name="tmphome" value="./tmp"/>

	<property name="cp_common" value="'bundles/org.eclipse.swt/Eclipse SWT/common/library' 'bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library' 'bundles/org.eclipse.swt/Eclipse SWT PI/common/library'"/>
	<property name="cp_win32" value="${cp_common} 'bundles/org.eclipse.swt/Eclipse SWT PI/win32/library' 'bundles/org.eclipse.swt/Eclipse SWT AWT/win32/library' 'bundles/org.eclipse.swt/Eclipse SWT OpenGL/win32/library' 'bundles/org.eclipse.swt/Eclipse SWT WebKit/win32/library'"/>
	<property name="cp_gtk" value="${cp_common} 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library' 'bundles/org.eclipse.swt/Eclipse SWT AWT/gtk/library' 'bundles/org.eclipse.swt/Eclipse SWT OpenGL/glx/library' 'bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library' 'bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library' 'bundles/org.eclipse.swt/Eclipse SWT Program/cde/library'"/>
	<property name="cp_cocoa" value="${cp_common} 'bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library' 'bundles/org.eclipse.swt/Eclipse SWT AWT/cocoa/library'"/>
	<property name="cp_carbon" value="${cp_common} 'bundles/org.eclipse.swt/Eclipse SWT PI/carbon/library' 'bundles/org.eclipse.swt/Eclipse SWT OpenGL/carbon/library'"/>
	<property name="cp_motif" value="${cp_common} 'bundles/org.eclipse.swt/Eclipse SWT PI/motif/library' 'bundles/org.eclipse.swt/Eclipse SWT PI/motif_gtk/library'  'bundles/org.eclipse.swt/Eclipse SWT AWT/motif/library' 'bundles/org.eclipse.swt/Eclipse SWT OpenGL/glx/library' 'bundles/org.eclipse.swt/Eclipse SWT PI/cairo/library' 'bundles/org.eclipse.swt/Eclipse SWT Program/gnome/library' 'bundles/org.eclipse.swt/Eclipse SWT Program/cde/library'"/>
	<property name="cp_wpf" value="${cp_common} 'bundles/org.eclipse.swt/Eclipse SWT PI/wpf/library' 'bundles/org.eclipse.swt/Eclipse SWT PI/wpf_win32/library'"/>
	<property name="cp_photon" value="${cp_common} 'bundles/org.eclipse.swt/Eclipse SWT PI/photon/library'"/>
	
	<property name="library_j2se" value="bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java"/>
	<property name="library_j2me" value="bundles/org.eclipse.swt/Eclipse SWT PI/common_j2me/org/eclipse/swt/internal/Library.java"/>
	<property name="make_common" value="bundles/org.eclipse.swt/Eclipse SWT/common/library/make_common.mak"/>
	<property name="version_file" value="bundles/org.eclipse.swt/Eclipse SWT/common/version.txt"/>
	<property name="build_notes" value="bundles/org.eclipse.swt/buildnotes_swt.html"/>
		
	<target name="check_libraries" depends="get_version">
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="5"/>
			<param name="fragment" value="org.eclipse.swt.carbon.macosx"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="4"/>
			<param name="fragment" value="org.eclipse.swt.cocoa.macosx"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="4"/>
			<param name="fragment" value="org.eclipse.swt.cocoa.macosx.x86_64"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="5"/>
			<param name="fragment" value="org.eclipse.swt.gtk.aix.ppc"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="5"/>
			<param name="fragment" value="org.eclipse.swt.gtk.aix.ppc64"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="4"/>
			<param name="fragment" value="org.eclipse.swt.gtk.hpux.ia64_32"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="11"/>
			<param name="fragment" value="org.eclipse.swt.gtk.linux.ppc"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="10"/>
			<param name="fragment" value="org.eclipse.swt.gtk.linux.ppc64"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="10"/>
			<param name="fragment" value="org.eclipse.swt.gtk.linux.s390"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="10"/>
			<param name="fragment" value="org.eclipse.swt.gtk.linux.s390x"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="12"/>
			<param name="fragment" value="org.eclipse.swt.gtk.linux.x86"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="12"/>
			<param name="fragment" value="org.eclipse.swt.gtk.linux.x86_64"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="9"/>
			<param name="fragment" value="org.eclipse.swt.gtk.solaris.sparc"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="8"/>
			<param name="fragment" value="org.eclipse.swt.gtk.solaris.x86"/>
		</antcall>
		<!-- Motif is not being built
		antcall target="check_fragment_libraries">
			<param name="library_count" value="9"/>
			<param name="fragment" value="org.eclipse.swt.motif.linux.x86"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="4"/>
			<param name="fragment" value="org.eclipse.swt.motif.aix.ppc"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="3"/>
			<param name="fragment" value="org.eclipse.swt.motif.hpux.ia64_32"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="5"/>
			<param name="fragment" value="org.eclipse.swt.motif.solaris.sparc"/>
		</antcall-->
		<!-- Photon is not being built
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="1"/>
			<param name="fragment" value="org.eclipse.swt.photon.qnx.x86"/>
		</antcall>
		-->
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="4"/>
			<param name="fragment" value="org.eclipse.swt.win32.win32.ia64"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="6"/>
			<param name="fragment" value="org.eclipse.swt.win32.win32.x86"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="4"/>
			<param name="fragment" value="org.eclipse.swt.win32.win32.x86_64"/>
		</antcall>
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="1"/>
			<param name="fragment" value="org.eclipse.swt.win32.wce_ppc.arm"/>
		</antcall>
		<!-- WPF is not being built
		<antcall target="check_fragment_libraries">
			<param name="library_count" value="2"/>
			<param name="fragment" value="org.eclipse.swt.wpf.win32.x86"/>
		</antcall>
		-->
	</target>
	
	<target name="check_fragment_libraries" depends="get_version">
		<property name="checkdir" value="~/build/check_libraries"/>
		<property name="library_count" value="124"/>
		<property name="fragment" value=""/>
		<fileset id="match" dir="${bin.repo}/bundles/${fragment}">
			<filename regex="[0-9][0-9][0-9][0-9]."/>
			<filename regex="${swt_version}."/>
			<exclude name="**/.git/**"/>
			<exclude name="**/org.eclipse.swt.gtk.hpux.ia64/**"/>
			<exclude name="**/org.eclipse.swt.gtk.linux.ia64/**"/>
			<exclude name="**/org.eclipse.swt.motif.aix.ppc/**"/>
			<exclude name="**/org.eclipse.swt.motif.hpux.ia64_32/**"/>
			<exclude name="**/org.eclipse.swt.motif.hpux.PA_RISC/**"/>
			<exclude name="**/org.eclipse.swt.motif.linux.x86/**"/>
			<exclude name="**/org.eclipse.swt.motif.solaris.sparc/**"/>
			<exclude name="**/org.eclipse.swt.photon.qnx.x86/**"/>
			<exclude name="**/org.eclipse.swt.wpf.win32.x86/**"/>
		</fileset>
		<fileset id="not_match" dir="${bin.repo}/bundles/${fragment}">
			<filename regex="[0-9][0-9][0-9][0-9]."/>
			<filename regex="${swt_version}." negate="true"/>
			<exclude name="**/.git/**"/>
			<exclude name="**/org.eclipse.swt.gtk.hpux.ia64/**"/>
			<exclude name="**/org.eclipse.swt.gtk.linux.ia64/**"/>
			<exclude name="**/org.eclipse.swt.motif.aix.ppc/**"/>
			<exclude name="**/org.eclipse.swt.motif.hpux.ia64_32/**"/>
			<exclude name="**/org.eclipse.swt.motif.hpux.PA_RISC/**"/>
			<exclude name="**/org.eclipse.swt.motif.linux.x86/**"/>
			<exclude name="**/org.eclipse.swt.motif.solaris.sparc/**"/>
			<exclude name="**/org.eclipse.swt.photon.qnx.x86/**"/>
			<exclude name="**/org.eclipse.swt.wpf.win32.x86/**"/>
		</fileset>
		<property name="not_match_text" refid="not_match"/>
		<echo>Old libraries: ${not_match_text}</echo>
		<resourcecount refid="match" property="match_count"/>
		<resourcecount refid="not_match" property="not_match_count"/>
		<echo>Found ${match_count} libraries with version ${swt_version} and ${not_match_count} libraries with old versions</echo>
		<condition property="m_fail">
			<not>
				<and>
					<equals arg1="${match_count}" arg2="${library_count}"/>
					<equals arg1="${not_match_count}" arg2="0"/>
				</and>
			</not>
		</condition>
		<fail if="m_fail" message="Failed. Expecting ${library_count} and 0."/>
		<echo>Success</echo>
	</target>	
	
	<target name="check_machines">
		<parallel>
		<sshexec host="${m_linux_x86}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_linux_x86_output"
			command="hostname"/>
		<sshexec host="${m_linux_x86_64}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_linux_x86_64_output"
			command="hostname"/>
		<!-- These machines are only used for 3.5.x builds. -->
		<!--sshexec host="${m_linux_rh3_x86}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_linux_rh3_x86_output"
			command="hostname"/>
		<sshexec host="${m_linux_rh3_x86_64}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_linux_rh3_x86_64_output"
			command="hostname"/-->
			
		<sshexec host="${m_linux_ppc}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_linux_ppc_output"
			command="hostname"/>
		<sshexec host="${m_linux_ppc64}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_linux_ppc64_output"
			command="hostname"/>
			
		<sshexec host="${m_solaris_sparc}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_solaris_sparc_output"
			command="hostname"/>
		<sshexec host="${m_solaris_x86}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_solaris_x86_output"
			command="hostname"/>
			
		<sshexec host="${m_aix}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_aix_output"
			command="hostname"/>
			
		<sshexec host="${m_hpux}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_hpux_output"
			command="hostname"/>
		<sshexec host="${m_mac}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_mac_output"
			command="hostname"/>
		</parallel>
		<property name="success_msg" value="Success"/>
		<property name="fail_msg" value="*** Fail ***"/>
		<condition property="m_linux_x86_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_linux_x86}*" string="${m_linux_x86_output}"/>
		</condition>
		<condition property="m_linux_x86_64_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_linux_x86_64}*" string="${m_linux_x86_64_output}"/>
		</condition>
		<!--condition property="m_linux_rh3_x86_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_linux_rh3_x86}*" string="${m_linux_rh3_x86_output}"/>
		</condition>
		<condition property="m_linux_rh3_x86_64_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_linux_rh3_x86_64}*" string="${m_linux_rh3_x86_64_output}"/>
		</condition-->
		
		<condition property="m_linux_ppc_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_linux_ppc}*" string="${m_linux_ppc_output}"/>
		</condition>
		<condition property="m_linux_ppc64_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_linux_ppc64}*" string="${m_linux_ppc64_output}"/>
		</condition>
		<condition property="m_solaris_sparc_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_solaris_sparc}*" string="${m_solaris_sparc_output}"/>
		</condition>
		<condition property="m_solaris_x86_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_solaris_x86}*" string="${m_solaris_x86_output}"/>
		</condition>
		<condition property="m_aix_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_aix}*" string="${m_aix_output}"/>
		</condition>
		<condition property="m_hpux_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_hpux}*" string="${m_hpux_output}"/>
		</condition>
		<condition property="m_mac_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_mac}*" string="${m_mac_output}"/>
		</condition>
		<echo>-------------------------</echo>
		<echo>Status:</echo>
		<echo></echo>
		<echo>${m_linux_x86} - ${m_linux_x86_test}</echo>
		<echo>${m_linux_x86_64} - ${m_linux_x86_64_test}</echo>
		<!--echo>${m_linux_rh3_x86} ${m_linux_rh3_x86_test}</echo>
		<echo>${m_linux_rh3_x86_64} ${m_linux_rh3_x86_64_test}</echo-->
		<echo>${m_linux_ppc} - ${m_linux_ppc_test}</echo>
		<echo>${m_linux_ppc64} - ${m_linux_ppc64_test}</echo>
		<echo>${m_solaris_sparc} - ${m_solaris_sparc_test}</echo>
		<echo>${m_solaris_x86} - ${m_solaris_x86_test}</echo>
		<echo>${m_aix} - ${m_aix_test}</echo>
		<echo>${m_hpux} - ${m_hpux_test}</echo>
		<echo>${m_mac} - ${m_mac_test}</echo>
		<echo>-------------------------</echo>
		<condition property="m_fail">
			<matches pattern="Fail" string="${m_linux_x86_test} ${m_linux_x86_64_test} ${m_linux_ppc_test} ${m_linux_ppc64_test} ${m_solaris_sparc_test} ${m_solaris_x86_test} ${m_aix_test} ${m_hpux_test} ${m_mac_test}"/>
		</condition>
		<fail if="m_fail" message="Failed"/>
	</target>

	<target name="check_s390_machines">
		<parallel>
		<sshexec host="${m_linux_s390}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			failonerror="false"
			trust="true"
			outputproperty="m_linux_s390_output"
			command="hostname"/>
		<sshexec host="${m_linux_s390x}" 
				username="swtbuild" 
				keyfile="${keyfile}" 
				failonerror="false"
				trust="true"
				outputproperty="m_linux_s390x_output"
				command="hostname"/>
		</parallel>
		<property name="success_msg" value="Success"/>
		<property name="fail_msg" value="*** Fail ***"/>
		<condition property="m_linux_s390x_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_linux_s390x_output}*" string="${m_linux_s390x}"/>
		</condition>
		<condition property="m_linux_s390_test" value="${success_msg}" else="${fail_msg}">
			<matches pattern="${m_linux_s390_output}*" string="${m_linux_s390}"/>
		</condition>
		<echo>-------------------------</echo>
		<echo>Status:</echo>
		<echo></echo>
		<echo>${m_linux_s390} - ${m_linux_s390_test}</echo>
		<echo>${m_linux_s390x} - ${m_linux_s390x_test}</echo>
		<echo>-------------------------</echo>
		<condition property="m_fail">
			<matches pattern="Fail" string="${m_linux_s390_test} ${m_linux_s390x_test}"/>
		</condition>
		<fail if="m_fail" message="Failed"/>
	</target>
	
	<target name="check_compilation">
		<property name="tmpdir" value="${tmphome}/check.compile.${TAG}"/>
		<property name="projectDir" value="${src.repo}/bundles/org.eclipse.swt"/>
		<property name="buildDir" value="${tmpdir}/build"/>

		<!-- 64 bit -->
		<antcall target="build_classes">
			<param name="cp" value=".classpath_cocoa"/>
			<param name="is64" value="64 bit"/>
		</antcall>
		<antcall target="build_classes">
			<param name="cp" value=".classpath_gtk"/>
			<param name="is64" value="64 bit"/>
		</antcall>
		<antcall target="build_classes">
			<param name="cp" value=".classpath_win32"/>
			<param name="is64" value="64 bit"/>
		</antcall>
		
		<!-- 32 bit -->
		<antcall target="build_classes">
			<param name="cp" value=".classpath_carbon"/>
		</antcall>
		<antcall target="build_classes">
			<param name="cp" value=".classpath_cocoa"/>
		</antcall>
		<antcall target="build_classes">
			<param name="cp" value=".classpath_gtk"/>
		</antcall>
		<antcall target="build_classes">
			<param name="cp" value=".classpath_win32"/>
		</antcall>
		<!-- Not building motif
		<antcall target="build_classes">
			<param name="cp" value=".classpath_motif"/>
		</antcall>
		-->
		<!-- Not building Photon
		<antcall target="build_classes">
			<param name="cp" value=".classpath_photon"/>
		</antcall>
		-->
		<!-- Not building WPF
		<antcall target="build_classes">
			<param name="cp" value=".classpath_wpf"/>
		</antcall>
		-->
		
		<delete dir="${tmpdir}" quiet="true"/>
	</target>
	
	<target name="replace64" if="is64">
		<antcall target="replace.32.to.64">
			<param name="replace_dir" value="${buildDir}"/>
		</antcall>
	</target>
	
	<target name="build_classes">
		<echo>Building ${cp} ${is64}</echo>
		<delete file="${tmpdir}/copy.xml"/>
		<delete dir="${buildDir}"/>
				
		<xslt style="${projectDir}/tasks/classpath.xls" in="${projectDir}/${cp}" out="${tmpdir}/copy.xml">
			<param name="srcDir" expression="${projectDir}"/>
			<param name="outputDir" expression="${buildDir}"/>
		</xslt>
		<ant antfile="${tmpdir}/copy.xml" target="copy_files"/>
		
		<antcall target="replace64"></antcall>
				
		<javac srcdir="${buildDir}"></javac>
	</target>

	<!-- common build tasks -->
	<target name="new_release">
		<property name="tmpdir" value="${tmphome}/new_release"/>
		<delete dir="${tmpdir}" quiet="true"/>
		<mkdir dir="${tmpdir}"/>
		<antcall target="new_release_imp"/>
		<delete dir="${tmpdir}" quiet="true"/>
	</target>
	
	<target name="new_release_imp" depends="get_new_release_version">
		<property name="natives_changed" value="true"/>
		<antcall target="increment_version_imp"/>
	</target>
	
	<target name="increment_version">
		<property name="tmpdir" value="${tmphome}/inc.${TAG}"/>
		<delete dir="${tmpdir}" quiet="true"/>
		<mkdir dir="${tmpdir}"/>
		<antcall target="increment_version_imp"/>
		<delete dir="${tmpdir}" quiet="true"/>
	</target>
	
	<target name="increment_version_imp" depends="check_natives_changed, get_version" if="natives_changed">
		<!-- Update the files -->
		<replace file="${src.repo}/${library_j2se}" token="MAJOR_VERSION = ${maj_ver}" value="MAJOR_VERSION = ${new_maj_ver}"/>
		<replace file="${src.repo}/${library_j2me}" token="MAJOR_VERSION = ${maj_ver}" value="MAJOR_VERSION = ${new_maj_ver}"/>
		<replace file="${src.repo}/${library_j2se}" token="MINOR_VERSION = ${min_ver}" value="MINOR_VERSION = ${new_min_ver}"/>
		<replace file="${src.repo}/${library_j2me}" token="MINOR_VERSION = ${min_ver}" value="MINOR_VERSION = ${new_min_ver}"/>
		<replace file="${src.repo}/${version_file}" token="version ${maj_ver}.${min_ver}" value="version ${new_maj_ver}.${new_min_ver}"/>
		<replace file="${src.repo}/${make_common}" token="min_ver=${min_ver}" value="min_ver=${new_min_ver}"/>
		<replace file="${src.repo}/${make_common}" token="maj_ver=${maj_ver}" value="maj_ver=${new_maj_ver}"/>
		<replace file="${src.repo}/${make_common}" token="comma_ver=${comma_ver}" value="comma_ver=${new_comma_ver}"/>

		<!-- Commit the files -->
		<exec dir="${src.repo}" executable="git" failonerror="true">
			<arg line="add '${library_j2se}' '${library_j2me}' '${version_file}' '${make_common}'"/>
		</exec>
		<exec dir="${src.repo}" executable="git" failonerror="true">
			<arg line="commit -m 'Update current version from v${swt_version} to v${new_version}'"/>
		</exec>
	</target>
	
	<target name="cvs_tag">
		<condition property="CVS_TAG" value="" else="-r${TAG}">
			<equals arg1="${TAG}" arg2="master"/>
		</condition>
		<echo>CVS_TAG=${CVS_TAG}</echo>
	</target>

	<!-- Set swt_tag to the current tag in the swt map file -->
	<target name="get_tag" unless="swt_tag" depends="cvs_tag">
		<property name="tmpdir" value="."/>
		<!--property name="map" value="${releng.repo}/bundles/org.eclipse.releng/maps/swt.map"/-->
		<property name="map" value="org.eclipse.releng/maps/swt.map"/>
		<property name="cvsRsh" value="plink"/>
		<property name="cvsRoot" value=":ext:fheidric@dev.eclipse.org:/cvsroot/eclipse"/>
		<cvs cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true" dest="${tmpdir}">
			<commandline>
				<argument value="checkout"/>
				<argument line="${CVS_TAG}"/>
				<argument value="${map}"/>
			</commandline>
		</cvs>
		
		<loadfile property="swt_tag" srcfile="${tmpdir}/${map}">
			<filterchain>
				<tokenfilter delimoutput="">
					<containsstring contains="plugin@org.eclipse.swt=GIT,tag="/>
					<replaceregex pattern=".*(v\d\d\d\d[a-z]?).*" replace="\1"/>
				</tokenfilter>
			</filterchain>
		</loadfile>
		<echo>Current tag=${swt_tag}.</echo>
	</target>
	
	<!-- Set swt_new_tag  -->
	<target name="get_new_tag" unless="swt_new_tag" depends="get_version">
		<property name="tmpdir" value="."/>
		<exec dir="${bin.repo}" executable="git" failonerror="true" outputproperty="tags">
			<arg line="tag"/>
		</exec>
		<script language="javascript">
			<![CDATA[
				tags = project.getProperty("tags");
				swt_version = project.getProperty("swt_version");
				if (!tags.match(swt_version)) {
					project.setProperty("swt_new_tag", swt_version);
				} else {
					for (i=97; i<123; i++) {
						t = swt_version + String.fromCharCode(i);
						if (!tags.match(t)) {
							project.setProperty("swt_new_tag", t);
							break;
						}
					}
				}
	   	 	]]>
		</script>
		<fail message="Unable to determine new tag">
			<condition>
				<not>
					<isset property="swt_new_tag"/>
				</not>
			</condition>
		</fail>
		<echo>New tag=${swt_new_tag}.</echo>
	</target>

	<!-- Set swt_version, new_version, (and min_ver, maj_ver, new_min_ver, new_maj_ver) from the make_common.mak  -->
	<target name="get_version" unless="swt_version">
		<property name="tmpdir" value="."/>
		
		<loadproperties srcFile="${src.repo}/${make_common}"/>
		<copy file="${src.repo}/${make_common}" tofile="${tmpdir}/tmp.txt" overwrite="true"/>
		<propertyfile file="${tmpdir}/tmp.txt">
			<entry key="new_min_ver" default="${min_ver}" type="int" operation="+"/>
			<entry key="new_maj_ver" default="${maj_ver}" type="int" operation="="/>
		</propertyfile>
		<loadproperties srcFile="${tmpdir}/tmp.txt"/>
		<property name="swt_version" value="${maj_ver}${min_ver}"/>
		<property name="new_version" value="${maj_ver}${new_min_ver}"/>
		<replace file="${tmpdir}/tmp.txt" token="comma_ver=${comma_ver}" value="new_comma_ver=${new_version}"/>
		<replaceregexp file="${tmpdir}/tmp.txt" match="new_comma_ver=(\d)(\d)(\d)(\d)" replace="new_comma_ver=\1,\2,\3,\4" byline="true"/>
		<loadproperties srcFile="${tmpdir}/tmp.txt"/>
		<delete file="${tmpdir}/tmp.txt"/>
		<echo>Version=${swt_version}; New=${new_version}; New comma_ver=${new_comma_ver}</echo>
	</target>

	<target name="get_new_release_version" unless="min_ver">
		<property name="tmpdir" value="."/>
		
		<loadproperties srcFile="${src.repo}/${make_common}"/>
		<script language="javascript">
			<![CDATA[
				min_ver = project.getProperty("min_ver");
				maj_ver = project.getProperty("maj_ver");
				new_min_ver = (Math.floor(parseInt(min_ver) / 100) + 1) * 100;
				new_maj_ver = maj_ver;
				if (new_min_ver >= 1000) {
					new_min_ver = "000";
					new_maj_ver = parseInt(new_maj_ver) + 1;
				}
				project.setProperty("new_min_ver", new_min_ver);
				project.setProperty("new_maj_ver", new_maj_ver);
	   	 	]]>
		</script>
		<property name="swt_version" value="${maj_ver}${min_ver}"/>
		<property name="new_version" value="${new_maj_ver}${new_min_ver}"/>
		<copy file="${src.repo}/${make_common}" tofile="${tmpdir}/tmp.txt" overwrite="true"/>
		<replace file="${tmpdir}/tmp.txt" token="comma_ver=${comma_ver}" value="new_comma_ver=${new_version}"/>
		<replaceregexp file="${tmpdir}/tmp.txt" match="new_comma_ver=(\d)(\d)(\d)(\d)" replace="new_comma_ver=\1,\2,\3,\4" byline="true"/>
		<loadproperties srcFile="${tmpdir}/tmp.txt"/>
		<delete file="${tmpdir}/tmp.txt"/>
		<echo>Version=${swt_version}; New=${new_version}; New comma_ver=${new_comma_ver}</echo>
	</target>
	
	<!-- Set natives_changed if there are changes in the C code -->
	<target name="check_natives_changed" unless="natives_changed" depends="get_tag">
		<exec dir="${src.repo}" executable="git" failonerror="true" outputproperty="diffs">
			<arg line="diff ${TAG} ${swt_tag}"/>
			<arg line="${cp_win32}"/>
			<arg line="${cp_gtk}"/>
			<arg line="${cp_cocoa}"/>
		</exec>
		<condition property="natives_changed">
			<not>
				<equals arg1="${diffs}" arg2=""/>
			</not>
		</condition>
		<echo>Natives changed: ${natives_changed} since ${swt_tag}</echo>
	</target>

	<!-- Params: tmpdir, and swt_new_tag -->
	<target name="update_buildnotes" depends="get_tag, get_new_tag">
		<property name="MILESTONE" value=""/>
		<tstamp>
			<format property="header.time" pattern="EEEE MMMMM dd, yyyy" offset="1" unit="day"/>
		</tstamp>
		<tstamp>
			<format property="url.to.time" pattern="yyyy-MM-dd'+'HH'%3A'mm'%3A'ss'+%2B0000'" timezone="gmt"/>
		</tstamp>
		
		<exec dir="${src.repo}" executable="git" failonerror="true" output="${tmpdir}/startdate.txt">
			<arg line="log --pretty='%ad' --date=iso -1 ${swt_tag}"/>
		</exec>

		<loadfile property="url.from.time" srcfile="${tmpdir}/startdate.txt">
			<filterchain>
				<tokenfilter delimoutput="">
					<replaceregex pattern="\+" replace="%2B" flags="g"/>
					<replaceregex pattern=":" replace="%3A" flags="g"/>
					<replaceregex pattern="\s" replace="+" flags="g"/>
				</tokenfilter>
			</filterchain>
		</loadfile>
		<echo> Searching bugs from "${url.from.time}" to "${url.to.time}"</echo>
		
		<property name="match_line" value="SWT&lt;/h1&gt;"/>
		<property name="delimiter" value="&#13;&#10;"/>
		<property name="url" value="https://bugs.eclipse.org/bugs/buglist.cgi?bug_file_loc=;bug_file_loc_type=allwordssubstr;bug_id=;bugidtype=include;chfield=resolution;target_milestone=${MILESTONE};chfieldfrom=${url.from.time};chfieldto=${url.to.time};chfieldvalue=FIXED;classification=Eclipse;component=SWT;email1=;email2=;emailtype1=substring;emailtype2=substring;field-1-0-0=classification;field-1-1-0=product;field-1-2-0=component;field0-0-0=noop;keywords=;keywords_type=allwords;long_desc=;long_desc_type=allwordssubstr;product=Platform;query_format=advanced;remaction=;short_desc=;short_desc_type=allwordssubstr;status_whiteboard=;status_whiteboard_type=allwordssubstr;type-1-0-0=anyexact;type-1-1-0=anyexact;type-1-2-0=anyexact;type0-0-0=noop;value-1-0-0=Eclipse;value-1-1-0=Platform;value-1-2-0=SWT;value0-0-0=;votes=;query_based_on="/>
		<property name="body" value="${delimiter}${delimiter}&lt;h2&gt;SWT Build ${swt_new_tag} - ${header.time}&lt;/h2&gt;${delimiter}${delimiter}&lt;blockquote&gt;${delimiter}&lt;a href=${url}&gt;Bugs fixed&lt;/a&gt;${delimiter}&lt;/blockquote&gt;"/>
		<replace file="${src.repo}/${build_notes}" token="${match_line}" value="${match_line}${body}"/>
		
		<exec dir="${src.repo}" executable="git" failonerror="true">
			<arg line="add '${build_notes}'"/>
		</exec>
		<exec dir="${src.repo}" executable="git" failonerror="true">
			<arg line="commit -m 'new version v${swt_new_tag}'"/>
		</exec>
	</target>

	<!-- depends on 'get_new_tag' to define swt_new_tag, swt_version, maj_ver and min_ver -->
	<target name="tag_projects">
		<property name="tmpdir" value="${tmphome}/tag.${TAG}"/>
		<delete dir="${tmpdir}" quiet="true"/>
		<mkdir dir="${tmpdir}"/>
		<antcall target="tag_projects_imp"/>
		<delete dir="${tmpdir}" quiet="true"/>
	</target>
	
	<target name="update_swt_map" depends="cvs_tag">
		<property name="cvsRsh" value="plink"/>
		<property name="cvsRoot" value=":ext:fheidric@dev.eclipse.org:/cvsroot/eclipse"/>
		<!-- download the map file -->
		<property name="map" value="org.eclipse.releng/maps/swt.map"/>
		<cvs cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true" dest="${tmpdir}">
			<commandline>
				<argument value="checkout"/>
				<argument line="${CVS_TAG}"/>
				<argument value="${map}"/>
			</commandline>
		</cvs>

		<!-- update and commit map file -->
		<replaceregexp file="${tmpdir}/${map}" match="=v\d\d\d\d[a-z]?" replace="=v${swt_new_tag}" byline="true"/>
		<cvs cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true" dest="${tmpdir}">
			<commandline>
				<argument value="commit"/>
				<argument value="-m"/>
				<argument value="'new version v${swt_new_tag}'"/>
				<argument value="${map}"/>
			</commandline>
		</cvs>
	</target>
	
	<target name="tag_projects_imp" depends="get_new_tag">
		<!-- These two lines perform the same check. check_libraries is slower because it checks each fragment separetely  -->
		<!--antcall target="check_libraries"/-->
		<antcall target="check_fragment_libraries"/>

		<!-- update and commit the buildnotes_swt.html file -->
		<antcall target="update_buildnotes"/>
		
		<exec dir="${src.repo}" executable="git" failonerror="true">
			<arg line="tag ${swt_new_tag}"/>
		</exec>
		<exec dir="${bin.repo}" executable="git" failonerror="true">
			<arg line="tag ${swt_new_tag}"/>
		</exec>
		
		<antcall target="update_swt_map"/>
	</target>
	
	<target name="check_sha1_file" unless="natives_changed">
		<condition property="natives_changed">
			<not>
				<available file="${sha1_file}" type="file"/>
			</not>
		</condition>
	</target>
	
	<target name="check_sha1_changed" depends="check_sha1_file" unless="natives_changed">
		<loadproperties srcfile="${sha1_file}"/>
		
		<!-- Check for changes -->
		<exec dir="${src.repo}" executable="git" failonerror="true" outputproperty="diffs">
			<arg line="diff ${TAG} ${SHA1} ${cp}"/>
		</exec>
		<condition property="natives_changed">
			<not>
				<equals arg1="${diffs}" arg2=""/>
			</not>
		</condition>
		<echo>Has native changes: ${natives_changed}, compared against ${SHA1}</echo>
	</target>
	
	<target name="init_fragment">
		<condition property="m_fail">
			<not><and>
				<isset property="swt.ws"/>
				<isset property="swt.os"/>
			</and></not>
		</condition>
		<fail if="m_fail" message="Failed: ${swt.ws} and ${swt.os} not set"/>
		<condition property="fragment" value="org.eclipse.swt.${swt.ws}.${swt.os}.${swt.arch}" else="org.eclipse.swt.${swt.ws}.${swt.os}">
			<isset property="swt.arch"/>
		</condition>
		<property name="fragment_dir" value="${bin.repo}/bundles/${fragment}"/>
		<property name="sha1_file" value="${fragment_dir}/build.sha1"/>
		<script language="javascript">
			<![CDATA[
				project.setProperty("cp", project.getProperty("cp_" + project.getProperty("swt.ws")));
	   	 	]]>
		</script>
	</target>
	
	<!-- Params: swt.ws, swt.os, swt.arch -->
	<target name="build_fragment" depends="init_fragment">
		<property name="tmpdir" value="${tmphome}/build.${fragment}.${TAG}"/>
		<delete dir="${tmpdir}" quiet="true"/>
		<mkdir dir="${tmpdir}"/>
		<antcall target="build_fragment_impl"/>
		<delete dir="${tmpdir}" quiet="true"/>
	</target>
	
	<target name="build_fragment_impl" depends="check_sha1_changed" if="natives_changed">
		<!-- build natives -->
		<antcall target="build_libraries"/>
		<!-- commit libraries -->
		<antcall target="commit_fragment"/>
	</target>

	<!-- Params: fragment, swt_version -->
	<target name="commit_fragment" depends="init_fragment,get_version" if="natives_changed">
		<waitfor maxwait="1" maxwaitunit="hour">
			<not>
				<available file="${bin.repo}/.git/index.lock" type="file"/>
			</not>
		</waitfor>
		
		<fileset id="removeid" dir="${fragment_dir}">
			<filename regex="[0-9][0-9][0-9][0-9]."/>
			<filename regex="${swt_version}." negate="true"/>
		</fileset>
		
		<copy todir="${fragment_dir}" overwrite="false">
			<fileset refid="removeid"/>
			<regexpmapper from="(.*)[0-9][0-9][0-9][0-9](.*)" to="\1${swt_version}\2"/>
		</copy>
		
		<property name="rfiles" refid="removeid"/>
		<echo file="${tmpdir}/tmp.txt">removed_files=${rfiles}</echo>
		<replace file="${tmpdir}/tmp.txt" token=";" value=" "/>
		<loadproperties srcfile="${tmpdir}/tmp.txt"/>
		<delete file="${tmpdir}/tmp.txt"/>

		<chmod perm="755">
			<fileset dir="${fragment_dir}" includes="*${swt_version}*"/>
		</chmod>
		
		<condition property="files_removed">
			<length string="${removed_files}" trim="true" when="greater" length="0"/>
		</condition>
		<antcall target="git_rm"/>
		<exec dir="${src.repo}" executable="git" failonerror="true" outputproperty="HEAD_TAG">
			<arg line="rev-list ${TAG} -1"/>
		</exec>
		<propertyfile file="${fragment_dir}/build.sha1">
			<entry key="SHA1" value="${HEAD_TAG}"/>
		</propertyfile>
		<exec dir="${bin.repo}" executable="git" failonerror="true">
			<arg line="add 'bundles/${fragment}'"/>
		</exec>
		<exec dir="${bin.repo}" executable="git" failonerror="true">
			<arg line="commit -a -m 'v${swt_version} ${fragment}'"/>
		</exec>
	</target>

	<target name="git_rm" if="files_removed">
		<echo>Removing old libs: -${removed_files}-</echo>
		<exec dir="${bin.repo}" executable="git" failonerror="true">
			<arg line="rm ${removed_files}"/>
		</exec>
	</target>

	<target name="init_build" if="eclipse.running">
		<eclipse.refreshLocal resource="org.eclipse.swt" depth="infinite"/>
		<eclipse.incrementalBuild project="org.eclipse.swt" kind="incr"/>
	</target>

	<target name="refresh_fragment" if="eclipse.running">
		<echo>refreshing ${fragment}</echo>
		<eclipse.refreshLocal resource="${fragment}" depth="infinite"/>
	</target>
		
	<target name="copy.library.src">
		<script language="javascript">
			<![CDATA[
				importClass(java.io.File);
				importClass(java.io.StreamTokenizer);
				importClass(java.io.StringReader);
				task = project.createTask("copy");
				projectDir = project.getProperty("project_dir");
				task.setTodir(new File(project.getProperty("build_dir")));
				tk = new StreamTokenizer(new StringReader(project.getProperty("cp")));
				while ((token = tk.nextToken()) != StreamTokenizer.TT_EOF) {
					fileset = project.createDataType("fileset");
					fileset.setDir(new File(projectDir + "/" + tk.sval + "/"));
					task.addFileset(fileset);
				}
				task.execute();
	   	 	]]>
		</script>
	</target>

	<!-- Params: swt.ws, swt.os, swt.arch -->
	<target name="build_libraries" depends="init_fragment">
		<property name="swt.arch" value=""/>
		<property name="clean" value="clean"/>
		<property name="targets" value="install"/>
		<property name="project_dir" value="${basedir}/${src.repo}"/>
		<property name="output_dir" value="${basedir}/${fragment_dir}"/>
		<property name="build_dir" value="${basedir}/${fragment_dir}/tmpdir"/>
		<delete dir="${build_dir}" quiet="true"/>
		<antcall target="copy.library.src"/>
		<condition property="build_task" value="build_local_win">
			<or>
				<equals arg1="${swt.ws}" arg2="win32"/>
				<equals arg1="${swt.ws}" arg2="wpf"/>
			</or>
		</condition>
		<condition property="build_task" value="build_remote" else="build_local">
			<isset property="machine"/>
		</condition>
		<antcall target="init_build"/>
		<antcall target="${build_task}"/>
		<delete dir="${build_dir}" quiet="true"/>
		<antcall target="refresh_fragment"/>
	</target>
	
	<!-- machine targets swt.ws swt.os swt.arch -->
	<target name="build_remote">
		<property name="remotebuilddir" value="~/build"/>
		<property name="remotetmpdir" value="${remotebuilddir}/${fragment}.${TAG}"/>
		<property name="lib_output" value="${remotetmpdir}/libs"/>
		<property name="zip_file" value="${fragment}.${TAG}.zip"/>
		<zip destfile="${fragment_dir}/${zip_file}" basedir="${build_dir}"/>
		<scp file="${fragment_dir}/${zip_file}"
			todir="swtbuild@${machine}:${remotebuilddir}" 
			keyfile="${keyfile}"
			trust="true"/>
		<delete file="${fragment_dir}/${zip_file}" quiet="true"/>
		<sshexec host="${machine}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			trust="true"
	 		command="rm -rf ${remotetmpdir}; mkdir ${remotetmpdir}; mkdir ${lib_output}; cd ${remotetmpdir}; unzip -aa ${remotebuilddir}/${zip_file}; export MODEL=${swt.arch}; export OUTPUT_DIR=${lib_output}; if sh build.sh ${targets}; then cd; else cd; rm -rf ${remotetmpdir}; exit 1; fi"/>
		<scp file="swtbuild@${machine}:${lib_output}/*"
			todir="${output_dir}"
			keyfile="${keyfile}"
			trust="true"/>
		<sshexec host="${machine}" 
			username="swtbuild" 
			keyfile="${keyfile}" 
			trust="true"
	 		command="rm -rf ${remotetmpdir}; rm ${remotebuilddir}/${zip_file}"/>
	</target>
	
	<target name="build_local">
		<exec dir="${build_dir}" executable="sh" failonerror="true">
			<arg line="build.sh"/>
			<env key="MODEL" value="${swt.arch}"/>
			<env key="OUTPUT_DIR" value="${output_dir}"/>
			<arg line="${targets}"/>
			<arg line="${clean}"/>
		</exec>
	</target>

	<target name="build_local_win">
		<pathconvert property="win_output_dir">
			<path location="${output_dir}"></path>
		</pathconvert>
		<condition property="build_file" value="build-ce.bat" else="build.bat">
			<equals arg1="${swt.os}" arg2="wce_ppc"/>
		</condition>
		<exec dir="${build_dir}" executable="${build_dir}/${build_file}" failonerror="true">
			<env key="JAVA_HOME" value=""/>
			<env key="OUTPUT_DIR" value="${win_output_dir}"/>
			<arg line="${targets}"/>
			<arg line="${clean}"/>
		</exec>
		<condition property="should_build_xulrunner" value="true">
			<and>
				<equals arg1="${swt.ws}" arg2="win32"/>
				<equals arg1="${swt.arch}" arg2="x86"/>
			</and>
		</condition>
		<antcall target="build_local_win_xulrunner"/>
		<delete dir="${tmpdir}" quiet="true"/>
	</target>

	<target name="build_local_win_xulrunner" if="should_build_xulrunner">
		<exec dir="${build_dir}" executable="cmd" failonerror="true">
			<env key="JAVA_HOME" value=""/>
			<env key="BUILD_XULRUNNER" value="true"/>
			<env key="OUTPUT_DIR" value="${win_output_dir}"/>
			<arg line="/c '${build_dir}/${build_file}' x86 make_xulrunner install ${clean}"/>
		</exec>
	</target>

	<target name="check_repo">
		 <condition property="${repo.exists}">       
		 	<available file="../${TAG}/${repo}" type="dir"/>     
		 </condition>
	</target>
	
	<target name="init_repo" depends="check_repo" unless="${repo.exists}" >
		<delete dir="../${TAG}/${repo}" quiet="true"/>
		<mkdir dir="../${TAG}"/>
		<exec dir="../${TAG}" executable="git" failonerror="true">
			<arg line="clone ${gitroot}/${repo}"/>
		</exec>
		<condition property="perform.checkout">
			<not>
				<equals arg1="${TAG}" arg2="master"/>
			</not>
		</condition>
		<antcall target="checkout_repo"/>
	</target>
	
	<target name="checkout_repo" if="perform.checkout">
		<echo>Checking out ${repo}=${TAG}</echo>
		<exec dir="../${TAG}/${repo}" executable="git" failonerror="true">
			<arg line="checkout -b ${TAG} origin/${TAG}"/>
		</exec>
	</target>

	<target name="pull_remote">
		<echo>Pull ${src.repo}</echo>
		<antcall target="init_repo">
			<param name="repo" value="${src.repo}"/>
			<param name="repo.exists" value="src.repo.exists"/>
		</antcall>
		<exec dir="../${TAG}/${src.repo}" executable="git"  failonerror="true">
			<arg line="pull"/>
		</exec>
		<echo>Pull ${bin.repo}</echo>
		<antcall target="init_repo">
			<param name="repo" value="${bin.repo}"/>
			<param name="repo.exists" value="bin.repo.exists"/>
		</antcall>
		<exec dir="../${TAG}/${bin.repo}" executable="git" failonerror="true">
			<arg line="pull"/>
		</exec>
		<echo>Pull ${releng.repo}</echo>
		<!--antcall target="init_repo">
			<param name="repo" value="${releng.repo}"/>
			<param name="repo.exists" value="releng.repo.exists"/>
		</antcall>
		<exec dir="../${TAG}/${releng.repo}" executable="git" failonerror="true">
			<arg line="pull"/>
		</exec-->
	</target>

	<target name="push_remote">
		<antcall target="init_repo">
			<param name="repo" value="${src.repo}"/>
			<param name="repo.exists" value="src.repo.exists"/>
		</antcall>
		<exec dir="../${TAG}/${src.repo}" executable="git" failonerror="true">
			<arg line="push"/>
		</exec>
		<antcall target="init_repo">
			<param name="repo" value="${bin.repo}"/>
			<param name="repo.exists" value="bin.repo.exists"/>
		</antcall>
		<exec dir="../${TAG}/${bin.repo}" executable="git" failonerror="true">
			<arg line="push"/>
		</exec>
		<!--antcall target="init_repo">
			<param name="repo" value="${releng.repo}"/>
			<param name="repo.exists" value="releng.repo.exists"/>
		</antcall>
		<exec dir="../${TAG}/${releng.repo}" executable="git" failonerror="true">
			<arg line="push"/>
		</exec-->
	</target>

	<!-- Convert SWT 32 bit java and C source to 64 bit  -->
	<target name="replace.32.to.64" depends="init_build">
		<property name="replace_dir" value="${src.repo}/bundles/org.eclipse.swt"/>
		<echo>Converting java files to 64 bit in ${replace_dir} project</echo>
		<replace dir="${replace_dir}" includes="**/*.java" token="int /*long*/" value="long /*int*/"/>
		<replace dir="${replace_dir}" includes="**/*.java" token="int[] /*long[]*/" value="long[] /*int[]*/"/>
		<replace dir="${replace_dir}" includes="**/*.java" token="float /*double*/" value="double /*float*/"/>
		<replace dir="${replace_dir}" includes="**/*.java" token="float[] /*double[]*/" value="double[] /*float[]*/"/>
		<antcall target="init_build"/>
	</target>

	<!-- Convert SWT 64 bit java and C source to 32 bit  -->
	<target name="replace.64.to.32" depends="init_build">
		<property name="replace_dir" value="${src.repo}/bundles/org.eclipse.swt"/>
		<echo>Converting java files to 32 bit in ${replace_dir} project</echo>
		<replace dir="${replace_dir}" includes="**/*.java" token="long /*int*/" value="int /*long*/"/>
		<replace dir="${replace_dir}" includes="**/*.java" token="long[] /*int[]*/" value="int[] /*long[]*/"/>
		<replace dir="${replace_dir}" includes="**/*.java" token="double /*float*/" value="float /*double*/"/>
		<replace dir="${replace_dir}" includes="**/*.java" token="double[] /*float[]*/" value="float[] /*double[]*/"/>
		<antcall target="init_build"/>
	</target>
</project>

Back to the top