summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt.tools/tasks/build.xml
blob: ac83e8718cad0c02e9377b26211b1c115dfc2605 (plain)
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
<project name="org.eclipse.swt.build.buildWindows" default="build_all" basedir=".">
	
	<!-- CVS values -->
	<property name="cvsRootAnon" value=":pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse"/>
	<property name="cvsRoot" value=":ext:fheidric@dev.eclipse.org:/cvsroot/eclipse"/>
	<property name="TAG" value=""/>
	<!--property name="TAG" value="-r SSQ_build"/-->
	
	<property name="builddir" value="org.eclipse.swt/bin/library"/>
	<property name="logdir" value="C:/BUILD/swt-builddir/logs"/>
		
	<!-- Low level build tasks -->
	<target name="build_win32_x86" >
		<exec dir="${basedir}/${builddir}" executable="${basedir}/${builddir}/build.bat" failonerror="true">
			<env key="JAVA_HOME" value=""/>
			<arg line="x86"/>
			<arg line="install"/>
			<arg line="clean"/>
		</exec>
	</target>
	
	<target name="build_win32_x86_64" >
		<exec dir="${basedir}/${builddir}" executable="${basedir}/${builddir}/build.bat" failonerror="true">
			<env key="JAVA_HOME" value=""/>
			<arg line="x86_64"/>
			<arg line="install"/>
			<arg line="clean"/>
		</exec>
	</target>

	<target name="build_win32_ia64" >
		<exec dir="${basedir}/${builddir}" executable="${basedir}/${builddir}/build.bat" failonerror="true">
			<env key="JAVA_HOME" value=""/>
			<arg line="ia64"/>
			<arg line="install"/>
			<arg line="clean"/>
		</exec>
	</target>
		
	<target name="build_wince" >
		<exec dir="${basedir}/${builddir}" executable="${basedir}/${builddir}/build-ce.bat" failonerror="true">
			<env key="JAVA_HOME" value=""/>
			<arg line="install"/>
			<arg line="clean"/>
		</exec>
	</target>
	
	<target name="build_wpf_x86" >
		<exec dir="${basedir}/${builddir}" executable="${basedir}/${builddir}/build.bat" failonerror="true">
			<env key="JAVA_HOME" value=""/>
			<arg line="install"/>
			<arg line="clean"/>
		</exec>
	</target>

	<target name="build_gtk_linux_x86" >
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg value="build.sh"/>
			<env key="JAVA_HOME" value="/bluebird/teamswt/swt-builddir/IBMJava2-141"/>
			<env key="MOZILLA_SDK" value="/bluebird/teamswt/swt-builddir/mozilla/1.4/linux_gtk2/mozilla/dist/sdk"/>
			<env key="XULRUNNER_SDK" value="/bluebird/teamswt/swt-builddir/geckoSDK/1.8.0.4/gecko-sdk"/>
			<env key="MOZILLA_INCLUDES" value="-include ${MOZILLA_SDK}/mozilla-config.h -I${MOZILLA_SDK}/../include/xpcom -I${MOZILLA_SDK}/../include/nspr -I${MOZILLA_SDK}/../include/embed_base -I${MOZILLA_SDK}/../include/embedstring -I${MOZILLA_SDK}/../include/string"/>
			<env key="MOZILLA_LIBS" value="${MOZILLA_SDK}/../lib/libembedstring.a -L${MOZILLA_SDK}/../bin -L${MOZILLA_SDK}/../lib/ -lxpcom -lnspr4 -lplds4 -lplc4"/>
			<env key="XULRUNNER_INCLUDES" value="-include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include"/>
			<env key="XULRUNNER_LIBS" value="-L${XULRUNNER_SDK}/lib -lxpcomglue"/>
			<env key="PKG_CONFIG_PATH" value="/bluebird/teamswt/swt-builddir/cairo_1.0.2/linux_x86/lib/pkgconfig"/>
			<arg value="make_mozilla"/>
			<arg value="make_xulrunner"/>
			<arg value="make_xpcominit"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>

	<target name="build_gtk_linux_x86_64" >
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg value="build.sh"/>
			<env key="JAVA_HOME" value="/bluebird/teamswt/swt-builddir/jdk1.5.0"/>
			<env key="PKG_CONFIG_PATH" value="/usr/lib64/pkgconfig"/>
			<env key="MOZILLA_SDK" value="/bluebird/teamswt/swt-builddir/mozilla/1.7/amd64/mozilla/dist/sdk"/>
			<env key="XULRUNNER_SDK" value="/bluebird/teamswt/swt-builddir/xulrunner/1.8.0.1/amd64/mozilla/dist/sdk/"/>
			<!-- setenv GCC_VERSION -gcc3 -->
			<env key="MOZILLA_INCLUDES" value="-include ${MOZILLA_SDK}/include/mozilla-config.h -I${MOZILLA_SDK}/include"/>
			<env key="MOZILLA_LIBS" value="-L${MOZILLA_SDK}/lib -L${MOZILLA_SDK}/bin -lxpcom -lnspr4 -lplds4 -lplc4"/>
			<env key="XULRUNNER_INCLUDES" value="-include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include"/>
			<env key="XULRUNNER_LIBS" value="-L${XULRUNNER_SDK}/lib -lxpcomglue"/>
			<env key="PKG_CONFIG_PATH" value="/bluebird/teamswt/swt-builddir/cairo_1.0.2/linux_x86_64/lib/pkgconfig"/>
			<arg value="make_mozilla"/>
			<arg value="make_xulrunner"/>
			<arg value="make_xpcominit"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>
	
	<target name="build_gtk_linux_ppc" >
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg value="build.sh"/>
			<env key="JAVA_HOME" value="/bluebird/teamswt/swt-builddir/IBMJava2-ppc-142"/>
			<env key="MOZILLA_SDK" value=" /bluebird/teamswt/swt-builddir/mozilla/1.7/ppc/mozilla/dist/sdk"/>
			<env key="XULRUNNER_SDK" value="/bluebird/teamswt/swt-builddir/xulrunner/1.8.1.1/ppc/mozilla/dist/sdk/"/>
			<env key="MODEL" value="ppc"/>
			<env key="MOZILLA_INCLUDES" value="-include ${MOZILLA_SDK}/include/mozilla-config.h -I${MOZILLA_SDK}/include"/>
			<env key="MOZILLA_LIBS" value="-L${MOZILLA_SDK}/lib -L${MOZILLA_SDK}/bin -lxpcom -lnspr4 -lplds4 -lplc4"/>
			<env key="XULRUNNER_INCLUDES" value="-include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include"/>
			<env key="XULRUNNER_LIBS" value="-L${XULRUNNER_SDK}/lib -lxpcomglue"/>
			<env key="PKG_CONFIG_PATH" value="/bluebird/teamswt/swt-builddir/cairo_1.0.2/linux_ppc/lib/pkgconfig/"/>
			<arg value="make_mozilla"/>
			<arg value="make_xulrunner"/>
			<arg value="make_xpcominit"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>
	
	<target name="build_gtk_solaris_x86">
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg value="build.sh"/>
			<env key="CC" value="cc"/>
			<env key="CXX" value="CC"/>
			<env key="JAVA_HOME" value="/bluebird/teamswt/swt-builddir/IBMJava2-141"/>
			<env key="MOZILLA_SDK" value="/bluebird/teamswt/bog/mozilla/solaris_x86/1.7/mozilla/dist/sdk"/>
			<env key="XULRUNNER_SDK" value="/bluebird/teamswt/swt-builddir/xulrunner/1.8.0.1/solaris-x86/mozilla/dist/sdk"/>
			<env key="MOZILLA_INCLUDES" value="-include ${MOZILLA_SDK}/include/mozilla-config.h -I${MOZILLA_SDK}/include"/>
			<env key="MOZILLA_LIBS" value="-L${MOZILLA_SDK}/lib -L${MOZILLA_SDK}/bin -lxpcom -lnspr4 -lplds4 -lplc4"/>
			<env key="XULRUNNER_INCLUDES" value="-include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include"/>
			<env key="XULRUNNER_LIBS" value="-L${XULRUNNER_SDK}/lib -lxpcomglue"/>
			<arg value="make_mozilla"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>
	
	<target name="build_gtk_solaris_sparc">
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg value="build.sh"/>
			<env key="CC" value="cc"/>
			<env key="CXX" value="CC"/>
			<env key="CDE_HOME" value="/usr/dt"/>
			<env key="JAVA_HOME" value="/usr/j2se"/>
			<env key="PKG_CONFIG_PATH" value="/usr/local/cairo-1.4.10/lib/pkgconfig/"/>
			<env key="MOZILLA_SDK" value="/bluebird/teamswt/swt-builddir/geckoSDK/1.4/gecko-sdk"/>
			<env key="MOZILLA_INCLUDES" value="-I${MOZILLA_SDK} -I${MOZILLA_SDK}/xpcom/include -I${MOZILLA_SDK}/nspr/include -I${MOZILLA_SDK}/embed_base/include -I${MOZILLA_SDK}/embedstring/include -I${MOZILLA_SDK}/string/include"/>
			<env key="MOZILLA_LIBS" value="${MOZILLA_SDK}/embedstring/bin/libembedstring.a -L${MOZILLA_SDK}/xpcom/bin -L${MOZILLA_SDK}/nspr/bin -lxpcom -lnspr4 -lplds4 -lplc4"/>
			<arg value="make_mozilla"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>
	
	<target name="build_motif_linux" >
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg value="build.sh"/>
			<env key="JAVA_HOME" value="/bluebird/teamswt/swt-builddir/IBMJava2-141"/>
			<env key="MOTIF_HOME" value="/bluebird/teamswt/swt-builddir/motif21"/>
			<env key="MOZILLA_SDK" value="/bluebird/teamswt/swt-builddir/mozilla/1.4/linux_gtk2/mozilla/dist/sdk"/>
			<env key="XULRUNNER_SDK" value="/bluebird/teamswt/swt-builddir/geckoSDK/1.8.0.4/gecko-sdk"/>
			<env key="MOZILLA_INCLUDES" value="-include ${MOZILLA_SDK}/mozilla-config.h -I${MOZILLA_SDK}/../include/xpcom -I${MOZILLA_SDK}/../include/nspr -I${MOZILLA_SDK}/../include/embed_base -I${MOZILLA_SDK}/../include/embedstring -I${MOZILLA_SDK}/../include/string"/>
			<env key="MOZILLA_LIBS" value="${MOZILLA_SDK}/../lib/libembedstring.a -L${MOZILLA_SDK}/../bin -L${MOZILLA_SDK}/../lib/ -lxpcom -lnspr4 -lplds4 -lplc4"/>
			<env key="XULRUNNER_INCLUDES" value="-include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include"/>
			<env key="XULRUNNER_LIBS" value="-L${XULRUNNER_SDK}/lib -lxpcomglue"/>
			<env key="PKG_CONFIG_PATH" value="/bluebird/teamswt/swt-builddir/cairo_1.0.2/linux_x86/lib/pkgconfig"/>
			<!--Need to add? setenv GCC_VERSION -gcc3 -->
			<arg value="make_mozilla"/>
			<arg value="make_xulrunner"/>
			<arg value="make_xpcominit"/>
			<arg value="make_cairo"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>

	<target name="build_motif_aix" >
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg value="build.sh"/>
			<env key="JAVA_HOME" value="/bluebird/teamswt/swt-builddir/aixj9_r5"/>
			<env key="AWT_HOME" value="/bluebird/teamswt/swt-builddir/aix_jre_r6/sdk/jre/lib/ppc"/>
			<env key="MOTIF_HOME" value="/bluebird/teamswt/swt-builddir/motif21"/>
			<env key="PKG_CONFIG_PATH" value="/usr/local/cairo1.6.0/lib/pkgconfig/"/>
			<arg value="make_cairo"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>
	
	<target name="build_motif_solaris" >
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg value="build.sh"/>
			<env key="PKG_CONFIG_PATH" value="/usr/local/cairo-1.4.10/lib/pkgconfig/"/>
			<arg value="make_cairo"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>
	
	<target name="build_motif_hpux" >
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg value="build.sh"/>
			<env key="JAVA_HOME" value="/opt/java1.5/"/>
			<env key="AWT_HOME" value="/opt/java1.5/jre/lib/IA64N/"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>
	
	<target name="build_cocoa_x86_and_ppc">
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg line="build32.sh"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>
		
	<target name="build_cocoa_x86_64">
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg line="build64.sh"/>
			<arg value="install_x86_64"/>
			<arg value="clean"/>
		</exec>
	</target>

	<target name="build_carbon">
		<exec dir="${basedir}/${builddir}" executable="sh" failonerror="true">
			<arg line="build.sh"/>
			<arg value="install"/>
			<arg value="clean"/>
		</exec>
	</target>
	
	<target name="build_photon">
		<echo>Photon is not being built</echo>
	</target>
	
	<!-- common build tasks -->
	<target name="checkout_natives">
		<xslt style="style.xls" in="${cp}" out="files.xml">
			<param name="TAG" expression="${TAG}"/>
			<param name="workdir" expression="${basedir}"/>
		</xslt>
		<ant antfile="files.xml"/>
		<copy todir="${builddir}" flatten="true">
			<fileset dir="org.eclipse.swt" includes="**/library/"/>
		</copy>
		<delete file="files.xml"/>
	</target>
	
	<target name="increment_version">
		<property name="cvsRsh" value="plink"/>
		<property name="library_j2se" value="org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java"/>
		<property name="library_j2me" value="org.eclipse.swt/Eclipse SWT PI/common_j2me/org/eclipse/swt/internal/Library.java"/>
		<property name="make_common" value="org.eclipse.swt/Eclipse SWT/common/library/make_common.mak"/>
		<property name="version_file" value="org.eclipse.swt/Eclipse SWT/common/version.txt"/>
		<property name="tmpdir" value="c:/build/swt-builddir/tmp/inc"/>
		<delete dir="${tmpdir}" quiet="true"/>
		<mkdir dir="${tmpdir}"/>
		<cvs cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true" dest="${tmpdir}">
			<commandline>
				<argument value="checkout"/>
				<argument line="${TAG}"/>
				<argument value="${library_j2se}"/>
				<argument value="${library_j2me}"/>
				<argument value="${make_common}"/>
				<argument value="${version_file}"/>
			</commandline>
		</cvs>
		<copy file="${tmpdir}/${make_common}" tofile="${tmpdir}/tmp.txt"/>
		<replace file="${tmpdir}/tmp.txt" token="min_ver" value="new_min_ver"/>
		<propertyfile file="${tmpdir}/tmp.txt">
			<entry key="new_min_ver" value="=" type="int" operation="+"/>
		</propertyfile>
		<loadproperties srcFile="${tmpdir}/${make_common}"/>	
		<loadproperties srcFile="${tmpdir}/tmp.txt"/>
		<property name="swt_version" value="${maj_ver}${min_ver}"/>
		<property name="new_version" value="${maj_ver}${new_min_ver}"/>
		<echo>Version current ${swt_version} -> New ${new_version}</echo>

		<replace file="${tmpdir}/${library_j2se}" token="MINOR_VERSION = ${min_ver}" value="MINOR_VERSION = ${new_min_ver}"/>
		<replace file="${tmpdir}/${library_j2me}" token="MINOR_VERSION = ${min_ver}" value="MINOR_VERSION = ${new_min_ver}"/>
		<replace file="${tmpdir}/${version_file}" token="version ${maj_ver}.${min_ver}" value="version ${maj_ver}.${new_min_ver}"/>
		<replace file="${tmpdir}/${make_common}" token="min_ver=${min_ver}" value="min_ver=${new_min_ver}"/>	
			
		<echo file="${tmpdir}/ver.txt">new_comma_ver=${new_version}</echo>
		<replaceregexp file="${tmpdir}/ver.txt" match="(\d)(\d)(\d)(\d)" replace="\1,\2,\3,\4" byline="true"/>
		<loadproperties srcFile="${tmpdir}/ver.txt"/>
		<replace file="${tmpdir}/${make_common}" token="comma_ver=${comma_ver}" value="comma_ver=${new_comma_ver}"/>	

		<cvs cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true" dest="${tmpdir}">
			<commandline>
				<argument value="commit"/>
				<argument value="-m"/>
				<argument line="'Update current version from v${swt_version} to v${new_version}'"/>
				<argument value="${library_j2se}"/>
				<argument value="${library_j2me}"/>
				<argument value="${make_common}"/>
				<argument value="${version_file}"/>
			</commandline>
		</cvs>
		<delete dir="${tmpdir}" quiet="true"/>
		
	</target>

	<target name="get_version" >
		<property name="version_file" value="org.eclipse.swt/Eclipse SWT/common/library/make_common.mak"/>
		<cvs cvsRoot="${cvsRootAnon}" cvsrsh="${cvsRsh}" failonerror="true">
			<commandline>
				<argument value="checkout"/>
				<argument line="${TAG}"/>
				<argument value="${version_file}"/>
			</commandline>
		</cvs>
		<copy file="${version_file}" tofile="tmp"/>
		<loadproperties srcFile="${version_file}"/>
		<propertyfile file="tmp">
			<entry key="old_min_ver" default="${min_ver}" type="int" operation="-"/>
		</propertyfile>
		<loadproperties srcFile="tmp"/>
		<delete file="tmp"/>
		<property name="swt_version" value="${maj_ver}${min_ver}"/>
		<property name="old_version" value="${maj_ver}${old_min_ver}"/>
		<echo>Version ${swt_version} ${old_version}</echo>
	</target>
	
	<target name="new_version" if="is_new_version">
		<echo>Removing ${removed_files}</echo>
		<cvs dest="${fragment}" command="remove -f ${removed_files}" cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true"/>
		<echo>Commiting ${removed_files}</echo>
		<cvs dest="${fragment}" command="commit -m 'remove v${old_version}' ${removed_files}" cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true"/>
		<echo>Adding ${added_files}</echo>
		<cvs dest="${fragment}" command="add -kb ${added_files}" cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true"/>
	</target>
	
	<target name="build_notes">
		<property name="cvsRsh" value="plink"/>
		<tstamp>
			<format property="header.time" pattern="EEEE MMMMM dd, yyyy"/>
		</tstamp>
		<tstamp>
			<format property="url.from.time" pattern="yyyy-MM-dd" offset="-7" unit="day"/>
		</tstamp>
		<tstamp>
			<format property="url.to.time" pattern="yyyy-MM-dd"/>
		</tstamp>
		<property name="build_notes" value="org.eclipse.swt/buildnotes_swt.html"/>
		<property name="version_file" value="org.eclipse.swt/Eclipse SWT/common/library/make_common.mak"/>
		<property name="tmpdir" value="c:/build/swt-builddir/tmp/notes"/>
		<delete dir="${tmpdir}" quiet="true"/>
		<mkdir dir="${tmpdir}"/>
		<cvs cvsRoot="${cvsRootAnon}" cvsrsh="${cvsRsh}" failonerror="true" dest="${tmpdir}">
			<commandline>
				<argument value="checkout"/>
				<argument line="${TAG}"/>
				<argument value="${build_notes}"/>
				<argument value="${version_file}"/>
			</commandline>
		</cvs>
		<loadproperties srcfile="${tmpdir}/${version_file}"/>
		<property name="swt_version" value="${maj_ver}.${min_ver}"/>
		<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;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_version} - ${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="${tmpdir}/${build_notes}" token="${match_line}" value="${match_line}${body}"/>
		<cvs cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true" dest="${tmpdir}">
			<commandline>
				<argument value="commit"/>
				<argument line="${TAG}"/>
				<argument value="-m"/>
				<argument value="'new version v${maj_ver}${min_ver}'"/>
				<argument value="${build_notes}"/>
			</commandline>
		</cvs>
		<delete dir="${tmpdir}" quiet="true"/>
	</target>

	
	<!-- Params: fragment -->
	<target name="commit_fragment" depends="get_version">
		<copy todir="${fragment}" overwrite="false">
			<fileset dir="${fragment}" includes="*${old_version}*"/>
			<regexpmapper from="(.*)${old_version}(.*)" to="\1${swt_version}\2"/>
		</copy>

		<fileset id="removeid" dir="${fragment}" includes="*${old_version}*"/>
		<property name="rfiles" refid="removeid"/>
		<echo file="tmp">removed_files=${rfiles}</echo>
		<replace file="tmp" token=";" value=" "/>
		<loadproperties srcfile="tmp"></loadproperties>
		<delete file="tmp"/>
		
		<fileset id= "addid" dir="${fragment}" includes="*${swt_version}*"/>
		<property name="afiles" refid="addid"/>
		<echo file="tmp">added_files=${afiles}</echo>
		<replace file="tmp" token=";" value=" "/>
		<loadproperties srcfile="tmp"></loadproperties>
		<delete file="tmp"/>
		
		<condition property="is_new_version">
			<not>
				<equals arg1="" arg2="${removed_files}"/>
			</not>
		</condition>
		<antcall target="new_version"/>
		
		<echo>"Commiting ${added_files}</echo>
		<cvs dest="${fragment}" command="commit -m 'v${swt_version}' ${added_files}" cvsRoot="${cvsRoot}" cvsrsh="${cvsRsh}" failonerror="true"/>
	</target>
	
	
	<target name="tag_fragment">
		<property name="tmpdir" value="C:/BUILD/swt-builddir/tmp/map"/>
		<property name="map" value="org.eclipse.releng/maps/swt.map"/>
		<property name="map_copy" value="${tmpdir}/swt_map.txt"/>
		<property name="map_xml" value="${tmpdir}/swt_map.xml"/>
		<delete dir="${tmpdir}" quiet="true"/>
		<mkdir dir="${tmpdir}"/>
		<cvs cvsRoot="${cvsRootAnon}" failonerror="true" dest="${tmpdir}">
			<commandline>
				<argument value="checkout"/>
				<argument value="${map}"/>
			</commandline>
		</cvs>
		<copy file="${tmpdir}/${map}" tofile="${map_copy}"/>
		<replace file="${map_copy}" token="=" value="&quot; old=&quot;"/>
		<replace file="${map_copy}" token="fragment@" value="&lt;element project=&quot;"/>
		<replace file="${map_copy}" token="plugin@" value="&lt;element project=&quot;"/>
		<replace file="${map_copy}" token=":pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse," value="&quot;/&gt;"/>
		<!--delete dir="${tmpdir}" quiet="true"/-->
		<replaceregexp file="${map_copy}" match="!(.*)" replace="" byline="true"/>
		<loadfile property="body" srcfile="${map_copy}"/>
		<echo file="${map_xml}">&lt;project&gt;</echo>
		<echo file="${map_xml}" append="true">${body}</echo>
		<echo file="${map_xml}" append="true">&lt;/project&gt;</echo>			

			
	</target>

	<!-- Params: cp, fragment, build_target -->
	<target name="build_fragment">
		<property name="cvsRsh" value="ssh"/>
		
		<!-- check out classpath, fragments, and natives -->
		<cvs cvsRoot="${cvsRootAnon}" failonerror="true">
			<commandline>
				<argument value="checkout"/>
				<argument line="${TAG}"/>
				<argument value="${cp}"/>
				<argument value="${fragment}"/>
			</commandline>
		</cvs>
		
		<!-- check out natives -->
		<antcall target="checkout_natives"/>
		
		<!-- build libraries -->
		<antcall target="${build_target}"/>
		
		<!-- commint libraries -->
		<antcall target="commit_fragment"/>
	</target>

	<!-- Params: cp, fragment, build_target -->
	<target name="build_local">
		<property name="tmpdir" value="C:/BUILD/swt-builddir/tmp/${fragment}"/>
		<property name="tools" value="org.eclipse.swt.tools/tasks"/>
		<property name="build_version" value=""/>
		<delete dir="${tmpdir}" quiet="true"/>
		<mkdir dir="${tmpdir}"/>
		<cvs cvsRoot="${cvsRootAnon}" failonerror="true" dest="${tmpdir}">
			<commandline>
				<argument value="checkout"/>
				<argument value="${tools}"/>
			</commandline>
		</cvs>
		<ant antfile="build.xml" output="${logdir}/${build_version}/${fragment}.log" dir="${tmpdir}/${tools}" target="build_fragment">
			<property name="cvsRsh" value="plink"/>
			<property name="cp" value="${cp}"/>
			<property name="fragment" value="${fragment}"/>
			<property name="build_target" value="${build_target}"/>
		</ant>
		<delete dir="${tmpdir}"/>
	</target>
	
	<!-- Params: machine, pre_commands, cp, fragment, build_target -->
	<target name="build_ssh">
		<property name="tmpdir" value="~/build/${machine}_${fragment}"/>
		<property name="tools" value="org.eclipse.swt.tools/tasks"/>
		<property name="pre_commands" value=""/>
		<property name="build_version" value=""/>
		<sshexec host="${machine}" 
			username="swtbuild" 
			keyfile="C:\BUILD\ssh\swtbuild_dsa_private" 
			trust="true"
			output="${logdir}/${build_version}/${fragment}.log"
	 		command="${pre_commands} rm -rf ${tmpdir}; mkdir ${tmpdir}; cd ${tmpdir}; cvs -d ${cvsRootAnon} checkout ${tools}; cd ${tmpdir}/${tools}; ant build_fragment -Dcp=${cp} -Dfragment=${fragment} -Dbuild_target=${build_target}; cd; rm -rf ${tmpdir}"/>
	</target>

	<!-- all platforms -->
	<target name="win32_x86">
		<antcall target="build_local">
			<param name="cp" value="org.eclipse.swt/.classpath_win32"/>
			<param name="fragment" value="org.eclipse.swt.win32.win32.x86"/>
			<param name="build_target" value="build_win32_x86"/>
		</antcall>
	</target>

	<target name="win32_x86_64">
		<antcall target="build_local">
			<param name="cp" value="org.eclipse.swt/.classpath_win32"/>
			<param name="fragment" value="org.eclipse.swt.win32.win32.x86_64"/>
			<param name="build_target" value="build_win32_x86_64"/>
		</antcall>
	</target>	

	<target name="win32_ia64">
		<antcall target="build_local">
			<param name="cp" value="org.eclipse.swt/.classpath_win32"/>
			<param name="fragment" value="org.eclipse.swt.win32.win32.ia64"/>
			<param name="build_target" value="build_win32_ia64"/>
		</antcall>
	</target>	

	<target name="wince">
		<antcall target="build_local">
			<param name="cp" value="org.eclipse.swt/.classpath_win32"/>
			<param name="fragment" value="org.eclipse.swt.win32.wce_ppc.arm"/>
			<param name="build_target" value="build_wince"/>
		</antcall>
	</target>

	<target name="wpf_x86">
		<antcall target="build_local">
			<param name="cp" value="org.eclipse.swt/.classpath_wpf"/>
			<param name="fragment" value="org.eclipse.swt.wpf.win32.x86"/>
			<param name="build_target" value="build_wpf_x86"/>
		</antcall>
	</target>

	<target name="gtk_linux_x86">
		<antcall target="build_ssh">
			<param name="machine" value="rhel4vh"/>
			<param name="cp" value="org.eclipse.swt/.classpath_gtk"/>
			<param name="fragment" value="org.eclipse.swt.gtk.linux.x86"/>
			<param name="build_target" value="build_gtk_linux_x86"/>
			<param name="pre_commands" value="export JAVA_HOME=~/build/JRE/x32/jdk1.6.0_14; export PATH=$PATH:~/build/apache-ant-1.7.1/bin; "/>
		</antcall>
	</target>
	
	<target name="gtk_linux_x86_64">
		<antcall target="build_ssh">
			<param name="machine" value="tswtrh4x64"/>
			<param name="cp" value="org.eclipse.swt/.classpath_gtk"/>
			<param name="fragment" value="org.eclipse.swt.gtk.linux.x86_64"/>
			<param name="build_target" value="build_gtk_linux_x86_64"/>
			<param name="pre_commands" value="export JAVA_HOME=~/build/JRE/x64/jdk1.6.0_14; export PATH=$PATH:~/build/apache-ant-1.7.1/bin; "/>
		</antcall>
	</target>
	
	<target name="gtk_linux_ppc">
		<antcall target="build_ssh">
			<param name="machine" value="apollobuildserv14"/>
			<param name="cp" value="org.eclipse.swt/.classpath_gtk"/>
			<param name="fragment" value="org.eclipse.swt.gtk.linux.ppc"/>
			<param name="build_target" value="build_gtk_linux_ppc"/>
			<param name="pre_commands" value="export JAVA_HOME=~/build/JRE/PPC/ibm-java-ppc-60/; export PATH=$PATH:~/build/apache-ant-1.7.1/bin; "/>
		</antcall>
	</target>
	
	<target name="gtk_solaris_x86">
		<antcall target="build_ssh">
			<param name="machine" value="tswtopensol"/>
			<param name="cp" value="org.eclipse.swt/.classpath_gtk"/>
			<param name="fragment" value="org.eclipse.swt.gtk.solaris.x86"/>
			<param name="build_target" value="build_gtk_solaris_x86"/>
			<param name="pre_commands" value="export JAVA_HOME=~/build/JRE/Solaris_x86/jdk1.6.0_14/; export PATH=$PATH:~/build/apache-ant-1.7.1/bin; "/>
		</antcall>
	</target>

	<target name="gtk_solaris_sparc">
		<antcall target="build_ssh">
			<param name="machine" value="mmsol10"/>
			<param name="cp" value="org.eclipse.swt/.classpath_gtk"/>
			<param name="fragment" value="org.eclipse.swt.gtk.solaris.sparc"/>
			<param name="build_target" value="build_gtk_solaris_sparc"/>
			<param name="pre_commands" value="export JAVA_HOME=~/build/JRE/SPARC/jdk1.6.0_14/; export PATH=/export/home/SUNWspro/bin:/usr/ccs/bin:/usr/local/bin:$PATH:~/build/apache-ant-1.7.1/bin; "/>
		</antcall>
	</target>

	<target name="motif_linux">
		<antcall target="build_ssh">
			<param name="machine" value="rhel4vh"/>
			<param name="cp" value="org.eclipse.swt/.classpath_motif"/>
			<param name="fragment" value="org.eclipse.swt.motif.linux.x86"/>
			<param name="build_target" value="build_motif_linux"/>
			<param name="pre_commands" value="export JAVA_HOME=~/build/JRE/x32/jdk1.6.0_14; export PATH=$PATH:~/build/apache-ant-1.7.1/bin; "/>
		</antcall>
	</target>

	<target name="motif_aix">
		<antcall target="build_ssh">
			<param name="machine" value="janis"/>
			<param name="cp" value="org.eclipse.swt/.classpath_motif"/>
			<param name="fragment" value="org.eclipse.swt.motif.aix.ppc"/>
			<param name="build_target" value="build_motif_aix"/>
			<param name="pre_commands" value="export JAVA_HOME=~/build/JRE/AIX/sdk; export PATH=$PATH:~/build/apache-ant-1.7.1/bin:~/build/cvs_bin/AIX;"/>
		</antcall>
	</target>

	<target name="motif_solaris">
		<antcall target="build_ssh">
			<param name="machine" value="mmsol10"/>
			<param name="java_home" value="~/build/JRE/SPARC/jdk1.6.0_14"/>
			<param name="cp" value="org.eclipse.swt/.classpath_motif"/>
			<param name="fragment" value="org.eclipse.swt.motif.solaris.sparc"/>
			<param name="build_target" value="build_motif_solaris"/>
			<param name="pre_commands" value="export JAVA_HOME=~/build/JRE/SPARC/jdk1.6.0_14; export PATH=/export/home/SUNWspro/bin:/usr/ccs/bin:$PATH:~/build/apache-ant-1.7.1/bin; "/>
		</antcall>
	</target>

	<target name="motif_hpux">
		<antcall target="build_ssh">
			<param name="machine" value="darkwing"/>
			<param name="cp" value="org.eclipse.swt/.classpath_motif"/>
			<param name="fragment" value="org.eclipse.swt.motif.hpux.ia64_32"/>
			<param name="build_target" value="build_motif_hpux"/>
			<param name="pre_commands" value="export JAVA_HOME=/opt/java1.5; export PATH=$PATH:~/build/apache-ant-1.7.1/bin; "/>
		</antcall>
	</target>

	<target name="cocoa_x86_and_ppc">
		<antcall target="build_ssh">
			<param name="machine" value="grants-imac"/>
			<param name="cp" value="org.eclipse.swt/.classpath_cocoa"/>
			<param name="fragment" value="org.eclipse.swt.cocoa.macosx"/>
			<param name="build_target" value="build_cocoa_x86_and_ppc"/>
		</antcall>
	</target>
	
	<target name="cocoa_x86_64">
		<antcall target="build_ssh">
			<param name="machine" value="grants-imac"/>
			<param name="cp" value="org.eclipse.swt/.classpath_cocoa"/>
			<param name="fragment" value="org.eclipse.swt.cocoa.macosx.x86_64"/>
			<param name="build_target" value="build_cocoa_x86_64"/>
		</antcall>
	</target>
	
	<target name="carbon">
		<antcall target="build_ssh">
			<param name="machine" value="grants-imac"/>
			<param name="cp" value="org.eclipse.swt/.classpath_carbon"/>
			<param name="fragment" value="org.eclipse.swt.carbon.macosx"/>
			<param name="build_target" value="build_carbon"/>
		</antcall>
	</target>
			
	<target name="photon">
		<antcall target="build_local">
			<param name="cp" value="org.eclipse.swt/.classpath_photon"/>
			<param name="fragment" value="org.eclipse.swt.photon.qnx.x86"/>
			<param name="build_target" value="build_photon"/>
		</antcall>
	</target>
	
	<target name="build_all">
		<tstamp>
		      <format property="build_version" pattern="yyyyMMddkkmmss"/>
		</tstamp>
		<mkdir dir="${logdir}/${build_version}"/>
		<parallel failonany="false">
			<antcall target="win32_x86"></antcall>
			<antcall target="win32_x86_64"></antcall>
			<antcall target="win32_ia64"></antcall>
			<antcall target="wince"></antcall>
			<antcall target="wpf_x86"></antcall>
			<antcall target="gtk_linux_x86"></antcall>
			<antcall target="gtk_linux_x86_64"></antcall>
			<antcall target="gtk_linux_ppc"></antcall>
			<antcall target="gtk_solaris_x86"></antcall>
			<antcall target="gtk_solaris_sparc"></antcall>
			<antcall target="motif_linux"></antcall>
			<antcall target="motif_aix"></antcall>
			<antcall target="motif_solaris"></antcall>
			<antcall target="motif_hpux"></antcall>
			<antcall target="cocoa_x86_and_ppc"></antcall>
			<antcall target="cocoa_x86_64"></antcall>
			<antcall target="carbon"></antcall>
			<antcall target="photon"></antcall>
		</parallel>
	</target>
		
</project>