forked from Kotlin/anko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_dependencies_idea.xml
916 lines (747 loc) · 44 KB
/
update_dependencies_idea.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
<project name="Update Dependencies" default="update" xmlns:if="ant:if" xmlns:unless="ant:unless">
<property name="automerge_dummy" value="This property is used to trick git merge. Do not delete empty lines around."/>
<property name="ideaVersion" value="2017.1"/>
<property name="idea.kotlin.branch" value="rc"/>
<property name="android.studio.intellij-core.build.number" value="171.3780.107"/>
<property name="android.version" value="3.0.1.0"/>
<property name="android.build.version" value="171.4443003"/>
<property name="markdown.locator" value="buildType:IntelliJMarkdownParser_Build,status:SUCCESS,tag:forKotlin"/>
<property name="bootstrap.build.no.tests" value="false"/>
<!--<property name="use.ultimate.by.default" value="true"/>-->
<property name="sdk.version.prefix" value="IU" if:set="use.ultimate.by.default"/>
<property name="sdk.version.prefix" value="IC" unless:set="use.ultimate.by.default"/>
<!-- Uncomment to enable force version increment in branch. Set override.version.disabled to temporary disable feature without commits -->
<!--
<property name="override.version.url" value="https://teamcity.jetbrains.com/guestAuth/app/rest/builds/?locator=buildType:bt345,count:1${kotlin.bootstrap.branch.locator}"/>
-->
<!--<property name="override.version.disabled" value="true"/>-->
<condition property="isWindows">
<os family="windows"/>
</condition>
<condition property="isMac">
<os family="mac"/>
</condition>
<condition property="isLinux">
<and>
<os family="unix"/>
<not>
<os family="mac"/>
</not>
</and>
</condition>
<condition property="kotlinc.executable.path" value="kotlinc.bat" else="kotlinc">
<os family="windows"/>
</condition>
<property name="idea.dir" value="ideaSDK"/>
<property name="idea.sdk.fetch.needed" value="true"/>
<property name="dependencies.info.file" value="dependencies/dependencies.properties"/>
<property name="gradle.libs.repo" value="http://repo.gradle.org/gradle/libs-releases-local"/>
<property name="native-platform-lib-version" value="0.10"/>
<property file="${dependencies.info.file}" prefix="dependencies.info.prev"/>
<target name="update" depends="fetch-third-party,fetch-annotations,get_android_studio" description="Update dependencies"/>
<!--<target name="update_teamcity" depends="fetch-third-party,fetch-annotations">-->
<!--<execute_update_with_idea_teamcity_artifacts-->
<!--teamcity.server.url="https://teamcity.jetbrains.com"-->
<!--build.locator.request="buildType:bt410,status:SUCCESS,branch:idea/${ideaVersion}-${idea.kotlin.branch}"/>-->
<!--</target>-->
<target name="jb_update" depends="fetch-third-party,fetch-annotations" description="Update dependencies for JB local network">
<execute_update_with_idea_maven_artifacts
base.url="http://jetbrains-com-mirror.labs.intellij.net/intellij-repository/releases/com/jetbrains/intellij/idea"
idea.maven.version="${ideaVersion}"/>
</target>
<target name="update_continuous_br141" depends="fetch-third-party,fetch-annotations">
<execute_update_with_idea_maven_artifacts
base.url="https://www.jetbrains.com/intellij-repository/snapshots/com/jetbrains/intellij/idea"
idea.maven.version="141-SNAPSHOT"/>
</target>
<target name="update_continuous_br143" depends="fetch-third-party,fetch-annotations">
<execute_update_with_idea_maven_artifacts
base.url="https://www.jetbrains.com/intellij-repository/snapshots/com/jetbrains/intellij/idea"
idea.maven.version="143-SNAPSHOT"/>
</target>
<target name="update_continuous_br144" depends="fetch-third-party,fetch-annotations">
<execute_update_with_idea_maven_artifacts
base.url="https://www.jetbrains.com/intellij-repository/snapshots/com/jetbrains/intellij/idea"
idea.maven.version="144-SNAPSHOT"/>
</target>
<macrodef name="get-maven-library">
<attribute name="prefix"/>
<attribute name="lib"/>
<attribute name="version"/>
<attribute name="bin" default="true"/>
<attribute name="src" default="true"/>
<attribute name="server" default="http://repository.jetbrains.com/remote-repos"/>
<attribute name="jar.name.base" default="@{lib}-@{version}"/>
<attribute name="target.jar.name.base" default="@{jar.name.base}"/>
<attribute name="path" default="@{prefix}/@{lib}/@{version}/@{jar.name.base}"/>
<attribute name="download" default="dependencies/download"/>
<attribute name="dependencies" default="dependencies"/>
<sequential>
<sequential if:true="@{bin}">
<get src="@{server}/@{path}.jar" dest="@{download}/@{jar.name.base}.jar" usetimestamp="true"/>
<copy file="@{download}/@{jar.name.base}.jar" tofile="@{dependencies}/@{target.jar.name.base}.jar" overwrite="true"/>
</sequential>
<sequential if:true="@{src}">
<get src="@{server}/@{path}-sources.jar" dest="@{download}/@{jar.name.base}-sources.jar" usetimestamp="true"/>
<copy file="@{download}/@{jar.name.base}-sources.jar" tofile="@{dependencies}/@{target.jar.name.base}-sources.jar"
overwrite="true"/>
</sequential>
</sequential>
</macrodef>
<macrodef name="get-ant-library">
<attribute name="version"/>
<attribute name="folderName"/>
<sequential>
<!-- todo: temporary hack for unavailable archive.apache.org -->
<get src="https://bintray.com/artifact/download/kotlin/AntForKotlin/apache-ant-@{version}-bin.tar.gz"
dest="dependencies/download/apache-ant-@{version}-bin.tar.gz" usetimestamp="true"/>
<get src="https://bintray.com/artifact/download/kotlin/AntForKotlin/apache-ant-@{version}-src.zip"
dest="dependencies/apache-ant-@{version}-src.zip" usetimestamp="true"/>
<delete dir="dependencies/@{folderName}" failonerror="false"/>
<untar src="dependencies/download/apache-ant-@{version}-bin.tar.gz" dest="dependencies" compression="gzip"/>
<move file="dependencies/apache-ant-@{version}" tofile="dependencies/@{folderName}"/>
</sequential>
</macrodef>
<target name="make-native-platform-uberjar">
<property name="dependencies" value="dependencies"/>
<property name="download" value="${dependencies}/download"/>
<property name="server" value="${gradle.libs.repo}"/>
<property name="version" value="${native-platform-lib-version}"/>
<property name="common.name" value="native-platform"/>
<property name="common.prefix" value="${server}/net/rubygrapefruit/${common.name}"/>
<macrodef name="get-lib">
<attribute name="suffix"/>
<sequential>
<get src="${common.prefix}@{suffix}/${version}/${common.name}@{suffix}-${version}.jar" dest="${download}/${common.name}@{suffix}.jar" usetimestamp="true"/>
</sequential>
</macrodef>
<mkdir dir="${dependencies}"/>
<mkdir dir="${download}"/>
<get-lib suffix=""/>
<get-lib suffix="-windows-amd64"/>
<get-lib suffix="-windows-i386"/>
<get-lib suffix="-osx-amd64"/>
<get-lib suffix="-osx-i386"/>
<get-lib suffix="-linux-amd64"/>
<get-lib suffix="-linux-i386"/>
<get-lib suffix="-freebsd-amd64"/>
<get-lib suffix="-freebsd-i386"/>
<jar destfile="${dependencies}/${common.name}-uberjar.jar">
<zipfileset src="${download}/${common.name}.jar" includes="**" />
<zipfileset src="${download}/${common.name}-windows-amd64.jar" includes="**" />
<zipfileset src="${download}/${common.name}-windows-i386.jar" includes="**" />
<zipfileset src="${download}/${common.name}-osx-amd64.jar" includes="**" />
<zipfileset src="${download}/${common.name}-osx-i386.jar" includes="**" />
<zipfileset src="${download}/${common.name}-linux-amd64.jar" includes="**" />
<zipfileset src="${download}/${common.name}-linux-i386.jar" includes="**" />
<zipfileset src="${download}/${common.name}-freebsd-amd64.jar" includes="**" />
<zipfileset src="${download}/${common.name}-freebsd-i386.jar" includes="**" />
</jar>
</target>
<target name="fetch-third-party" depends="make-native-platform-uberjar">
<mkdir dir="dependencies"/>
<mkdir dir="dependencies/download"/>
<!-- ProGuard -->
<get-maven-library prefix="net/sf/proguard" lib="proguard-base" version="5.1" target.jar.name.base="proguard" src="false"/>
<get-maven-library prefix="net/sf/proguard" lib="proguard-anttask" version="5.1" target.jar.name.base="proguard-anttask" src="false"/>
<!-- JarJar -->
<get src="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jarjar/jarjar-1.4.jar" dest="dependencies/download/jarjar-1.4.jar" usetimestamp="true"/>
<copy file="dependencies/download/jarjar-1.4.jar" tofile="dependencies/jarjar.jar" overwrite="true"/>
<!-- ant 1.8.2 -->
<get-ant-library version="1.8.2" folderName="ant-1.8"/>
<!-- dx.jar -->
<property name="android-build-tools.zip" value="build-tools_r21.1.1-linux.zip"/>
<get
src="https://dl-ssl.google.com/android/repository/${android-build-tools.zip}"
dest="dependencies/download/${android-build-tools.zip}"
usetimestamp="true"/>
<unzip src="dependencies/download/${android-build-tools.zip}" dest="dependencies"/>
<property name="android-sources.tgz" value="dx.tar.gz"/>
<get
src="https://android.googlesource.com/platform/dalvik/+archive/android-5.0.0_r2/${android-sources.tgz}"
dest="dependencies/download/${android-sources.tgz}"
usetimestamp="true"/>
<delete dir="dependencies/dx-src" failonerror="false"/>
<untar src="dependencies/download/${android-sources.tgz}" dest="dependencies/dx-src" compression="gzip"/>
<!-- jflex 1.4 -->
<mkdir dir="${dependencies}/jflex"/>
<get-maven-library prefix="de/jflex" lib="jflex" version="1.4.3" src="false"
target.jar.name.base="JFlex"
dependencies="${dependencies}/jflex"/>
<get src="https://raw.github.com/JetBrains/intellij-community/master/tools/lexer/idea-flex.skeleton"
dest="${dependencies}/jflex/idea-flex.skeleton" usetimestamp="true"/>
<!-- jline -->
<get-maven-library prefix="jline" lib="jline" version="2.12.1" target.jar.name.base="jline"/>
<!-- jansi -->
<get-maven-library prefix="org/fusesource/jansi" lib="jansi" version="1.11" target.jar.name.base="jansi"/>
<!-- Guava 17 sources-->
<get-maven-library prefix="com/google/guava" lib="guava" version="17.0" bin="false"/>
<!-- ASM -->
<get src="https://raw.github.com/JetBrains/intellij-community/162/lib/src/asm5-src.zip"
dest="${dependencies}/asm5-src.zip"/>
<!-- <get-asm-sources-and-rename-packages asm.version="5.0.1"/> -->
<!-- Junit Sources -->
<get-maven-library prefix="junit" lib="junit" version="4.12" bin="false"/>
<get-maven-library prefix="org/hamcrest" lib="hamcrest-core" version="1.3" bin="false"/>
<!-- Protocol Buffers -->
<get-maven-library prefix="com/google/protobuf" lib="protobuf-java" version="2.5.0" bin="false"/>
<!-- Android SDK platform -->
<ant antfile="download_android_sdk.xml" target="download_android_sdk"/>
<!-- CLI Parser -->
<get-maven-library prefix="com/github/spullara/cli-parser" lib="cli-parser" version="1.1.1"/>
<!-- Rhino -->
<get-maven-library prefix="org/mozilla" lib="rhino" version="1.7.6"/>
<!-- Closure Compiler -->
<!-- A download url taken from http://code.google.com/p/closure-compiler/wiki/BinaryDownloads -->
<get src="http://dl.google.com/closure-compiler/compiler-20131014.zip"
dest="dependencies/download/closure-compiler.zip" usetimestamp="true"/>
<delete file="dependencies/closure-compiler.jar" failonerror="false"/>
<unzip src="dependencies/download/closure-compiler.zip" dest="dependencies">
<patternset>
<include name="compiler.jar"/>
</patternset>
<mapper type="merge" to="closure-compiler.jar"/>
</unzip>
<delete file="dependencies/android.jar" failonerror="false"/>
<get src="http://dl-ssl.google.com/android/repository/android-19_r02.zip"
dest="dependencies/download/android-sdk.zip" usetimestamp="true"/>
<unzip src="dependencies/download/android-sdk.zip" dest="dependencies">
<patternset>
<include name="**/android.jar"/>
</patternset>
<mapper type="flatten"/>
</unzip>
<download-or-build-markdown-parser/>
</target>
<macrodef name="download-or-build-markdown-parser">
<sequential>
<download_teamcity_artifact
teamcity.server.url="https://teamcity.jetbrains.com"
build.locator.request="${markdown.locator}"
artifact.path="markdown_jar/markdown.jar"
dest="dependencies/markdown.jar"
usetimestamp="true"
build.number.pattern="\d+\s-\sKotlin\s[\w-+\.]+"
/>
</sequential>
</macrodef>
<macrodef name="get-asm-sources-and-rename-packages">
<attribute name="asm.version"/>
<sequential>
<!-- Download ASM sources -->
<get-maven-library prefix="org/ow2/asm" lib="asm-debug-all" version="@{asm.version}" bin="false"/>
<!-- Rename packages in the sources -->
<delete dir="dependencies/download/asm-src" failonerror="false"/>
<unzip src="dependencies/download/asm-debug-all-@{asm.version}-sources.jar" dest="dependencies/download/asm-src">
<patternset>
<include name="**/*"/>
</patternset>
</unzip>
<replaceregexp match="org\.objectweb\.asm" replace="org.jetbrains.org.objectweb.asm" flags="g">
<fileset dir="dependencies/download/asm-src/">
<include name="**/*.java"/>
</fileset>
</replaceregexp>
<move file="dependencies/download/asm-src/org/objectweb/asm"
tofile="dependencies/download/asm-src/org/jetbrains/org/objectweb/asm"/>
<zip destfile="dependencies/jetbrains-asm-all-@{asm.version}-src.zip" basedir="dependencies/download/asm-src"/>
</sequential>
</macrodef>
<macrodef name="execute_update_with_idea_maven_artifacts">
<attribute name="base.url"/>
<attribute name="idea.maven.version"/>
<sequential>
<get src="@{base.url}/BUILD/@{idea.maven.version}/BUILD-@{idea.maven.version}.txt" dest="dependencies/version.txt"/>
<loadfile property="execute.build.id" srcFile="dependencies/version.txt"/>
<condition property="idea.sdk.exists">
<available file="${idea.dir}/build.txt"/>
</condition>
<loadfile property="idea.sdk.version" srcFile="${idea.dir}/build.txt" if:set="idea.sdk.exists"/>
<condition property="edition.matched">
<equals arg1="${idea.sdk.version}" arg2="${sdk.version.prefix}-${execute.build.id}"/>
</condition>
<local name="idea.already.downloaded"/>
<condition property="idea.already.downloaded">
<and>
<equals arg1="${dependencies.info.prev.idea.build.id}" arg2="${execute.build.id}"/>
<istrue value="${edition.matched}"/>
</and>
</condition>
<echo message="IDEA build id: ${execute.build.id}. Already downloaded." if:set="idea.already.downloaded"/>
<sequential unless:set="idea.already.downloaded">
<echo message="IDEA build id: ${execute.build.id}, previous build id: ${dependencies.info.prev.idea.build.id}"/>
<delete dir="${idea.dir}" unless:set="edition.matched"/>
<download_and_update_idea idea.maven.version="@{idea.maven.version}" base.repository.url="@{base.url}"/>
<propertyfile file="${dependencies.info.file}">
<entry key="idea.build.id" value="${execute.build.id}"/>
</propertyfile>
</sequential>
</sequential>
</macrodef>
<macrodef name="execute_update_with_idea_teamcity_artifacts">
<attribute name="teamcity.server.url"/>
<attribute name="build.locator.request"/>
<sequential>
<loadresource property="execute.build.id">
<url url="@{teamcity.server.url}/guestAuth/app/rest/builds/?locator=@{build.locator.request},count:1"/>
<filterchain>
<tokenfilter>
<filetokenizer/>
<replaceregex pattern="^(.*)\sid="(\d+)"(.*)$" replace="\2" flags="s"/>
</tokenfilter>
</filterchain>
</loadresource>
<local name="idea.already.downloaded"/>
<condition property="idea.already.downloaded">
<equals arg1="${dependencies.info.prev.idea.build.id}" arg2="${execute.build.id}"/>
</condition>
<echo message="IDEA build id: ${execute.build.id}. Already downloaded." if:set="idea.already.downloaded"/>
<sequential unless:set="idea.already.downloaded">
<echo message="IDEA build id: ${execute.build.id}, previous build id: ${dependencies.info.prev.idea.build.id}"/>
<download_and_update_idea_teamcity base.url="@{teamcity.server.url}/guestAuth/app/rest/builds/id:${execute.build.id}"/>
<propertyfile file="${dependencies.info.file}">
<entry key="idea.build.id" value="${execute.build.id}"/>
</propertyfile>
</sequential>
</sequential>
</macrodef>
<macrodef name="download_teamcity_artifact">
<attribute name="teamcity.server.url"/>
<attribute name="build.locator.request"/>
<attribute name="artifact.path"/>
<attribute name="dest"/>
<attribute name="usetimestamp"/>
<attribute name="build.number.pattern" default="[\w-+\.]+"/>
<sequential>
<local name="artifact.build.id"/>
<local name="build.request.url"/>
<property name="build.request.url"
value="@{teamcity.server.url}/guestAuth/app/rest/builds/?locator=@{build.locator.request},count:1"/>
<echo message="Requested URL ${build.request.url}"/>
<loadresource property="artifact.build.id">
<url url="${build.request.url}"/>
<filterchain>
<tokenfilter>
<filetokenizer/>
<replaceregex pattern="^(.*)\sid="(\d+)"(.*)$" replace="\2" flags="s"/>
</tokenfilter>
</filterchain>
</loadresource>
<local name="processed.artifact.path"/>
<local name="artifact.build.number"/>
<loadresource property="artifact.build.number">
<url url="${build.request.url}"/>
<filterchain>
<tokenfilter>
<filetokenizer/>
<replaceregex pattern="^(.*)\snumber="(@{build.number.pattern})"(.*)$" replace="\2" flags="s"/>
</tokenfilter>
</filterchain>
</loadresource>
<loadresource property="processed.artifact.path">
<string value="@{artifact.path}"/>
<filterchain>
<replacestring from="{build.number}" to="${artifact.build.number}"/>
</filterchain>
</loadresource>
<echo message="Build Number: ${artifact.build.number} Build Id: ${artifact.build.id}"/>
<get
src="@{teamcity.server.url}/guestAuth/app/rest/builds/id:${artifact.build.id}/artifacts/content/${processed.artifact.path}"
dest="@{dest}" usetimestamp="@{usetimestamp}"/>
</sequential>
</macrodef>
<macrodef name="configure_idea_sdk_dir">
<attribute name="idea.dir"/>
<attribute name="idea.sdk.fetch.needed"/>
<attribute name="download.dir.intellij-core"/>
<attribute name="download.dir.jps-standalone"/>
<attribute name="download.file.archive.idea"/>
<attribute name="download.file.archive.sources"/>
<attribute name="download.file.archive.jps-build-test"/>
<attribute name="core" default="@{idea.dir}/core"/>
<attribute name="core-analysis" default="@{idea.dir}/core-analysis"/>
<attribute name="jps" default="@{idea.dir}/jps"/>
<attribute name="jps-test" default="@{jps}/test"/>
<attribute name="sources" default="@{idea.dir}/sources"/>
<sequential>
<sequential if:true="@{idea.sdk.fetch.needed}">
<delete dir="@{idea.dir}" failonerror="false">
<exclude name="config-idea/**"/>
<exclude name="system-idea/**"/>
</delete>
<unzip src="@{download.file.archive.idea}" dest="@{idea.dir}" />
<sequential if:set="isMac">
<!-- Java can't manipulate permissions -->
<exec executable="chmod">
<arg value="a+x"/>
<arg path="@{idea.dir}/bin/mac/fsnotifier"/>
<arg path="@{idea.dir}/bin/inspect.sh"/>
<arg path="@{idea.dir}/bin/printenv.py"/>
<arg path="@{idea.dir}/bin/restarter"/>
</exec>
</sequential>
<sequential if:set="isLinux">
<!-- Java can't manipulate permissions -->
<exec executable="chmod">
<arg value="a+x"/>
<arg path="@{idea.dir}/bin/linux/fsnotifier"/>
<arg path="@{idea.dir}/bin/linux/fsnotifier64"/>
<arg path="@{idea.dir}/bin/inspect.sh"/>
<arg path="@{idea.dir}/bin/idea.sh"/>
</exec>
</sequential>
<!--
This one needs to be deleted because otherwise it gets onto the classpath
together with junit-4.10.jar and the classloading goes crazy that breaks
many nice features of IDEA including diffs in the test console.
-->
<delete file="@{idea.dir}/lib/junit.jar"/>
<!--
Plugin depends on newer runtime and reflect jar from our bootstrap compiler.
Avoid depending on old runtime during build phase but attach original runtime when idea starts.
-->
<delete dir="@{idea.dir}/plugins/Kotlin"/>
<echo message="@{download.dir.intellij-core}/intellij-core-analysis.jar"/>
<mkdir dir="@{core-analysis}"/>
<copy file="@{download.dir.intellij-core}/intellij-core-analysis.jar"
tofile="@{core-analysis}/intellij-core-analysis.jar"
verbose="true"/>
<mkdir dir="@{core}"/>
<copy todir="@{core}" flatten="true" verbose="true">
<resources>
<file file="@{download.dir.intellij-core}/intellij-core.jar"/>
<file file="@{download.dir.intellij-core}/annotations.jar"/>
<file file="@{download.dir.intellij-core}/guava-17.0.jar"/>
<file file="@{download.dir.intellij-core}/picocontainer.jar"/>
<file file="@{download.dir.intellij-core}/trove4j.jar"/>
<file file="@{idea.dir}/lib/jdom.jar"/>
<file file="@{idea.dir}/lib/jna.jar"/>
<file file="@{idea.dir}/lib/log4j.jar"/>
<file file="@{idea.dir}/lib/xstream-1.4.8.jar"/>
<file file="@{idea.dir}/lib/xpp3-1.1.4-min.jar"/>
<file file="@{idea.dir}/lib/jsr166e.jar"/>
<file file="@{idea.dir}/lib/asm-all.jar"/>
<file file="@{idea.dir}/lib/snappy-in-java-0.3.1.jar"/>
<!-- TODO temporary workaround since util-rt is not packaged into intellij-core.jar -->
<file file="@{idea.dir}/lib/util.jar"/>
</resources>
</copy>
<mkdir dir="@{jps}"/>
<copy todir="@{jps}" flatten="true" verbose="true">
<resources>
<file file="@{download.dir.jps-standalone}/groovy-jps-plugin.jar"/>
<file file="@{download.dir.jps-standalone}/groovy_rt.jar"/>
<file file="@{download.dir.jps-standalone}/jdom.jar"/>
<file file="@{download.dir.jps-standalone}/jgoodies-forms.jar"/>
<file file="@{download.dir.jps-standalone}/jna.jar"/>
<file file="@{download.dir.jps-standalone}/jps-builders.jar"/>
<file file="@{download.dir.jps-standalone}/jps-model.jar"/>
<file file="@{download.dir.jps-standalone}/log4j.jar"/>
<file file="@{download.dir.jps-standalone}/nanoxml-2.2.3.jar"/>
<file file="@{download.dir.jps-standalone}/protobuf-2.5.0.jar"/>
<file file="@{download.dir.jps-standalone}/trove4j.jar"/>
<file file="@{download.dir.jps-standalone}/ui-designer-jps-plugin.jar"/>
<file file="@{download.dir.jps-standalone}/util.jar"/>
</resources>
</copy>
<mkdir dir="@{jps-test}"/>
<copy file="@{download.file.archive.jps-build-test}" tofile="@{jps-test}/jps-build-test.jar"/>
<mkdir dir="@{sources}"/>
<copy file="@{download.file.archive.sources}" tofile="@{sources}/sources.jar" overwrite="true"/>
</sequential>
</sequential>
</macrodef>
<macrodef name="download_and_update_idea">
<attribute name="idea.maven.version"/>
<attribute name="base.repository.url"/>
<attribute name="download.dir" default="dependencies/idea"/>
<sequential>
<delete dir="@{download.dir}"/>
<mkdir dir="@{download.dir}"/>
<!-- For running compiler tests with Java 1.6 -->
<mkdir dir="@{download.dir}/idea-for-compiler-test"/>
<local name="idea.for.compiler.testing.base.url"/>
<property name="idea.for.compiler.testing.base.url"
value="https://teamcity.jetbrains.com/guestAuth/repository/download/IntelliJIdeaCe_OpenapiJar/idea-15.0.5"/>
<get src="${idea.for.compiler.testing.base.url}/idea_rt.jar" dest="@{download.dir}/idea-for-compiler-test/idea_rt.jar" usetimestamp="true"/>
<get src="${idea.for.compiler.testing.base.url}/openapi.jar" dest="@{download.dir}/idea-for-compiler-test/openapi.jar" usetimestamp="true"/>
<property name="idea.id" value="idea${sdk.version.prefix}"/>
<get src="@{base.repository.url}/ideaIC/@{idea.maven.version}/ideaIC-@{idea.maven.version}-sources.jar"
dest="@{download.dir}/ideaIC-@{idea.maven.version}-sources.jar" usetimestamp="true"/>
<get src="@{base.repository.url}/${idea.id}/@{idea.maven.version}/${idea.id}-@{idea.maven.version}.zip"
dest="@{download.dir}/${idea.id}-@{idea.maven.version}.zip" usetimestamp="true"/>
<download_and_unzip
dir="@{download.dir}/intellij-core-@{idea.maven.version}"
url="@{base.repository.url}/intellij-core/@{idea.maven.version}/intellij-core-@{idea.maven.version}.zip"
usetimestamp="true"/>
<get src="@{base.repository.url}/jps-build-test/@{idea.maven.version}/jps-build-test-@{idea.maven.version}.jar"
dest="@{download.dir}/jps-build-test-@{idea.maven.version}.jar" usetimestamp="true"/>
<download_and_unzip
dir="@{download.dir}/jps-standalone-@{idea.maven.version}"
url="@{base.repository.url}/jps-standalone/@{idea.maven.version}/jps-standalone-@{idea.maven.version}.zip"
usetimestamp="true"/>
<configure_idea_sdk_dir
idea.dir="${idea.dir}"
idea.sdk.fetch.needed="${idea.sdk.fetch.needed}"
download.dir.intellij-core="@{download.dir}/intellij-core-@{idea.maven.version}"
download.dir.jps-standalone="@{download.dir}/jps-standalone-@{idea.maven.version}"
download.file.archive.idea="@{download.dir}/${idea.id}-@{idea.maven.version}.zip"
download.file.archive.sources="@{download.dir}/ideaIC-@{idea.maven.version}-sources.jar"
download.file.archive.jps-build-test="@{download.dir}/jps-build-test-@{idea.maven.version}.jar"/>
</sequential>
</macrodef>
<macrodef name="download_and_update_idea_teamcity">
<attribute name="base.url"/>
<sequential>
<loadresource property="idea.build.number">
<url url="@{base.url}/artifacts/children"/>
<filterchain>
<tokenfilter>
<filetokenizer/>
<replaceregex pattern="^(.*)ideaIC-([\w\.]+)\.win\.zip(.*)$" replace="\2" flags="s"/>
</tokenfilter>
</filterchain>
</loadresource>
<property name="idea.archive.name" value="ideaIC-${idea.build.number}.zip"/>
<echo message="IDEA build number: ${idea.build.number}"/>
<echo message="IDEA archive file: ${idea.archive.name}"/>
<property name="content.base.url" value="@{base.url}/artifacts/content"/>
<property name="idea.download.dir" value="dependencies/idea" />
<property name="jps.extracted.dir" value="${idea.download.dir}/standalone-jps"/>
<property name="core.dir" value="${idea.download.dir}/core"/>
<sequential if:true="${idea.sdk.fetch.needed}">
<delete dir="${idea.download.dir}"/>
<mkdir dir="${idea.download.dir}"/>
<get src="${content.base.url}/jps/standalone-jps-IC-${idea.build.number}.zip"
dest="${idea.download.dir}/standalone-jps.zip"/>
<unzip src="${idea.download.dir}/standalone-jps.zip"
dest="${jps.extracted.dir}"/>
<delete file="${idea.download.dir}/${idea.archive.name}" failonerror="false"/>
<get src="${content.base.url}/${idea.archive.name}"
dest="${idea.download.dir}/${idea.archive.name}"/>
<get src="${content.base.url}/jps/jps-build-test-IC-${idea.build.number}.jar"
dest="${idea.download.dir}/jps-build-test.jar"
usetimestamp="true"/>
<mkdir dir="${core.dir}"/>
<get src="${content.base.url}/core/intellij-core.jar" dest="${core.dir}/intellij-core.jar"/>
<get src="${content.base.url}/core/annotations.jar" dest="${core.dir}/annotations.jar"/>
<get src="${content.base.url}/core/guava-17.0.jar" dest="${core.dir}/guava-17.0.jar"/>
<get src="${content.base.url}/core/picocontainer.jar" dest="${core.dir}/picocontainer.jar"/>
<get src="${content.base.url}/core/trove4j.jar" dest="${core.dir}/trove4j.jar"/>
<get src="${content.base.url}/core/intellij-core-analysis.jar" dest="${core.dir}/intellij-core-analysis.jar"/>
<delete file="${idea.download.dir}/idea-sdk-sources.jar" failonerror="false"/>
<get src="${content.base.url}/sources.zip" dest="${idea.download.dir}/idea-sdk-sources.jar"/>
</sequential>
<configure_idea_sdk_dir
idea.dir="${idea.dir}"
idea.sdk.fetch.needed="${idea.sdk.fetch.needed}"
download.dir.intellij-core="${core.dir}"
download.dir.jps-standalone="${jps.extracted.dir}"
download.file.archive.idea="${idea.download.dir}/${idea.archive.name}"
download.file.archive.sources="${idea.download.dir}/idea-sdk-sources.jar"
download.file.archive.jps-build-test="${idea.download.dir}/jps-build-test.jar"/>
</sequential>
</macrodef>
<macrodef name="download_and_unzip">
<attribute name="url"/>
<attribute name="dir"/>
<attribute name="usetimestamp"/>
<sequential>
<get src="@{url}" dest="@{dir}.zip" usetimestamp="@{usetimestamp}"/>
<local name="need.unpack"/>
<condition property="need.unpack">
<not>
<available file="@{dir}" type="dir"/>
</not>
</condition>
<unzip src="@{dir}.zip" dest="@{dir}" if:set="need.unpack"/>
<echo message="Folder exist - so not unpacked @{dir}" unless:set="need.unpack"/>
</sequential>
</macrodef>
<!--
Currently we use empty annotations.
Future options are:
- Drop the target when will be sure that custom annotations are unneeded
- Fill the target with downloading correct annotations
-->
<target name="fetch-annotations"/>
<macrodef name="copy_intellij_core_files">
<attribute name="core" />
<attribute name="download.dir.intellij-core" />
<attribute name="idea.dir" />
<attribute name="xstream.version" default="1.4.3" />
<sequential>
<mkdir dir="@{core}"/>
<copy todir="@{core}" flatten="true" verbose="true">
<resources>
<file file="@{download.dir.intellij-core}/intellij-core.jar"/>
<file file="@{download.dir.intellij-core}/annotations.jar"/>
<file file="@{download.dir.intellij-core}/guava-19.0.jar"/>
<file file="@{download.dir.intellij-core}/picocontainer.jar"/>
<file file="@{download.dir.intellij-core}/trove4j.jar"/>
<file file="@{idea.dir}/lib/jdom.jar"/>
<file file="@{idea.dir}/lib/jna.jar"/>
<file file="@{idea.dir}/lib/log4j.jar"/>
<file file="@{idea.dir}/lib/xstream-1.4.8.jar"/>
<file file="@{idea.dir}/lib/xpp3-1.1.4-min.jar"/>
<file file="@{idea.dir}/lib/asm-all.jar"/>
<file file="@{idea.dir}/lib/snappy-in-java-0.5.1.jar"/>
<!-- TODO temporary workaround since util-rt is not packaged into intellij-core.jar -->
<file file="@{idea.dir}/lib/util.jar"/>
</resources>
</copy></sequential>
</macrodef>
<macrodef name="copy_intellij_jps_files">
<attribute name="jps" />
<attribute name="download.dir.jps-standalone" />
<sequential>
<mkdir dir="@{jps}"/>
<copy todir="@{jps}" flatten="true" verbose="true">
<resources>
<file file="@{download.dir.jps-standalone}/groovy-jps-plugin.jar"/>
<file file="@{download.dir.jps-standalone}/groovy_rt.jar"/>
<file file="@{download.dir.jps-standalone}/jdom.jar"/>
<file file="@{download.dir.jps-standalone}/jgoodies-forms.jar"/>
<file file="@{download.dir.jps-standalone}/jna.jar"/>
<file file="@{download.dir.jps-standalone}/jps-builders.jar"/>
<file file="@{download.dir.jps-standalone}/jps-builders-6.jar"/>
<file file="@{download.dir.jps-standalone}/jps-model.jar"/>
<file file="@{download.dir.jps-standalone}/log4j.jar"/>
<file file="@{download.dir.jps-standalone}/nanoxml-2.2.3.jar"/>
<file file="@{download.dir.jps-standalone}/trove4j.jar"/>
<file file="@{download.dir.jps-standalone}/ui-designer-jps-plugin.jar"/>
<file file="@{download.dir.jps-standalone}/util.jar"/>
</resources>
</copy>
</sequential>
</macrodef>
<target name="get_android_studio">
<condition property="android.os.tag" value="windows">
<os family="windows"/>
</condition>
<condition property="android.os.tag" value="mac">
<os family="mac"/>
</condition>
<condition property="strip.dirs.count" value="2">
<os family="mac"/>
</condition>
<condition property="strip.dirs.count" value="1">
<not>
<os family="mac"/>
</not>
</condition>
<condition property="android.os.tag" value="linux">
<and>
<os family="unix"/>
<not>
<os family="mac"/>
</not>
</and>
</condition>
<local name="have.android.version"/>
<condition property="have.android.version">
<and>
<isset property="android.version"/>
<isset property="android.build.version"/>
</and>
</condition>
<sequential unless:set="have.android.version">
<loadresource property="android.version">
<url url="https://developer.android.com/studio/preview/index.html"/>
<filterchain>
<tokenfilter>
<filetokenizer/>
<replaceregex
pattern="^(.*)https?://dl\.google\.com/dl/android/studio/ide-zips/([\d\.]+)/android-studio-ide(.*)$"
replace="\2" flags="s"/>
</tokenfilter>
</filterchain>
</loadresource>
<loadresource property="android.build.version">
<url url="https://developer.android.com/studio/preview/index.html"/>
<filterchain>
<tokenfilter>
<filetokenizer/>
<replaceregex
pattern="^(.*)https?://dl\.google\.com/dl/android/studio/ide-zips/[\d\.]+/android-studio-ide-([\d\.]+)-(.*)$"
replace="\2" flags="s"/>
</tokenfilter>
</filterchain>
</loadresource>
</sequential>
<echo message="Download android studio: ${android.version} ${android.build.version}"/>
<property name="android.file.name" value="android-studio-ide-${android.build.version}-${android.os.tag}.zip"/>
<property name="android.studio.url"
value="http://dl.google.com/dl/android/studio/ide-zips/${android.version}/${android.file.name}"/>
<property name="android.download.dir" value="${dependencies}/android-studio"/>
<property name="android.destination.dir" value="ideaSDK"/>
<mkdir dir="${android.download.dir}"/>
<get src="${android.studio.url}" dest="${android.download.dir}" usetimestamp="true"/>
<delete dir="${android.destination.dir}" failonerror="false" includeemptydirs="true">
<exclude name="config/**"/>
<exclude name="system/**"/>
</delete>
<unzip src="${android.download.dir}/${android.file.name}" dest="${android.destination.dir}">
<cutdirsmapper dirs="${strip.dirs.count}"/>
</unzip>
<local name="android.studio.mac"/>
<condition property="android.studio.mac">
<matches pattern=".+mac\.zip" string="${android.file.name}"/>
</condition>
<local name="android.studio.linux"/>
<condition property="android.studio.linux">
<matches pattern=".+linux\.zip" string="${android.file.name}"/>
</condition>
<exec executable="chmod" if:set="android.studio.mac">
<arg value="-R"/>
<arg value="a+x"/>
<arg path="${android.destination.dir}/bin/"/>
<!-- Needed to run gradle -->
<arg path="${android.destination.dir}/jre/jdk/Contents/Home/bin/"/>
<arg path="${android.destination.dir}/jre/jdk/Contents/Home/lib/"/>
<arg path="${android.destination.dir}/jre/jdk/Contents/Home/jre/bin/"/>
<arg path="${android.destination.dir}/jre/jdk/Contents/Home/jre/lib/"/>
</exec>
<exec executable="chmod" if:set="android.studio.linux">
<arg value="a+x"/>
<arg path="${android.destination.dir}/bin/fsnotifier"/>
<arg path="${android.destination.dir}/bin/fsnotifier64"/>
<arg path="${android.destination.dir}/bin/inspect.sh"/>
<arg path="${android.destination.dir}/bin/studio.sh"/>
</exec>
<!--
This one needs to be deleted because otherwise it gets onto the classpath
together with junit-4.10.jar and the classloading goes crazy that breaks
many nice features of IDEA including diffs in the test console.
-->
<delete file="${android.destination.dir}/lib/junit.jar"/>
<!--
Plugin depends on newer runtime and reflect jar from our bootstrap compiler.
Avoid depending on old runtime during build phase but attach original runtime when idea starts.
-->
<mkdir dir="${android.destination.dir}/idea-kotlin-runtime"/>
<move file="${android.destination.dir}/lib/kotlin-runtime.jar" todir="${android.destination.dir}/idea-kotlin-runtime"/>
<move file="${android.destination.dir}/lib/kotlin-reflect.jar" todir="${android.destination.dir}/idea-kotlin-runtime"/>
<property name="as.core.dir" value="${android.destination.dir}/core"/>
<property name="as.lib.dir" value="${android.destination.dir}/lib"/>
<property name="base.repository.url" value="https://www.jetbrains.com/intellij-repository/releases/com/jetbrains/intellij/idea"/>
<get
src="${base.repository.url}/intellij-core/${android.studio.intellij-core.build.number}/intellij-core-${android.studio.intellij-core.build.number}.zip"
dest="${android.download.dir}/intellij-core-${android.studio.intellij-core.build.number}.zip"
usetimestamp="true"/>
<unzip src="${android.download.dir}/intellij-core-${android.studio.intellij-core.build.number}.zip" dest="${android.download.dir}/intellij-core" />
<get
src="${base.repository.url}/jps-standalone/${android.studio.intellij-core.build.number}/jps-standalone-${android.studio.intellij-core.build.number}.zip"
dest="${android.download.dir}/jps-standalone-${android.studio.intellij-core.build.number}.zip"
usetimestamp="true"/>
<unzip src="${android.download.dir}/jps-standalone-${android.studio.intellij-core.build.number}.zip" dest="${android.download.dir}/jps-standalone" />
<copy_intellij_core_files idea.dir="${android.destination.dir}"
download.dir.intellij-core="${android.download.dir}/intellij-core"
core="${android.destination.dir}/core"
xstream.version="1.4.8" />
<copy_intellij_jps_files jps="${android.destination.dir}/jps" download.dir.jps-standalone="${android.download.dir}/jps-standalone" />
<mkdir dir="${android.destination.dir}/core-analysis"/>
<copy file="${android.download.dir}/intellij-core/intellij-core-analysis.jar"
tofile="${android.destination.dir}/core-analysis/intellij-core-analysis.jar"/>
</target>
</project>