File: build.xml

package info (click to toggle)
eclipse 3.8.1-10
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 338,840 kB
  • ctags: 472,808
  • sloc: java: 2,762,042; ansic: 136,783; xml: 105,676; cpp: 35,759; jsp: 4,420; sh: 3,288; perl: 1,687; makefile: 232; python: 67; php: 24
file content (1169 lines) | stat: -rw-r--r-- 53,935 bytes parent folder | download | duplicates (2)
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
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
<project name="Eclipse SDK build" default="provisionSDKinDropins" basedir=".">
	<tstamp>
		<format property="timestamp" pattern="yyyyMMddHHmmss" />
	</tstamp>
	<record name="build_${timestamp}.log" />
	<echo message="Build log is available in build_${timestamp}.log" />
	
	<property environment="env"/>
	<property name="jhome" value="${env.JAVA_HOME}"/>
	<condition property="javaHomeExists">
		<resourceexists>
			<file file="${jhome}"/>
		</resourceexists>
	</condition>
	<fail unless="javaHomeExists" message="JAVA_HOME is not set properly"/>

	<property name="baseBuilder" value="${basedir}/bootstrap" />
	<property name="launcher" value="${basedir}/bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
	<property name="eclipse.pdebuild.scripts" value="${basedir}/bootstrap/plugins/org.eclipse.pde.build/scripts" />

	<property file="build.properties" />

	<available file="eclipse-${label}-src.tar.bz2" property="sdkSourcePresent" value="true" />
	<available file="eclipse/plugins/org.eclipse.equinox.launcher/build.properties" property="extractedSdkSourcePresent" value="true" />

	<condition property="onlyExtractedSdkSourcePresent">
		<and>
			<isfalse value="${sdkSourcePresent}" />
			<istrue value="${extractedSdkSourcePresent}" />
		</and>
	</condition>
	<condition property="sdkSourceTarballPresent">
		<or>
			<isset property="sdkSourcePresent" />
			<isset property="extractedSdkSourcePresent" />
		</or>
	</condition>

	<available file="${basedir}/debian/eclipse-build-generatedScripts.tar.bz2" property="scriptsPresent" value="true" />
	<available file="eclipse-sdktests-${label}-src.tar.bz2" property="testsSourcePresent" value="true" />
	<available file="eclipse-sdktests-${label}-scripts.tar.bz2" property="testsScriptsPresent" value="true" />

	<!-- Check what has already been done -->
	<available property="unpack.complete" file="unpack-stamp" value="true" />
	<uptodate property="buildId.complete" srcfile="unpack-stamp" targetfile="buildId-stamp" />
	<uptodate property="patch.complete" srcfile="unpack-stamp" targetfile="patch-stamp" />
	<uptodate property="symlinks.complete" srcfile="patch-stamp" targetfile="symlinks-stamp" />
	<uptodate property="compilelibs.complete" srcfile="unpack-stamp" targetfile="compilelibs-stamp" />
	<uptodate property="build.complete" srcfile="patch-stamp" targetfile="build-stamp" />
	<uptodate property="p2prep.complete" srcfile="build-stamp" targetfile="p2prep-stamp" />
	<uptodate property="provision.platform.complete" srcfile="build-stamp" targetfile="provision.platform-stamp" />
	<uptodate property="provision.cvs.complete" srcfile="build-stamp" targetfile="provision.cvs-stamp" />
	<uptodate property="provision.tests.complete" srcfile="testsbuild-stamp" targetfile="provision.tests-stamp" />
	<uptodate property="provisionSDKinDropins.complete" srcfile="build-stamp" targetfile="provisionSDKinDropins-stamp" />
	<available file="bootstrap/plugins" property="bootstrapped" value="true" />

	<property name="topBuildDir" value="${basedir}/build" />
	<property name="homeDir" value="${basedir}/home" />
	<property name="baseworkspace" value="${basedir}/baseworkspace" />
	<property name="buildworkspace" value="${basedir}/buildworkspace" />
	<property name="buildDirectory" value="${topBuildDir}/eclipse-${label}-src" />
	<property name="buildConfigs" value="${buildDirectory}/buildConfigs" />
	<property name="buildConfig" value="${buildConfigs}/eclipse-build-config" />
	<property name="productFiles" value="${buildConfig}/productFiles" />
	<property name="reposource" value="${buildDirectory}/reposource" />
	<property name="provisionDir" value="${buildDirectory}/installation" />

	<!-- Distros with alternative JUnit 4 JAR locations should pass this
	     parameter in to ant -->
	<property name="junit4JarLocation" value="/usr/share/java/junit4.jar" />

	<!-- Determine host architecture -->
	<exec executable="uname" outputproperty="uname-m">
		<arg line="-m" />
	</exec>
	<condition property="hostArch" value="arm">
		<matches pattern="^arm.*" string="${uname-m}" />
	</condition>
	<condition property="hostArch" value="x86">
		<matches pattern="i[0-9]*86" string="${uname-m}" />
	</condition>
	<condition property="hostArch" value="PA_RISC">
		<matches pattern="^parisc.*" string="${uname-m}" />
	</condition>
	<condition property="hostArch" value="sparc">
		<matches pattern="sparcv9" string="${uname-m}" />
	</condition>
	<condition property="hostArch" value="${uname-m}">
		<not>
			<isset property="hostArch" />
		</not>
	</condition>
	<condition property="buildArch" value="${hostArch}">
		<not>
			<isset property="buildArch" />
		</not>
	</condition>
	<echo message="uname -m: ${uname-m}. Build eclipse on ${hostArch} for ${buildArch}." />

	<property name="destDir" value="" />
	<property name="prefix" value="/usr/local" />
	<!-- Do we want /usr/lib64 if it's a 64-bit architecture? -->
	<property name="multilib" value="false" />
	<condition property="setLib64">
		<and>
			<istrue value="${multilib}" />
			<or>
				<!-- Is it a 64-bit architecture? -->
				<equals arg1="${buildArch}" arg2="x86_64" />
				<equals arg1="${buildArch}" arg2="ppc64" />
			</or>
		</and>
	</condition>

	<target name="setLib64Dir" if="setLib64">
		<property name="libDir" value="lib64" />
	</target>

	<target name="setLibDir" depends="setLib64Dir">
		<property name="libDir" value="lib" />
		<property name="installationDir" value="${destDir}${prefix}/${libDir}/eclipse" />
	</target>

	<target name="getInstallationDir" depends="setLibDir">
		<echo message="Installation directory will be ${destDir}/${prefix}/${libDir}" />
	</target>

	<target name="bootstrap" unless="bootstrapped">

		<!-- Some of the equinox plugins are required to use this environment, because their build will fail with full vm. Bootstrap needs to have this available.-->		
		<javac compiler="classic" srcdir="${buildDirectory}/environments/ee.minimum/src" destdir="${buildDirectory}/environments/ee.minimum" target="1.1" source="1.1" />
		<jar basedir="${buildDirectory}/environments/ee.minimum" destfile="bootstrap/environment/ee.minimum.jar"/>

		<ant inheritall="false" antfile="pdebuild.xml">
			<property name="buildId" value="${buildId}" />
			<property name="buildArch" value="${buildArch}" />
			<property name="buildDirectory" value="../../" />
		</ant>
	</target>

	<!-- Run this target with antRunner application -->
	<target name="generateBuildXmls" depends="unpack">
		<ant antfile="pdebuild.xml" target="generateScripts" />
	</target>

	<target name="fetch" unless="sdkSourceTarballPresent">
		<fail message="SDK source tarball eclipse-${label}-src.tar.bz2 is not present.  Please either download a file such as eclipse-${label}-src.tar.bz2 from http://download.eclipse.org/technology/linuxtools/eclipse-build/, generate one by running ./buildSDKSource.sh or update build.properties file to reflect your tarball version." />
	</target>

	<target name="extractBuildXmls" if="scriptsPresent">
		<untar compression="bzip2" dest="${basedir}/build/eclipse-${label}-src" src="${basedir}/debian/eclipse-build-generatedScripts.tar.bz2" />
	<exec executable="${basedir}/jasper7.sh">
		<arg value="${label}"/>
	</exec>
		<!--
		<fail message="Build scripts to bootstrap PDE Build must be generated and present in eclipse-build-generatedScripts.tar.bz2.  See pdebuild.xml for details."/>
		-->
	</target>

	<target name="extractSource" unless="onlyExtractedSdkSourcePresent">
		<echo message="Extracting SDK source (tar jxf eclipse-${label}-src.tar.bz2)" />
		<untar dest="${topBuildDir}" src="${basedir}/eclipse-${label}-src.tar.bz2" compression="bzip2" />
	</target>

	<target name="copySource" unless="sdkSourcePresent">
		<echo message="Copy SDK source (cp -rd --not-target-directory eclipse ${buildDirectory})" />
		<exec executable="cp" failonerror="true">
			<arg value="-rd" />
			<arg value="--no-target-directory" />
			<arg value="eclipse" />
			<arg value="${buildDirectory}" />
		</exec>
		<delete includeemptydirs="true">
    			<fileset dir="${buildDirectory}/plugins">
				<include name="**/org.eclipse.swt*/**" />
			</fileset>
		</delete>
	</target>

	<available file="${basedir}/eclipse-build-feature" property="buildFeaturePresent" value="true" />
	<target name="symlinkBuildFeature" unless="buildFeaturePresent">
	  <echo message="creating link to feature dir (../eclipse-build-feature)" />
	  <symlink link="${basedir}/eclipse-build-feature" resource="${basedir}/../eclipse-build-feature"/>
	</target>

	<available file="${basedir}/eclipse-build-config" property="buildConfigPresent" value="true" />
	<target name="symlinkBuildConfig" unless="buildConfigPresent">
	  <echo message="creating link to config dir (../eclipse-build-config)" />
	  <symlink link="${basedir}/eclipse-build-config" resource="${basedir}/../eclipse-build-config"/>
	</target>

	<target name="unpack" depends="fetch,setLibDir,symlinkBuildFeature,symlinkBuildConfig" unless="unpack.complete">
		<delete dir="${topBuildDir}" />
		<mkdir dir="${topBuildDir}" />

		<!-- User home used for build -->
		<delete dir="${homeDir}" />
		<mkdir dir="${homeDir}" />

		<!-- Workspaces used for build -->
		<delete dir="${baseworkspace}" />
		<mkdir dir="${baseworkspace}" />
		<delete dir="${buildworkspace}" />
		<mkdir dir="${buildworkspace}" />

		<antcall target="extractSource" />
		<antcall target="copySource" />
		<antcall target="extractBuildXmls" />

		<delete dir="${buildDirectory}/buildConfigs" />
		<mkdir dir="${buildDirectory}/buildConfigs" />

		<echo message="Copying eclipse-build main feature source" />
		<copy todir="${buildConfigs}/eclipse-build-config">
			<fileset dir="eclipse-build-config" />
		</copy>

		<echo message="Copying eclipse-build builder" />
		<copy todir="${buildDirectory}/features/eclipse-build-feature">
			<fileset dir="eclipse-build-feature" />
		</copy>
		<delete verbose="true">
			<fileset dir="${buildDirectory}/plugins" includes="**/ECLIPSEF.SF" />
			<fileset dir="${buildDirectory}/plugins" includes="**/ECLIPSEF.RSA" />
		</delete>
		
		<!-- add additional archs for org.eclipse.equinox.launcher & org.eclipse.core.filesystem -->
		<antcall target="generateSecondaryFragments"/>
		
		<!-- prepare ecf build tree -->
		<delete>
			<fileset dir="${buildDirectory}/plugins" includes="org.eclipse.ecf*" />
			<fileset dir="${buildDirectory}/plugins" includes="org.eclipse.jetty*" />
		</delete>
		<!--delete dir="${buildDirectory}/plugins/org.eclipse.equinox.http.jetty_1.1.100" /-->
		<!-- Create a stamp file -->
		<echo file="unpack-stamp" />
	</target>
	
	<target name="generateSecondaryFragments">
		<!-- TODO: replace the rename.sh with ant -->
		
		<copy file="additionalArchs/rename.sh" todir="${buildDirectory}/plugins" /> 
		
		<generateArch newArch="alpha" archBase="x86_64"/>
		<generateArch newArch="arm" archBase="x86"/>
		<generateArch newArch="aarch64" archBase="x86"/>
		<generateArch newArch="ia64" archBase="x86_64"/>
		<generateArch newArch="mips" archBase="x86_64"/>
		<generateArch newArch="mipsel" archBase="x86_64"/>
		<generateArch newArch="PA_RISC" archBase="x86_64"/>
		<generateArch newArch="ppc" archBase="x86" />
		<generateArch newArch="ppc64" archBase="x86_64"/>
		<generateArch newArch="ppc64le" archBase="x86_64"/>
		<generateArch newArch="sparc" archBase="x86" />
                <generateArch newArch="sparc64" archBase="x86_64"/>
		<generateArch newArch="s390" archBase="x86" />
		<generateArch newArch="s390x" archBase="x86" />

		<delete file="${buildDirectory}/plugins/rename.sh"/>
	</target>
	<macrodef name="copyPlugin">
		<attribute name="pluginName" />
		<attribute name="archBase" />
		<attribute name="newArch" />
		<sequential>
			<copy todir="${buildDirectory}/plugins/@{pluginName}.@{newArch}">
				<resources>
					<fileset dir="${buildDirectory}/plugins/@{pluginName}.@{archBase}">
						<include name="**" />
					</fileset>
				</resources>
			</copy>
		</sequential>
	</macrodef>

	<macrodef name="generateArch">
		<attribute name="archBase" />
		<attribute name="newArch" />
		<sequential>
			<copyPlugin pluginName="org.eclipse.core.filesystem.linux"
			            archBase="@{archBase}" newArch="@{newArch}" />
			<copyPlugin pluginName="org.eclipse.core.net.linux"
			            archBase="@{archBase}" newArch="@{newArch}" />
			<copyPlugin pluginName="org.eclipse.equinox.launcher.gtk.linux"
			            archBase="@{archBase}" newArch="@{newArch}" />
			<exec dir="${buildDirectory}/plugins" executable="sh" failonerror="true">
				<arg line="rename.sh @{archBase} @{newArch}" />
			</exec>
			<replace dir="${buildDirectory}/plugins" value="@{newArch}" token="@{archBase}">
				<exclude name="rename.sh" />
				<include name="*@{newArch}/**/*.*" />
				<excludesfile name="${buildDirectory}/plugins/rename.sh" />
			</replace>
			<mkdir dir="${buildDirectory}/features/" />
		</sequential>
	</macrodef>

	<target name="clean-sdk">
		<delete dir="${homeDir}" />
		<delete dir="${baseworkspace}" />
		<delete dir="${buildworkspace}" />
		<delete dir="${topBuildDir}" />
		<delete dir="${testsBuildDir}" />
		<delete dir="configuration" />
		<delete dir="p2" />
		<delete dir="workspace" />
		<delete dir="${basedir}/task-bin" />
		<delete>
			<fileset dir="." includes="*-stamp" />
		</delete>
		<delete file="sdk-tests.properties" />
	</target>

	<target name="clean" depends="clean-sdk">
		<delete dir="bootstrap/configuration/org.eclipse.core.runtime" />
		<delete dir="bootstrap/configuration/org.eclipse.equinox.app" />
		<delete dir="bootstrap/configuration/org.eclipse.osgi" />
		<delete dir="bootstrap/p2" />
		<delete dir="bootstrap/plugins" />
		<delete dir="bootstrap/workspace" />
	</target>

	<target name="distclean" depends="clean">
		<delete>
			<fileset dir="." includes="*.log" />
		</delete>
		<delete includeemptydirs="true">
			<fileset dir="." includes="tests_*/**" />
		</delete>
	</target>

	<target name="insertBuildId" depends="unpack" unless="buildId.complete">
		<replace dir="${buildDirectory}/plugins" value="${buildId}" token="@build@">
			<include name="**/about.mappings" />
		</replace>
		<replace dir="${buildDirectory}" value="${buildId}" token="@build@">
			<include name="**/configuration/config.ini" />
		</replace>
		<echo file="buildId-stamp" />
	</target>

	<target name="applyPatches" depends="insertBuildId" unless="patch.complete">
		<!-- eclipse-build-only patches -->
		<!--patch patchfile="${basedir}/patches/eclipse-buildswtnatives.patch" dir="${buildDirectory}" strip="1" />
		<patch patchfile="${basedir}/patches/eclipse-addArchesAnd64bitSWT.patch" dir="${buildDirectory}" strip="1" /-->
		<patch patchfile="${basedir}/patches/eclipse-add-archs-filesystem.patch" dir="${buildDirectory}" strip="1" />
		<!--patch patchfile="${basedir}/patches/eclipse-add-archs-swt.patch" dir="${buildDirectory}" strip="1" /-->
		<patch patchfile="${basedir}/patches/eclipse-add-archs-executable.patch" dir="${buildDirectory}" strip="1" />
		<patch patchfile="${basedir}/patches/eclipse-add-ppc64-sparc64-s390-s390x.patch" dir="${buildDirectory}" strip="1" />
		
		<patch patchfile="${basedir}/patches/donotstorebuildlogsinfiles.patch" dir="${buildDirectory}" strip="1" />

		<patch patchfile="${basedir}/patches/eclipse-pde.build-add-package-build.patch" dir="${buildDirectory}" strip="1" />

		<!-- This one should be removed when Eclipse bug 369215 is fixed -->
		<!--patch patchfile="${basedir}/patches/gnomeproxy-makefile.patch" dir="${buildDirectory}" strip="1" /-->

		<patch patchfile="${basedir}/patches/eclipse-nosourcebundlesfordependencies.patch" dir="${buildDirectory}" strip="1" />

		<replace file="${buildDirectory}/plugins/org.eclipse.pde.build/templates/package-build/build.properties" token="/usr/share/eclipse" value="/usr/${libDir}/eclipse" />
		<chmod dir="${buildDirectory}/plugins/org.eclipse.pde.build/templates/package-build" includes="*.sh" perm="a+x" />
		<!-- end eclipse-build-only patches -->
		<!-- Only build for one target (bug #293952) -->
		<copy file="${buildConfigs}/eclipse-build-config/build.properties.in" tofile="${buildConfigs}/eclipse-build-config/build.properties" />
		<replace file="${buildConfigs}/eclipse-build-config/build.properties" token="@build_arch@" value="${buildArch}" />

		<!-- It would be good to remove those two entries, however, before you spent some time here, be warned that: -->		
		<!-- (1) Those plugins contain precompiled classes with source in zips -->
		<!-- (2) Those plugins have no source folders -->
		<!-- (3) Those plugins have dependencies -->
		<!-- Point (3) implies that you cannot have your own build.xml, because you need dependencies that only PDE can discover -->
		<!-- Point (2) implies that you cannot use PDE build.xml, because there is no source folder, so nothing will be compiled -->
		<!-- Point (1) implies that developers will not create a source folder, because they want to ship binaries -->
		<!-- So we have to live with those two patches -->
		<patch patchfile="${basedir}/patches/osgi-util.patch" dir="${buildDirectory}" strip="0" backups="true"/>
		<patch patchfile="${basedir}/patches/osgi-services-build.patch" dir="${buildDirectory}" strip="0" />

		<patch patchfile="${basedir}/patches/eclipse-help-feature-adjust-dependencies.patch" dir="${buildDirectory}" strip="1" />
		<patch patchfile="${basedir}/patches/eclipse-equinox-jsp-jasper.patch" dir="${buildDirectory}" strip="0" />
		<patch patchfile="${basedir}/patches/serverside-patch-additional-imports.patch" dir="${buildDirectory}" strip="0" />

		<patch patchfile="${basedir}/patches/nonRelativeLicense.patch" dir="${buildDirectory}" strip="0" />

		<!--patch patchfile="${basedir}/patches/swt-no-api-generation.patch" dir="${buildDirectory}" strip="0" /-->

		<!--patch patchfile="${basedir}/patches/add-plugin-version-of-arm-launcher-fragment.patch" dir="${buildDirectory}" strip="1" /-->

                <delete dir="${buildDirectory}/plugins/org.eclipse.equinox.io/" />
                <delete dir="${buildDirectory}/plugins/org.eclipse.osgi.services/src/org/osgi/service/io/" />
		<echo file="patch-stamp" />
	</target>

	<target name="buildHelperTask">
		<mkdir dir="task-bin" />
		<javac compiler="modern" target="1.5" source="1.5" debug="true" srcdir="${basedir}/task-src" destdir="${basedir}/task-bin" includeantruntime="true" >
			<compilerarg value="-Xlint:-options"/>
		</javac>
	</target>

	<target name="defineTasks" depends="buildHelperTask">
		<taskdef name="symlinkOSGiJars" classname="org.eclipse.linuxtools.eclipsebuild.SymlinkOSGiJars" classpath="${basedir}/task-bin" />
		<taskdef name="symlinkInstalledOSGiJars" classname="org.eclipse.linuxtools.eclipsebuild.SymlinkInstalledOSGiJars" classpath="${basedir}/task-bin" />
		<taskdef name="symlinkNonOSGiJars" classname="org.eclipse.linuxtools.eclipsebuild.SymlinkNonOSGiJars" classpath="${basedir}/task-bin" />
	</target>

	<target name="symlinkDeps" depends="applyPatches,defineTasks" unless="symlinks.complete">
		<symlinkOSGiJars dependencies="${basedir}/dependencies/dependencies.properties" topLevelDir="${buildDirectory}/plugins" manifests="${basedir}/dependencyManifests" copyFiles="${copyFiles}"/>
		<!-- delete all windows scripts and symlink linux ones -->
		<delete dir="${buildDirectory}/plugins/org.apache.ant_1.8.3.v20120316-1400/bin"/>
		<symlinkNonOSGiJars dependencies="${basedir}/dependencies/nonosgidependencies.properties" topLevelDir="${buildDirectory}/plugins"  copyFiles="${copyFiles}"/>
		<symlinkOSGiJars dependencies="${basedir}/dependencies/jdtdependencies.properties" topLevelDir="${buildDirectory}/plugins" manifests="${basedir}/dependencyManifests" copyFiles="${copyFiles}"/>
		<symlinkNonOSGiJars dependencies="${basedir}/dependencies/jdtnonosgidependencies.properties" topLevelDir="${buildDirectory}/plugins" copyFiles="${copyFiles}"/>
		<symlinkOSGiJars dependencies="${basedir}/dependencies/sdkdependencies.properties" topLevelDir="${buildDirectory}/plugins" manifests="${basedir}/dependencyManifests" copyFiles="${copyFiles}"/>
		<replaceregexp file="${buildDirectory}/plugins/org.apache.ant_1.8.3.v20120316-1400/META-INF/MANIFEST.MF" flags="m,g,s">
			<regexp pattern="^Name.*" />
			<substitution expression="" />
		</replaceregexp>
		<replaceregexp file="${buildDirectory}/plugins/org.apache.ant_1.8.3.v20120316-1400/META-INF/MANIFEST.MF" flags="m,g,s">
			<regexp pattern="^SHA1-Digest.*" />
			<substitution expression="" />
		</replaceregexp>

		<!-- Create a stamp file -->
		<echo file="symlinks-stamp" />
	</target>

	<target name="copyDeps">
	  <antcall target="symlinkDeps">
	    <param name="copyFiles" value="true"/>
	  </antcall>
	</target>

	<target name="prebootstrap" depends="symlinkDeps" unless="prebootstrap.complete">
		<mkdir dir="${basedir}/temp/" />
		<copy todir="${basedir}/temp/" >
			<fileset dir="${basedir}/stubs/">
				<include name="**/*.java" />
			</fileset>
		</copy>
		<copy todir="${basedir}/temp" >
			<fileset dir="${buildDirectory}/plugins/org.eclipse.core.runtime/src/">
				<include name="org/eclipse/core/runtime/IPluginDescriptor.java" />
			</fileset>
		</copy>
		<javac destdir="${basedir}/temp"
			srcdir="${basedir}/temp"
			source="1.3"
			target="1.1"
			debug="true"
			optimize="true"
			fork="true"
			compiler="modern" />
		<mkdir dir="${buildDirectory}/plugins/org.eclipse.core.runtime.compatibility.registry/classes/org/eclipse/core/runtime/" />
		<copy todir="${buildDirectory}/plugins/org.eclipse.core.runtime.compatibility.registry/classes/" >
			<fileset dir="${basedir}/temp/">
				<include name="org/eclipse/core/runtime/IPluginDescriptor.class" />
			</fileset>
		</copy>
		<delete dir="${basedir}/temp/"/>
		<!-- Create a stamp file -->
		<echo file="prebootstrap-stamp" />
	</target>

        <target name="build" depends="applyPatches,symlinkDeps,prebootstrap,bootstrap,compilelibs" unless="build.complete">

		<echo message="build.xml:  eclipse.pdebuild.scripts = ${eclipse.pdebuild.scripts}" />
		<echo message="${basedir}"/>
		<echo message="${buildConfig}"/>
		<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${basedir}" failonerror="true">
			<classpath>
				<pathelement path="bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
			</classpath>
			<arg line="-configuration configuration " />
			<arg line="-application org.eclipse.ant.core.antRunner " />
			<arg line="-buildfile ${eclipse.pdebuild.scripts}/build.xml" />
			<arg line="-propertyfile ${basedir}/build.properties" />
			<arg line="-Dbuilder=${buildConfig} " />
			<arg line="-DbuildDirectory=${buildDirectory} " />
			<!-- Setup this manually -->
			<arg line="-DOSGi/Minimum-1.1=${basedir}/bootstrap/environment/ee.minimum.jar" />
			<arg line="-DdontFetchBinaries=true" />
			<arg line="-consolelog " />
			<jvmarg value="-Xmx512M" />
		</java>



		
		<!-- build equinox initializer -->
		<echo message="build.xml: building equinox initializer"/>
		<mkdir dir="${buildDirectory}/home" />	
		<java classname="org.eclipse.core.launcher.Main" dir="${buildDirectory}/plugins/org.eclipse.equinox.initializer" fork="true">
			<classpath>
				<pathelement path="bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
			</classpath>
			<arg line="-data ${buildworkspace} " />
			<arg line="-Duser.home=${buildDirectory}/home" />
			<arg line="-application org.eclipse.ant.core.antRunner" />
			<arg line="-f build.xml" />
			<arg line="build.update.jar" />
			<jvmarg value="-Xmx512M" />
		</java>

		<!--
		<ant antfile="build.xml" dir="${eclipse.pdebuild.scripts}">
			<property name="arch" value="${buildArch}"/>
			<property name="builder" value="${buildConfig}" />
		</ant>
-->
		<echo file="build-stamp" />
	</target>

	<target name="compile.libgnomeproxy">
		<!-- build libgnomeproxy -->
		<exec dir="${buildDirectory}/plugins/org.eclipse.core.net/natives/unix/linux" executable="make" failonerror="true" />
		<copy file="${buildDirectory}/plugins/org.eclipse.core.net/natives/unix/linux/libgnomeproxy-1.0.0.so" todir="${buildDirectory}/plugins/org.eclipse.core.net.linux.${buildArch}/" />
		<move file="${buildDirectory}/plugins/org.eclipse.core.net/natives/unix/linux/libgnomeproxy-1.0.0.so" todir="${buildDirectory}/plugins/org.eclipse.core.net/fragments/org.eclipse.core.net.linux.${buildArch}/" />
	</target>

	<target name="compilelibs" unless="compilelibs.complete">
		<delete verbose="true">
			<fileset dir="${buildDirectory}/features/org.eclipse.equinox.executable">
				<include name="eclipse" />
			</fileset>
			<fileset dir="${buildDirectory}">
				<include name="**/*.so" />
			</fileset>
		</delete>

		<property name="launcherlibs" value="${buildDirectory}/features/org.eclipse.equinox.executable" />
		<exec dir="${launcherlibs}/library/gtk/" executable="sh" failonerror="true">
			<arg line="build.sh" />
		</exec>

		<property name="launcherfragment" value="org.eclipse.equinox.launcher.gtk.linux.${buildArch}" />

		<copy file="${launcherlibs}/library/gtk/eclipse" todir="${buildDirectory}/features/org.eclipse.equinox.executable/bin/gtk/linux/${buildArch}/" />
		<copy todir="${buildDirectory}/plugins/${launcherfragment}">
			<fileset dir="${launcherlibs}/library/gtk">
				<include name="**/*.so" />
			</fileset>
		</copy>

		<!-- build liblocalfile -->
		<exec dir="${buildDirectory}/plugins/org.eclipse.core.filesystem/natives/unix/linux" executable="make" failonerror="true" />
		<move file="${buildDirectory}/plugins/org.eclipse.core.filesystem/natives/unix/linux/libunixfile_1_0_0.so" todir="${buildDirectory}/plugins/org.eclipse.core.filesystem.linux.${buildArch}/os/linux/${buildArch}">
		</move>
		<!-- build libgnomeproxy -->
		<antcall target="compile.libgnomeproxy" />
		<!-- build libupdate -->
		<ant dir="${buildDirectory}/plugins/org.eclipse.update.core.linux/src" antfile="build.xml" />

		<echo file="compilelibs-stamp" />
	</target>

	<target name="p2prep" depends="build" unless="p2prep.complete">
		<!-- archiveName is set in the build config's customTargets.xml -->
		<!-- FIXME buildLabel should be used here but it's not defined so we cheat and use I.${buildId} instead. -->
		<property name="builtZip" value="${buildDirectory}/I.${buildId}/eclipse-SDK-${buildId}.zip" />
		<!--<property name="builtZip" value="${basedir}/eclipse-SDK-${buildId}.zip"/>-->
		<replace token="@qualifier@" file="${productFiles}/sdk/sdk.product" value="${buildId}" />
		<replace token="@qualifier@" file="${productFiles}/platform/platform.product" value="${buildId}" />
		<property name="tempexec" value="${buildDirectory}/tempexec" />

		<antcall target="createRepo" />
		<antcall target="extractLauncher" />
		<antcall target="publishLauncher" />
		<antcall target="createAndPublishLauncherFeature" />
		<antcall target="publishSDK" />
		<antcall target="publishPlatform" />

		<echo file="p2prep-stamp" />
	</target>

	<target name="createRepo">
		<delete dir="${reposource}" />
		<mkdir dir="${reposource}" />
		<echo message="Unzipping ${builtZip} into ${reposource}" />
		<unzip dest="${reposource}" src="${builtZip}" />
	</target>

	<target name="extractLauncher">
		<delete dir="${tempexec}" />
		<mkdir dir="${tempexec}" />

		<copy todir="${tempexec}">
			<fileset dir="${reposource}">
				<include name="features/org.eclipse.equinox.executable_*.jar" />
			</fileset>
		</copy>
		<unzip dest="${tempexec}">
			<fileset dir="${tempexec}/features">
				<include name="*.jar" />
			</fileset>
		</unzip>
	</target>

	<target name="publishLauncher">
		<!-- Do we need a full path for ${reposource}?
		<property name="buildDirectoryAbsoluteTemp" value="${buildDirectory}/absolutetemp.txt" />
		<echo message="${reposource}" file="${buildDirectoryAbsoluteTemp}" />
		<replaceregexp file="${buildDirectoryAbsoluteTemp}" match="org.eclipse.releng.eclipsebuilder/../src/" replace="src/" />
		<loadfile property="buildDirectoryAbsolute" srcFile="${buildDirectoryAbsoluteTemp}" failonerror="false" />
		<delete file="${buildDirectoryAbsoluteTemp}" />
		-->

		<!-- This next part merges metadata for the launcher binary into the rest of the metadata -->
		<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${basedir}" failonerror="true">
			<classpath>
				<pathelement path="bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
			</classpath>
			<arg line="-configuration configuration " />
			<arg line="-application org.eclipse.ant.core.antRunner " />
			<arg line="-buildfile ${tempexec}/build.xml" />
			<arg line="-propertyfile ${basedir}/build.properties " />
			<arg line="-Dbuilder=${buildConfig} " />
			<arg line="-DbuildDirectory=${buildDirectory} " />
			<arg line="-Dp2.gathering=true " />
			<arg line="-Dp2.build.repo=file:/${reposource} " />
			<arg line="-consolelog " />
			<arg line="publish.bin.parts " />
			<jvmarg value="-Xmx512M" />
		</java>
	</target>

	<target name="createAndPublishLauncherFeature">
		<!--
			<jvmarg value="-Xdebug"/>
			<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=40000"/>

			<jvmarg value="-Xdebug"/>
			<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=40001"/>
		-->

		<!-- This next part creates and publishs a feature including the binary launcher -->
		<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${productFiles}/rcpConfig" failonerror="true">
			<classpath>
				<pathelement path="bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
			</classpath>
			<arg line="-configuration configuration " />
			<arg line="-application org.eclipse.ant.core.antRunner " />
			<arg line="-buildfile buildConfiguration.xml" />
			<arg line="-propertyfile ${basedir}/build.properties " />
			<arg line="-Dconfigs=linux,gtk,${buildArch} " />
			<arg line="-Dreposource=${reposource} " />
			<arg line="-Dbasedir=${productFiles}/rcpConfig" />
			<arg line="-DbuildId=${buildId} " />
			<arg line="-DbaseBuildPath=${buildDirectory} " />
			<arg line="-DbaseLocation=${buildDirectory} " />
			<arg line="-Declipse.pdebuild.scripts=${eclipse.pdebuild.scripts} " />
			<arg line="-consolelog " />
			<jvmarg value="-Xmx512M" />
		</java>

		<!--
		<ant target="main" antfile="buildConfiguration.xml" dir="${productFiles}/rcpConfig" />
		-->
	</target>

	<target name="publishPlatform">
		<antcall target="publishProduct">
			<param name="productFile" value="${productFiles}/platform/platform.product" />
		</antcall>
	</target>

	<target name="publishSDK">
		<antcall target="publishProduct">
			<param name="productFile" value="${productFiles}/sdk/sdk.product" />
		</antcall>
	</target>

	<target name="publishProduct">
		<!-- http://wiki.eclipse.org/Equinox/p2/Publisher -->
		<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${basedir}" failonerror="true">
			<classpath>
				<pathelement path="${launcher}" />
			</classpath>
			<arg line="-configuration configuration " />
			<arg line="-application org.eclipse.ant.core.antRunner " />
			<arg line="-buildfile publishProduct.xml" />
			<arg line="-propertyfile ${basedir}/build.properties " />
			<arg line="-DbuildArch=${buildArch} " />
			<arg line="-Dreposource=${reposource} " />
			<arg line="-DbuildConfig=${buildConfig} " />
			<arg line="-DproductFile=${productFile} " />
			<arg line="-DbuildDirectory=${buildDirectory} " />
			<arg line="-consolelog " />
			<jvmarg value="-Xmx512M" />
		</java>
		<!-- The following (using the app. instead of the ant task) doesn't work
		     as of 2010-08-11 -->
		<!--
		<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${basedir}" failonerror="true">
			<classpath>
				<pathelement path="bootstrap/plugins/org.eclipse.equinox.launcher.jar" />
			</classpath>
			<arg line="-configuration configuration " />
		                 <arg line="-consoleLog" />
			<arg line="-application org.eclipse.equinox.p2.publisher.ProductPublisher " />
		                 <arg line="-flavor tooling" />
		                 <arg line="-configs gtk.linux.${buildArch}" />
		                 <arg line="-productFile ${productFile}" />
		                 <arg line="-metadataRepository file:${reposource}" />
		                 <arg line="-artifactRepository file:${reposource}" />
		                 <arg line="-compress" />
			<arg line="-featureVersions ${buildDirectory}/finalFeaturesVersions.properties" />
		                 <arg line="-pluginVersions ${buildDirectory}/finalPluginsVersions.properties" />
		</java>
		-->
	</target>

	<target name="provision.platform" depends="p2prep" unless="provision.platform.complete">
		<echo message="Installing into:  ${provisionDir}" />
		<antcall target="provision">
			<param name="p2.director.installIU" value="org.eclipse.platform.ide" />
			<param name="profileName" value="PlatformProfile" />
		</antcall>

		<!-- Re-symlink system JARs -->
		<symlinkInstalledOSGiJars dependencies="${basedir}/dependencies/dependencies.properties" topLevelDir="${provisionDir}/plugins" />
		<symlinkNonOSGiJars dependencies="${basedir}/dependencies/nonosgidependencies.properties" topLevelDir="${provisionDir}/plugins" />
		<echo file="provision.platform-stamp" />
	</target>

	<!-- This is here as a convenience task for distributions which want
	     CVS functionality to be present in "platform" installations. -->
	<target name="provision.cvs" depends="p2prep" unless="provision.cvs.complete">
		<echo message="Installing into:  ${provisionDir}" />
		<antcall target="provision">
			<param name="p2.director.installIU" value="org.eclipse.platform.ide,org.eclipse.cvs.feature.group,org.eclipse.equinox.initializer" />
			<param name="profileName" value="PlatformProfile" />
		</antcall>

		<!-- Re-symlink system JARs -->
		<symlinkInstalledOSGiJars dependencies="${basedir}/dependencies/dependencies.properties" topLevelDir="${provisionDir}/plugins" />
		<symlinkNonOSGiJars dependencies="${basedir}/dependencies/nonosgidependencies.properties" topLevelDir="${provisionDir}/plugins" />
		<echo file="provision.cvs-stamp" />
	</target>

	<target name="provision" depends="p2prep">
		<echo message="Installing into:  ${provisionDir}" />
		<antcall target="run.director">
			<param name="p2.director.installIU" value="${p2.director.installIU}" />
			<param name="p2.director.version" value="${p2.director.version}" />
			<param name="p2.director.profile" value="${profileName}" />
			<param name="p2.director.install.path" value="${provisionDir}" />
			<param name="p2.director.extraArgs" value="-profileProperties org.eclipse.update.install.features=true" />
			<param name="p2.os" value="linux" />
			<param name="p2.ws" value="gtk" />
			<param name="p2.arch" value="${buildArch}" />
			<param name="p2.repo" value="${reposource}" />
		</antcall>
	</target>

	<target name="provision.installed" depends="p2prep">
		<echo message="Installing into:  ${provisionDir}" />
		<property name="directorToRun" value="${provisionDir}/eclipse" />
		<antcall target="run.installed.director">
			<param name="p2.director.installIU" value="${p2.director.installIU}" />
			<param name="p2.director.version" value="${p2.director.version}" />
			<param name="p2.director.profile" value="${profileName}" />
			<param name="p2.director.install.path" value="${provisionDir}" />
			<param name="p2.director.extraArgs" value="-profileProperties org.eclipse.update.install.features=true" />
			<param name="p2.os" value="linux" />
			<param name="p2.ws" value="gtk" />
			<param name="p2.arch" value="${buildArch}" />
			<param name="p2.repo" value="${reposource}" />
		</antcall>
	</target>

	<target name="run.director">
		<property name="baseBuilderConfig" value="${baseBuilder}/p2" />
		<!-- FIXME:  When we move to bootstrap by default, investigate using <exec> on the bootstrapped launcher
		     like in eclipsebuilder's equinox.prov/run.xml -->
		<java classname="org.eclipse.equinox.launcher.Main" fork="true" dir="${baseBuilder}" failonerror="true">
			<classpath>
				<pathelement location="${launcher}" />
			</classpath>
			<arg line="-data ${buildworkspace} " />
			<arg line="-application org.eclipse.equinox.p2.director " />
			<arg line="-consoleLog" />
			<!--<arg line="-help" />-->
			<arg line="-flavor ${p2.flavor}" />
			<arg line="-installIU ${p2.director.installIU}" />
			<arg line="-p2.os ${p2.os}" />
			<arg line="-p2.ws ${p2.ws}" />
			<arg line="-p2.arch ${p2.arch}" />
			<arg line="-roaming" />
			<arg line="-profile ${p2.director.profile}" />
			<arg line="${p2.director.extraArgs}" />
			<arg line="-metadatarepository file:${p2.repo}" />
			<arg line="-artifactrepository file:${p2.repo}" />
			<arg line="-destination ${p2.director.install.path}" />
			<arg line="-bundlepool ${p2.director.install.path}" />
			<arg line="-vmargs" />
			<arg line="-Declipse.p2.data.area=${p2.director.install.path}/p2" />
			<arg line="-Declipse.p2.MD5Check=false" />
			<arg line="-Declipse.p2.profile=@none" />
			<arg line="-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=" />
			<arg line="-propertyfile ${basedir}/build.properties " />
			<!--
			<jvmarg value="-Xms512M" />
			<jvmarg value="-Xmx2048M" />
			<jvmarg value="-XX:MaxPermSize=512M" />
			-->
			<jvmarg value="-Declipse.p2.data.area=${p2.director.install.path}/p2" />
			<jvmarg value="-Xmx512M" />
		</java>
	</target>

	<target name="run.installed.director">
		<chmod perm="ugo+rx" file="${directorToRun}" />
		<exec executable="${directorToRun}" failonerror="true">
			<arg line="-nosplash " />
			<arg line="-consoleLog" />
			<arg line="-data ${buildworkspace} " />
			<arg line="-application org.eclipse.equinox.p2.director " />
			<arg line="-flavor ${p2.flavor}" />
			<arg line="-installIU ${p2.director.installIU}" />
			<arg line="-profile ${p2.director.profile}" />
			<arg line="-destination ${p2.director.install.path}" />
			<arg line="-p2.os ${p2.os}" />
			<arg line="-p2.ws ${p2.ws}" />
			<arg line="-p2.arch ${p2.arch}" />
			<arg line="${p2.director.extraArgs}" />
			<arg line="-metadatarepository file:${p2.repo}" />
			<arg line="-artifactrepository file:${p2.repo}" />
		</exec>
	</target>

	<target name="run.installed.director.uninstall">
                <chmod perm="ugo+rx" file="${directorToRun}" />
                <exec executable="${directorToRun}" failonerror="true">
                        <arg line="-nosplash " />
                        <arg line="-consoleLog" />
                        <arg line="-data ${buildworkspace} " />
                        <arg line="-application org.eclipse.equinox.p2.director " />
                        <arg line="-flavor ${p2.flavor}" />
                        <arg line="-uninstallIU ${p2.director.uninstallIU}" />
                        <arg line="-profile ${p2.director.profile}" />
                       	<arg line="-destination ${p2.director.install.path}" />
                        <arg line="-p2.os ${p2.os}" />
                        <arg line="-p2.ws ${p2.ws}" />
                        <arg line="-p2.arch ${p2.arch}" />
                        <arg line="-metadatarepository file:${p2.repo}" />
                        <arg line="-artifactrepository file:${p2.repo}" />
                        <arg line="${p2.director.extraArgs}" />
                </exec>
        </target>

	<target name="installSDKinDropins" depends="provisionSDKinDropins">
		<antcall target="installIntoDestDir">
			<param name="profile" value="PlatformProfile" />
		</antcall>
	</target>

	<target name="extractSos" unless="dontExtractSos">
	  <java classname="org.eclipse.core.launcher.Main" fork="true" failonerror="true" dir="${destDir}">
	    <classpath>
	      <fileset dir="${installationDir}/plugins">
		<include name="org.eclipse.equinox.launcher_*.jar" />
	      </fileset>
	    </classpath>
	    <arg value="-application" />
	    <arg value="org.eclipse.equinox.initializer.configInitializer" />
	    <arg value="-debug" />
	    <arg value="-consolelog" />
	    <arg value="-metadataRepository" />
	    <arg value="file:${installationDir}/metadata/" />
	    <arg value="-artifactRepository" />
	    <arg value="file:${installationDir}/metadata/" />
	    <arg value="-data" />
	    <arg value="${buildworkspace}" />
	    <arg value="-fileInitializer" />
	    <arg value="${basedir}/extract_patterns.txt" />
	    <jvmarg value="-Dosgi.sharedConfiguration.area=${installationDir}/configuration" />
	  </java>
	</target>

	<target name="installIntoDestDir">
		<mkdir dir="${installationDir}" />
                <exec executable="rsync" failonerror="true">
                       <arg value="-vrpl" />
                       <arg value="--exclude=dropins" />
                       <arg value="${provisionDir}/" />
                       <arg value="${installationDir}/" />
                </exec>

		<!-- install desktop file -->
		<copy file="eclipse.desktop" todir="${destDir}${prefix}/share/applications" />
		<!-- install Eclipse Java code formatter launcher -->
		<property name="efj" value="${destDir}${prefix}/bin/efj"/>
		<copy file="efj.sh" tofile="${efj}" />
	    <fileset id="equinoxLauncher" dir="${installationDir}/plugins">
	      <include name="org.eclipse.equinox.launcher_*.jar" />
	    </fileset>
	    <property name="launcherJar" refid="equinoxLauncher"/>
		<replace file="${efj}" token="@LAUNCHER@" value="${prefix}/${libDir}/eclipse/plugins/${launcherJar}"/>
		<!-- install icons -->
		<copy file="${buildDirectory}/plugins/org.eclipse.platform/eclipse16.png" tofile="${destDir}${prefix}/share/icons/hicolor/16x16/apps/eclipse.png" />
		<copy file="${buildDirectory}/plugins/org.eclipse.platform/eclipse32.png" tofile="${destDir}${prefix}/share/icons/hicolor/32x32/apps/eclipse.png" />
		<copy file="${buildDirectory}/plugins/org.eclipse.platform/eclipse48.png" tofile="${destDir}${prefix}/share/icons/hicolor/48x48/apps/eclipse.png" />
		<copy file="${buildDirectory}/plugins/org.eclipse.platform/eclipse256.png" tofile="${destDir}${prefix}/share/icons/hicolor/256x256/apps/eclipse.png" />
		<mkdir dir="${destDir}${prefix}/share/pixmaps" />
		<symlink link="${destDir}${prefix}/share/pixmaps/eclipse.png" resource="../icons/hicolor/48x48/apps/eclipse.png" overwrite="true"/>
		<!--shared dropins folder for architecture-independent plugins-->
		<mkdir dir="${destDir}${prefix}/share/eclipse/dropins" />
		<!-- eclipse binary -->
		<mkdir dir="${destDir}${prefix}/bin" />
		<symlink link="${destDir}${prefix}/bin/eclipse" resource="../${libDir}/eclipse/eclipse" overwrite="true"/>
		<!-- eclipse manpage -->
		<exec executable="docbook2x-man" failonerror="true">
			<arg value="eclipse.1.xml" />
		</exec>
		<move file="eclipse.1" tofile="${destDir}${prefix}/share/man/man1/eclipse.1" />
		<!-- Create the "swt.jar" and friends symlinks  -->
		<fileset dir="${installationDir}/plugins" includes="org.eclipse.swt.gtk.linux.${buildArch}_*" id="swtjar" />
		<property name="swtjarpath" refid="swtjar" />
		<symlink link="${installationDir}/swt-gtk-${label}.jar" resource="plugins/${swtjarpath}" overwrite="true"/>
		<symlink link="${installationDir}/swt-gtk.jar" resource="plugins/${swtjarpath}" overwrite="true"/>
		<symlink link="${installationDir}/swt.jar" resource="plugins/${swtjarpath}" overwrite="true"/>

		<echo append="true" file="${installationDir}/eclipse.ini" message="-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=${prefix}/share/eclipse/dropins" />

		<!-- Extract SWT JNI .so files -->
		<antcall target="extractSos">
		</antcall>

		<!-- remove the initializer -->
		<property name="directorToRun" value="${installationDir}/eclipse" />
                <antcall target="run.installed.director.uninstall">
                        <param name="p2.director.uninstallIU" value="org.eclipse.equinox.initializer" />
                        <param name="p2.director.profile" value="PlatformProfile" />
                        <param name="p2.director.install.path" value="${installationDir}" />
                        <param name="p2.director.extraArgs" value="-purgeHistory -vmargs -Dosgi.sharedConfiguration.area=${installationDir}/configuration" />
			<param name="p2.os" value="linux" />
                        <param name="p2.ws" value="gtk" />
                        <param name="p2.arch" value="${buildArch}" />
                        <param name="p2.repo" value="${installationDir}" />
                </antcall>

		<!-- copy PDE and JDT to dropins -->
                <exec executable="rsync" failonerror="true">
                       <arg value="-vrpl" />
                       <arg value="${provisionDir}/dropins/" />
                       <arg value="${installationDir}/dropins/" />
                </exec>

		<!-- Remove unnecessary configuration data -->
		<delete dir="${installationDir}/configuration/org.eclipse.core.runtime" />
		<delete dir="${installationDir}/configuration/org.eclipse.equinox.app" />
		<delete includeemptydirs="true" verbose="true">
			<fileset dir="${installationDir}/configuration" includes="*.log" />
			<fileset dir="${installationDir}/configuration" includes="**/data/**" />
			<fileset dir="${installationDir}/configuration" includes="org.eclipse.update/**" />
		</delete>
		
		<!-- Fix paths in p2 data -->
		<delete includeemptydirs="true" failonerror="false">
			<fileset dir="${installationDir}/p2/org.eclipse.equinox.p2.core" includes="cache/**" />
		</delete>

		<property name="profileDir" value="p2/org.eclipse.equinox.p2.engine/profileRegistry/${profile}.profile" />
		
		<!-- Strip some build artifacts from installation -->
		<exec executable="sed" inputstring="${destDir}" outputproperty="destDirWithUnderscores" failonerror="true">
			<arg value="s@/@_@g" />
		</exec>

		<exec executable="sed" inputstring="${reposource}" outputproperty="reposourceWithUnderscores" failonerror="true">
			<arg value="s@/@_@g" />
		</exec>
		<exec executable="sed" inputstring="${provisionDir}" outputproperty="provisionDirWithUnderscores" failonerror="true">
			<arg value="s@/@_@g" />
		</exec>
		<apply executable="sed" failonerror="true" verbose="true">
			<arg value="-i" />
			<arg value="\@${destDir}@d;\@${destDirWithUnderscores}@d;\@${reposourceWithUnderscores}@d;\@${provisionDirWithUnderscores}@d" />
			<srcfile />
			<fileset dir="${installationDir}">
				<include name="metadata/content.xml" />
				<include name="p2/org.eclipse.equinox.p2.engine/.settings/org.eclipse.equinox.p2.metadata.repository.prefs" />
				<include name="p2/org.eclipse.equinox.p2.engine/.settings/org.eclipse.equinox.p2.artifact.repository.prefs" />
				<include name="${profileDir}/.data/.settings/org.eclipse.equinox.p2.metadata.repository.prefs" />
				<include name="${profileDir}/.data/.settings/org.eclipse.equinox.p2.artifact.repository.prefs" />
				<include name="eclipse.ini" />
			</fileset>
		</apply>

		<!-- Clean up profile files -->
		<echo message="${provisionDir}"/>
		<apply executable="gunzip" failonerror="true" verbose="true">
			<srcfile />
			<fileset dir="${installationDir}/${profileDir}">
				<include name="*.gz" />
			</fileset>
		</apply>
		<apply executable="sed" failonerror="true" verbose="true">
			<arg value="-i" />
			<arg value="s@${provisionDir}@${installationDir}@g;s@${installationDir}@${prefix}/${libDir}/eclipse@g" />
			<srcfile />
			<fileset dir="${installationDir}/${profileDir}">
				<include name="*.profile" />
			</fileset>
		</apply>
		<apply executable="gzip" failonerror="true" verbose="true">
			<srcfile />
			<fileset dir="${installationDir}/${profileDir}">
				<include name="*.profile" />
			</fileset>
		</apply>
		
		<!-- Remove unnecessary metadata -->
		<delete dir="${destDir}/${prefix}/${libDir}/eclipse/metadata/binary" />
		<delete dir="${destDir}/${prefix}/${libDir}/eclipse/metadata/features" />
		<delete dir="${destDir}/${prefix}/${libDir}/eclipse/metadata/plugins" />
		<!-- Strip ${destDir} from path -->
		<exec executable="sed" inputstring="${destDir}" outputproperty="destDirWithUnderscores" failonerror="true">
			<arg value="s@/@_@g" />
		</exec>
		<apply executable="sed" failonerror="true" verbose="true">
			<arg value="-i" />
			<arg value="s@${destDir}@@g;s@${destDirWithUnderscores}@@g" />
			<srcfile />
			<fileset dir="${destDir}/${prefix}/${libDir}/eclipse">
				<include name="metadata/content.xml" />
				<include name="p2/org.eclipse.equinox.p2.engine/.settings/org.eclipse.equinox.p2.metadata.repository.prefs" />
				<include name="p2/org.eclipse.equinox.p2.engine/.settings/org.eclipse.equinox.p2.artifact.repository.prefs" />
				<include name="eclipse.ini" />
			</fileset>
		</apply>
		<!-- Move config file to /etc -->
		<mkdir dir="${destDir}/etc" />
		<move file="${installationDir}/eclipse.ini" tofile="${destDir}/etc/eclipse.ini" />
		<symlink link="${installationDir}/eclipse.ini" resource="/etc/eclipse.ini" overwrite="true"/>

	</target>

	<target name="provisionSDKinDropins" depends="provision.cvs" unless="provisionSDKinDropins.complete" >
		<property name="platformAndCVSInstallation" value="${provisionDir}.cvs"/>
		
		<property name="jdtDropinsName" value="jdt"/>
		<property name="sdkDropinsName" value="sdk"/>

		<property name="jdtDropinsDir" value="${provisionDir}/dropins/${jdtDropinsName}"/>
		<property name="sdkDropinsDir" value="${provisionDir}/dropins/${sdkDropinsName}"/>

		<!-- make a copy of the clean platform+CVS installation -->
		<exec executable="cp" failonerror="true">
			<arg value="-rd" />
			<arg value="--no-target-directory" />
			<arg value="${provisionDir}" />
			<arg value="${platformAndCVSInstallation}" />
		</exec>

		<!-- Install JDT -->
		<property name="jdtInstallation" value="${provisionDir}.jdt"/>
		<antcall target="provision.installed">
			<param name="p2.director.installIU" value="org.eclipse.jdt.feature.group" />
			<param name="profileName" value="PlatformProfile" />
		</antcall>
		<!-- rename the JDT installation -->
		<move file="${provisionDir}"
			tofile="${jdtInstallation}"/>
		<!-- make a second copy of the clean JDT installation -->
		<exec executable="cp" failonerror="true">
			<arg value="-rd" />
			<arg value="--no-target-directory" />
			<arg value="${jdtInstallation}" />
			<arg value="${jdtInstallation}.orig" />
		</exec>
		
		<!-- restore clean platform+CVS installation -->
		<exec executable="cp" failonerror="true">
			<arg value="-rd" />
			<arg value="--no-target-directory" />
			<arg value="${platformAndCVSInstallation}" />
			<arg value="${provisionDir}" />
		</exec>
		
		<!-- Install SDK -->
		<property name="sdkInstallation" value="${provisionDir}.sdk"/>
		<antcall target="provision.installed">
			<param name="p2.director.installIU" value="org.eclipse.sdk.feature.group,org.eclipse.license.feature.group" />
			<param name="profileName" value="PlatformProfile" />
		</antcall>
		<!-- rename the entire SDK installation -->
		<move file="${provisionDir}"
			tofile="${sdkInstallation}"/>
		
		<!-- restore clean platform+CVS installation -->
		<exec executable="cp" failonerror="true">
			<arg value="-rd" />
			<arg value="--no-target-directory" />
			<arg value="${platformAndCVSInstallation}" />
			<arg value="${provisionDir}" />
		</exec>
		
		<!-- diff of platform+CVS and JDT goes into platform+CVS/dropins/jdt -->
		<antcall target="moveNewStuffToDropins">
			<param name="orig" value="${provisionDir}" />
			<param name="new" value="${jdtInstallation}" />
			<param name="dropinsDir" value="${jdtDropinsName}" />
		</antcall>
		
		<!-- restore clean JDT installation for comparison -->
		<delete dir="${jdtInstallation}" />
		<move file="${jdtInstallation}.orig"
			tofile="${jdtInstallation}"/>
		
		<!-- diff of JDT and SDK ... -->
		<antcall target="moveNewStuffToDropins">
			<param name="orig" value="${jdtInstallation}" />
			<param name="new" value="${sdkInstallation}" />
			<param name="dropinsDir" value="${sdkDropinsName}" />
		</antcall>
		<!-- ... goes into platform+CVS/dropins/pde -->
		<move file="${jdtInstallation}/dropins/${sdkDropinsName}"
			todir="${provisionDir}/dropins"/>
		
		<!-- Re-symlink system JARs -->
		<fileset id="junit4.jar" dir="${jdtDropinsDir}/plugins">
			<include name="**/org.junit4_**/junit.jar" />
		</fileset>
		<property name="junit4jar.path" refid="junit4.jar" />

		<delete file="${jdtDropinsDir}/plugins/${junit4jar.path}" />
		<symlink link="${jdtDropinsDir}/plugins/${junit4jar.path}" resource="${junit4JarLocation}" />

		<symlinkInstalledOSGiJars dependencies="${basedir}/dependencies/dependencies.properties" topLevelDir="${provisionDir}/plugins" />
		<symlinkNonOSGiJars dependencies="${basedir}/dependencies/nonosgidependencies.properties" topLevelDir="${provisionDir}/plugins" />
		
		<symlinkInstalledOSGiJars dependencies="${basedir}/dependencies/jdtdependencies.properties" topLevelDir="${jdtDropinsDir}/plugins" />
		<symlinkNonOSGiJars dependencies="${basedir}/dependencies/jdtnonosgidependencies.properties" topLevelDir="${jdtDropinsDir}/plugins" />
		
		<symlinkInstalledOSGiJars dependencies="${basedir}/dependencies/sdkdependencies.properties" topLevelDir="${sdkDropinsDir}/plugins" />
		
		<delete dir="${platformAndCVSInstallation}" />
		<delete dir="${jdtInstallation}" />
		<delete dir="${sdkInstallation}" />

		<echo file="provisionSDKinDropins-stamp" />
	</target>

	<target name="moveNewStuffToDropins">
		<property name="dropinsDirectory" value="${orig}/dropins/${dropinsDir}" />		
                <move todir="${dropinsDirectory}/features" includeemptydirs="true">
                        <fileset dir="${new}/features" id="newFeatures.fileset">
                                <present present="srconly" targetdir="${orig}/features"/>
                        </fileset>
                </move>
		<move todir="${dropinsDirectory}/plugins" includeemptydirs="true">
			<fileset dir="${new}/plugins" id="newPlugins.fileset">
				<present present="srconly" targetdir="${orig}/plugins"/>
			</fileset>
		</move>
	</target>

	<target name="package.extract.swt">
		<exec executable="./swt_bundle.sh" failOnError="true">
			<arg value="${eclipse.rcp.package.root}" />
			<arg value="${eclipse.swt.package.root}" />
			<arg value="${prefix}" />
			<arg value="${libdir}" />
		</exec>
	</target>

</project>