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
1170
1171
1172
1173
1174
|
<!--
Copyright (C) 2010-2020 The Project Lombok Authors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<project name="lombok" default="dist" xmlns:ivy="antlib:com.zwitserloot.ivyplusplus">
<description>
This buildfile is part of projectlombok.org. It is the main entry point that contains
the common tasks and can be called on to run the main aspects of all the sub-scripts.
</description>
<property name="pattern.jdk9Plus" value="^(9|[1-9][0-9])(\..*)?$" />
<property name="pattern.jdkUpto8" value="^(1\.)?[2-8](\..*)?$" />
<property name="build.compiler" value="javac1.6" />
<property name="mapstruct-binding.version" value="0.1.0" />
<property name="ivy.retrieve.pattern" value="lib/[conf]/[organisation]-[artifact].[ext]" />
<available file="lib/ivyplusplus.jar" property="ivyplusplus.available" />
<property name="rt-openjdk6" location="lib/openJDK6Environment/openjdk6_rt.jar" />
<property name="rt-openjdk8" location="lib/openJDK8Environment/openjdk8_rt.jar" />
<available file="${rt-openjdk6}" property="rt-openjdk6.available" />
<available file="${rt-openjdk8}" property="rt-openjdk8.available" />
<path id="build.path">
<fileset dir="lib/build">
<include name="*.jar" />
</fileset>
</path>
<path id="runtime.path">
<fileset dir="lib/runtime">
<include name="*.jar" />
</fileset>
</path>
<path id="test.path">
<fileset dir="lib/test">
<include name="*.jar" />
</fileset>
</path>
<path id="eclipseBuild.path">
<fileset dir="lib/eclipseBuild">
<include name="*.jar" />
</fileset>
</path>
<target name="clean" description="Removes all generated files.">
<delete dir="build" quiet="true" />
</target>
<target name="distclean" depends="clean" description="Deletes everything that this build script has ever generated.">
<delete dir="lib" quiet="true" />
<delete dir="dist" quiet="true" />
<delete file=".project" quiet="true" />
<delete file=".classpath" quiet="true" />
<delete dir=".settings" quiet="true" />
<delete dir=".idea" quiet="true" />
<delete file="lombok.iml" quiet="true" />
<delete dir="ivyCache" quiet="true" />
</target>
<target name="download-ipp" unless="ivyplusplus.available">
<mkdir dir="lib" />
<get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" usetimestamp="true" />
</target>
<target name="load-ipp" depends="download-ipp">
<taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" />
<ivy:ensureippversion version="1.34" property="ivyplusplus.minimumAvailable" />
</target>
<target name="redownload-ipp" unless="ivyplusplus.minimumAvailable">
<get src="https://projectlombok.org/downloads/ivyplusplus.jar" dest="lib/ivyplusplus.jar" />
<fail>A new version of ivyplusplus was required and has been downloaded. Rerun the script to continue.</fail>
</target>
<target name="ensure-ipp" depends="load-ipp, redownload-ipp" />
<target name="config-ivy" depends="ensure-ipp" unless="ivy.config">
<ivy:configure file="buildScripts/ivysettings.xml" />
<property name="ivy.config" value="true" />
</target>
<target name="deps" depends="ensureBuildDeps, ensureRuntimeDeps, ensureTestDeps, contrib" description="Downloads all dependencies." />
<target name="contrib" depends="config-ivy" description="Downloads various non-crucial documentation, sources, etc that are useful when developing lombok.ast.">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="contrib, ecj7, ecj8, ecj9" />
<ivy:retrieve />
</target>
<target name="ensureOpenJdk6Rt" unless="rt-openjdk6.available">
<mkdir dir="lib/openJDK6Environment" />
<get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="${rt-openjdk6}" verbose="true" usetimestamp="true" />
</target>
<target name="ensureOpenJdk8Rt" unless="rt-openjdk8.available">
<mkdir dir="lib/openJDK8Environment" />
<get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk8.jar" dest="${rt-openjdk8}" verbose="true" usetimestamp="true" />
</target>
<target name="ensureBuildDeps" depends="config-ivy,ensureOpenJdk6Rt">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="build, javac7, moduleBuild" />
<ivy:retrieve />
</target>
<target name="ensureRuntimeDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="runtime" />
<ivy:retrieve />
</target>
<target name="ensureTestDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="test, javac6, eclipseBuild" />
<ivy:retrieve />
</target>
<target name="ensureSupportersDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="supporters" />
<ivy:retrieve />
</target>
<target name="version" depends="ensure-ipp, ensureOpenJdk8Rt" description="Shows the version number." unless="lombok.version">
<mkdir dir="build/lombok" />
<ivy:compile destdir="build/lombok" source="1.5" target="1.5" ecj="true" nowarn="true">
<bootclasspath path="${rt-openjdk8}" />
<src path="src/core" />
<include name="lombok/core/Version.java" />
</ivy:compile>
<java
classname="lombok.core.Version"
classpath="build/lombok"
failonerror="true"
output="build/version.txt">
<arg value="full" />
</java>
<ivy:loadversion property="lombok.fullversion" file="build/version.txt" />
<java
classname="lombok.core.Version"
classpath="build/lombok"
failonerror="true"
output="build/version.txt" />
<ivy:loadversion property="lombok.version" file="build/version.txt" />
<echo level="info">Lombok version: ${lombok.version} (${lombok.fullversion})</echo>
</target>
<target name="-unpackLibs" depends="ensureRuntimeDeps">
<ivy:cachedunjar dest="build/lombok" marker="build/unpackDeps.marker">
<path refid="runtime.path" />
</ivy:cachedunjar>
</target>
<target name="-ensureJdk9">
<condition property="java.version.insufficient">
<matches string="${ant.java.version}" pattern="${pattern.jdkUpto8}" />
</condition>
<fail if="java.version.insufficient">To compile lombok, you need JDK9 or higher; lombok requires this version because it's rather difficult to produce lombok builds that are compatible on JDK9 without at least building with JDK9. Sorry about that.</fail>
</target>
<target name="compile" depends="version, ensureBuildDeps, -unpackLibs, -ensureJdk9" description="Compiles the code.">
<fail>
For compiling with Java9 'modulepath' an Ant version 1.9.7+ or 1.10.0+ is required.
Your current version is:
${ant.version}
<condition>
<not><antversion atleast="1.9.8"/></not>
</condition>
</fail>
<!-- ant includes the destination dir on the classpath (and there are good reasons to do this), but that also means
the bleeding edge lombok from the previous build is run, which means if there are bugs in it, you can't compile
anymore until you 'ant clean'. That's very much not desired, so we kill the processor, which stops lombok from running.
We re-create the file at the end of this target. -->
<delete file="build/lombok/META-INF/services/javax.annotation.processing.Processor" quiet="true" />
<ivy:compile destdir="build/stubsstubs" source="1.5" target="1.5" ecj="true" nowarn="true">
<bootclasspath path="${rt-openjdk8}" />
<src path="src/stubsstubs" />
<classpath location="build/stubsstubs" />
</ivy:compile>
<ivy:compile destdir="build/stubs" source="1.5" target="1.5" ecj="true" nowarn="true">
<bootclasspath path="${rt-openjdk8}" />
<src path="src/stubs" />
<src path="src/javac-only-stubs" />
<classpath location="build/stubsstubs" />
<classpath location="build/stubs" />
</ivy:compile>
<ivy:compile destdir="build/lombok-utils" source="1.5" target="1.5" ecj="true" nowarn="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${rt-openjdk8}" />
<src path="src/utils" />
<exclude name="lombok/javac/**" />
<classpath refid="build.path" />
</ivy:compile>
<ivy:compile destdir="build/lombok-utils" source="1.6" target="1.6" ecj="true" nowarn="true">
<bootclasspath path="${rt-openjdk8}" />
<bootclasspath location="build/stubs" />
<src path="src/utils" />
<include name="lombok/javac/**" />
<classpath location="build/lombok-utils" />
<classpath refid="build.path" />
</ivy:compile>
<copy todir="build/lombok">
<fileset dir="build/lombok-utils" />
</copy>
<mkdir dir="build/transformedSources" />
<copy todir="build/transformedSources">
<fileset dir="src/eclipseAgent">
<include name="**/*Transplants.java" />
</fileset>
<filterchain>
<lineContainsRegExp negate="true">
<regexp pattern="^\s*@SuppressWarnings.*$" />
</lineContainsRegExp>
</filterchain>
</copy>
<ivy:compile destdir="build/lombok" source="1.4" target="1.4" ecj="true" nowarn="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${rt-openjdk8}" />
<src path="build/transformedSources" />
</ivy:compile>
<ivy:compile destdir="build/lombok/Class50" source="1.4" target="1.6" ecj="true" nowarn="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${rt-openjdk8}" />
<src path="build/transformedSources" />
</ivy:compile>
<ivy:compile destdir="build/lombok" source="1.5" target="1.5" ecj="true" nowarn="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${rt-openjdk8}" />
<src path="src/launch" />
<src path="src/core" />
<src path="src/installer" />
<src path="src/eclipseAgent" />
<exclude name="lombok/javac/**" />
<exclude name="**/*Transplants.java" />
<classpath location="build/lombok" />
<classpath refid="build.path" />
</ivy:compile>
<javac includeAntRuntime="false" source="1.9" target="1.9" destdir="build/lombok" modulepath="lib/moduleBuild">
<compilerarg value="-Xlint:none" />
<!-- The above is because javac9 warns about 'service interface provided but not exported or used', probably because lombok uses SPI internally, and uses the 'old' classpath discovery system for it. We're fine with this, hence, ignore this warning. -->
<src path="src/core9" />
</javac>
<ivy:compile destdir="build/lombok/Class50" source="1.5" target="1.6" ecj="true" nowarn="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${rt-openjdk8}" />
<src path="src/eclipseAgent" />
<include name="lombok/launch/PatchFixesHider.java" />
<classpath location="build/lombok" />
<classpath refid="build.path" />
</ivy:compile>
<ivy:compile destdir="build/lombok" source="1.6" target="1.6" ecj="true" nowarn="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${rt-openjdk8}" />
<src path="src/core" />
<src path="src/delombok" />
<include name="lombok/javac/**" />
<include name="lombok/delombok/**" />
<classpath location="build/lombok" />
<classpath refid="build.path" />
</ivy:compile>
<delete dir="build/lombok-proc-result" quiet="true" />
<ivy:compile destdir="build/lombok-proc-result" source="9" target="9">
<classpath location="build/stubs" />
<compilerarg value="-proc:only" />
<compilerarg value="-processor" />
<compilerarg value="org.mangosdk.spi.processor.SpiProcessor" />
<src path="src/launch" />
<src path="src/core" />
<src path="src/installer" />
<src path="src/eclipseAgent" />
<src path="src/delombok" />
<classpath location="build/lombok" />
<classpath refid="build.path" />
</ivy:compile>
<copy todir="build/lombok">
<fileset dir="build/lombok-proc-result">
<include name="META-INF/services/*" />
</fileset>
</copy>
<mkdir dir="build/lombok/META-INF" />
<mkdir dir="build/lombok/META-INF/services" />
<echo file="build/lombok/META-INF/services/javax.annotation.processing.Processor">lombok.launch.AnnotationProcessorHider$AnnotationProcessor
lombok.launch.AnnotationProcessorHider$ClaimingProcessor</echo>
<mkdir dir="build/lombok/META-INF/gradle" />
<echo file="build/lombok/META-INF/gradle/incremental.annotation.processors">lombok.launch.AnnotationProcessorHider$AnnotationProcessor,isolating
lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo>
</target>
<target name="-latestChanges" depends="version">
<ant antfile="buildScripts/website.ant.xml" target="latestChanges" inheritAll="false">
<property name="lombok.version" value="${lombok.version}" />
<property name="lombok.fullversion" value="${lombok.fullversion}" />
</ant>
</target>
<target name="dist" description="Builds THE lombok.jar file which contains everything." depends="version, compile, -latestChanges, -compileMapstruct">
<mkdir dir="dist" />
<copy file="doc/changelog.markdown" tofile="build/changelog.txt" />
<tstamp>
<format property="releaseTimestamp" pattern="yyyy-MM-dd" />
</tstamp>
<echo file="release-timestamp.txt">${releaseTimestamp}</echo>
<zip destfile="dist/lombok-${lombok.version}.jar">
<fileset dir="build" includes="changelog.txt, latestchanges.html" />
<fileset dir="." includes="README.md" />
<fileset dir="." includes="LICENSE" />
<fileset dir="." includes="AUTHORS" />
<fileset dir="." includes="release-timestamp.txt" />
<fileset dir="build/lombok">
<include name="module-info.class" />
<include name="lombok/*.class" />
<include name="lombok/experimental/**" />
<include name="lombok/extern/**" />
<include name="lombok/launch/**" />
<include name="lombok/delombok/ant/Tasks*" />
<include name="lombok/javac/apt/Processor.class" />
<include name="lombok/META-INF/**" />
</fileset>
<mappedresources>
<fileset dir="build/lombok">
<exclude name="com/sun/tools/javac/**" />
<exclude name="module-info.class" />
<exclude name="lombok/*.class" />
<exclude name="lombok/javac/apt/Processor.class" />
<exclude name="lombok/experimental/**" />
<exclude name="lombok/extern/**" />
<exclude name="lombok/launch/**" />
<exclude name="lombok/delombok/ant/Tasks*" />
</fileset>
<firstmatchmapper>
<globmapper from="*.class" to="*.SCL.lombok" />
<identitymapper />
</firstmatchmapper>
</mappedresources>
</zip>
<jar destfile="dist/lombok-${lombok.version}.jar" update="true">
<manifest>
<attribute name="Premain-Class" value="lombok.launch.Agent" />
<attribute name="Agent-Class" value="lombok.launch.Agent" />
<attribute name="Can-Redefine-Classes" value="true" />
<attribute name="Main-Class" value="lombok.launch.Main" />
<attribute name="Lombok-Version" value="${lombok.version}" />
</manifest>
</jar>
<delete file="release-timestamp.txt" />
<copy file="dist/lombok-${lombok.version}.jar" tofile="dist/lombok.jar" />
<property name="lombok.dist.built" value="true" />
</target>
<target name="-eclipse-p2-dist" unless="lombok.version">
<antcall target="dist" />
</target>
<target name="eclipse-p2" depends="config-ssh, -eclipse-p2-dist" description="Builds an eclipse p2 update site which allows lombok to be installed as an eclipse plugin">
<ant antfile="buildScripts/eclipse-p2.ant.xml" target="dist-eclipse-p2" inheritAll="false">
<property name="lombok.version" value="${lombok.version}" />
</ant>
<ant antfile="buildScripts/website.ant.xml" target="deploy-p2" inheritAll="false">
<property name="ssh.username" value="${ssh.username}" />
<property name="ssh.keyfile" value="${ssh.keyfile}" />
</ant>
</target>
<target name="dist-utils" description="Builds lombok-utils.jar, which is a library used by i.e. lombok.ast project." depends="version, compile">
<mkdir dir="dist" />
<jar destfile="dist/lombok-utils-${lombok.version}.jar">
<fileset dir="build/lombok-utils" />
<fileset dir="." includes="LICENSE" />
<fileset dir="." includes="AUTHORS" />
<manifest>
<attribute name="Lombok-Version" value="${lombok.version}" />
</manifest>
</jar>
<copy file="dist/lombok-utils-${lombok.version}.jar" tofile="dist/lombok-utils.jar" />
</target>
<target name="intellij" depends="deps, contrib" description="Creates intellij project files and downloads all dependencies. Open this directory as a project in IntelliJ after running this target.">
<echo> ** WARNING ** The core lombok contributors all use eclipse to develop lombok. We have some ability on letting you work on lombok via intellij, but whether the generated project can be used in a modern intellij is currently unknown. Please do continue, but be aware that trying to work on lombok from intellij may run into problems. If you want to adopt 'work on lombok via intellij' as a task, we're open to it!</echo>
<input>Press return to continue</input>
<ivy:intellijgen>
<conf name="build" sources="contrib" />
<conf name="test" sources="contrib" />
<module name="lombok" depends="build, test">
<srcdir dir="src/core" />
<srcdir dir="src/launch" />
<srcdir dir="src/utils" />
<srcdir dir="src/eclipseAgent" />
<srcdir dir="src/installer" />
<srcdir dir="src/delombok" />
<srcdir dir="src/stubs" />
<srcdir dir="src/testAP" />
<srcdir dir="experimental/src" />
<srcdir dir="test/transform/src" test="true" />
<srcdir dir="test/core/src" test="true" />
<srcdir dir="test/bytecode/src" test="true" />
<srcdir dir="test/configuration/src" test="true" />
<srcdir dir="test/stubs" test="true" />
</module>
<settings>
<url url="https://projectlombok.org/downloads/lombok.intellij.settings" />
</settings>
<apt enabled="true" />
</ivy:intellijgen>
</target>
<target name="-skipEclipseDeps">
<property name="eclipse.build.configname" value="buildWithoutEclipse" />
</target>
<target name="-addEclipseDeps">
<property name="eclipse.build.configname" value="build" />
</target>
<target name="eclipse" depends="-addEclipseDeps, deps, contrib" description="Creates eclipse project files and downloads all dependencies. Open this directory as project in eclipse after running this target. This will NOT let you start a debug session for eclipse; use target 'eclipseForDebugging' instead to do that.">
<ivy:eclipsegen source="1.6">
<srcdir dir="src/core" />
<srcdir dir="src/launch" />
<srcdir dir="src/utils" />
<srcdir dir="src/eclipseAgent" />
<srcdir dir="src/installer" />
<srcdir dir="src/delombok" />
<srcdir dir="src/stubs" />
<srcdir dir="src/testAP" />
<srcdir dir="src/website" />
<srcdir dir="experimental/src" />
<srcdir dir="test/transform/src" />
<srcdir dir="test/core/src" />
<srcdir dir="test/bytecode/src" />
<srcdir dir="test/configuration/src" />
<srcdir dir="test/stubs" />
<conf name="${eclipse.build.configname}" sources="contrib" />
<conf name="test" sources="contrib" />
<local org="org.projectlombok" name="lombok.patcher" dir="../lombok.patcher" />
<settings>
<url url="https://projectlombok.org/downloads/lombok.eclipse.settings" />
</settings>
<apt location="lib/build/projectlombok.org-spi.jar" />
</ivy:eclipsegen>
</target>
<target name="ensureEcjDebugDeps" depends="config-ivy">
<ivy:resolve file="buildScripts/ivy.xml" refresh="true" conf="buildWithoutEclipse" />
<ivy:retrieve />
</target>
<target name="loadEclipseLocation">
<loadfile property="eclipse.location" srcFile="eclipse.location" encoding="UTF-8" quiet="true" />
</target>
<target name="setupEclipseLocation" depends="loadEclipseLocation" unless="eclipse.location">
<echo>To add your eclipse installation's own plugins as dependencies, the build script needs to know where your eclipse is installed. Please enter this now (it's saved for future executions of this task). For example:
/Applications/eclipse
C:\Program Files\eclipse
</echo>
<input message="Path to eclipse: " addproperty="eclipse.location" />
<available property="eclipse.found" file="${eclipse.location}/plugins" />
<fail unless="eclipse.found">Eclipse can't be found in this location; I expect that directory to contain a subdirectory called 'plugins'.</fail>
<echo file="eclipse.location" message="${eclipse.location}" />
</target>
<target name="eclipseForDebugging" depends="-skipEclipseDeps, ensureEcjDebugDeps, eclipse, setupEclipseLocation" description="Creates eclipse project files and downloads all dependencies, but borrows all eclipse dependencies (and more) from your existing eclipse installation. This is very useful if you wish to start a debugging eclipse from inside eclipse, and then breakpoint eclipse code itself. Because the deps are inherited, line numbers will line up and such.">
<copy
file="buildScripts/eclipse-debug-target.template"
tofile="LombokizedEclipse.launch"
preservelastmodified="true"
overwrite="true">
</copy>
<!-- These are dependencies -->
<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.core.runtime" /></antcall>
<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.equinox.common" /></antcall>
<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.osgi" /></antcall>
<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.jdt.core" /></antcall>
<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.jdt.ui" /></antcall>
<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.jface.text" /></antcall>
<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.core.resources" /></antcall>
<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.core.jobs" /></antcall>
<!-- These are merely useful -->
<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.text" /></antcall>
<antcall target="-augmentClasspath"><param name="pluginName" value="org.eclipse.ltk.core.refactoring" /></antcall>
</target>
<target name="-augmentClasspath">
<pathconvert property="augment.bin" setonempty="false" pathsep=" :: ">
<fileset dir="${eclipse.location}/plugins" includes="${pluginName}_*" />
</pathconvert>
<fail unless="augment.bin">
You do not have the eclipse plugin '${pluginName}'. I expected it to be in your eclipse plugins directory (followed by an underscore and a version number).
</fail>
<condition property="multiples">
<contains string="${augment.bin}" substring=" :: " />
</condition>
<condition property="augment.jar" value="${augment.bin}">
<not><isset property="multiples" /></not>
</condition>
<input message="You have multiple versions of the same plugin. These are: ${augment.bin}. Please copy/paste the complete path to the one you want to use, press enter to abort:" addproperty="augment.jar" />
<condition property="emptyTarget">
<equals arg1="${augment.jar}" arg2="" />
</condition>
<fail>
<condition>
<equals arg1="${augment.jar}" arg2="" />
</condition>
</fail>
<pathconvert property="augment.src">
<map from="${eclipse.location}/plugins/${pluginName}_" to="${eclipse.location}/plugins/${pluginName}.source_" />
<fileset file="${augment.jar}" />
</pathconvert>
<available property="sourceAddition" file="${augment.src}" value=" sourcepath="${augment.src}"" />
<property name="sourceAddition" value="" />
<condition property="sourceWarning" value="WARNING: No source available for this plugin!">
<equals arg1="${sourceAddition}" arg2="" />
</condition>
<property name="sourceWarning" value="" />
<replaceregexp file=".classpath" flags="is" encoding="UTF-8">
<regexp pattern="^(.*?)(.)(<classpathentry kind=.lib. path=)(.*)$" />
<substitution expression="\1\2<classpathentry kind="lib" path="____AUGMENT_BIN____"____AUGMENT_SRC____/>\${line.separator}\2\3\4" />
</replaceregexp>
<replace file=".classpath" token="____AUGMENT_BIN____" value="${augment.jar}" />
<replace file=".classpath" token="____AUGMENT_SRC____" value="${sourceAddition}" />
<echo>Added to project classpath from your eclipse installation: ${pluginName}.
${sourceWarning}</echo>
</target>
<target name="-test-compile" depends="ensureTestDeps, compile" unless="skipTests">
<mkdir dir="build/tests" />
<ivy:compile destdir="build/tests" source="1.5" target="1.5" ecj="true" nowarn="true">
<bootclasspath path="${rt-openjdk8}" />
<classpath refid="test.path" />
<classpath refid="build.path" />
<classpath path="build/lombok" />
<classpath path="build/tests" />
<src path="test/core/src" />
<src path="test/transform/src" />
<src path="test/bytecode/src" />
<src path="test/configuration/src" />
</ivy:compile>
<mkdir dir="build/teststubs" />
<ivy:compile destdir="build/teststubs" source="1.6" target="1.6" ecj="true" nowarn="true">
<src path="test/stubs" />
</ivy:compile>
</target>
<target name="test-ecj" depends="dist, contrib, setupJavaOracle8TestEnvironment" unless="tests.skip">
<condition property="ecj.loc" value="lib/ecj9/org.eclipse.jdt-ecj.jar" else="lib/ecj8/org.eclipse.jdt.core.compiler-ecj.jar">
<matches string="${ant.java.version}" pattern="${pattern.jdk9Plus}" />
</condition>
<echo>Testing ECJ using ECJ: ${ecj.loc}</echo>
<java jar="${ecj.loc}" fork="true" failonerror="true">
<jvmarg value="-javaagent:dist/lombok.jar=ecj" />
<arg value="-source" />
<arg value="1.6" />
<arg value="-target" />
<arg value="1.6" />
<arg value="-cp" />
<arg value="dist/lombok.jar" />
<arg value="test/ecj/SimpleTest.java" />
</java>
</target>
<target name="-loadTestEnvironmentProperties">
<property file="testenvironment.properties" />
<available file=".project" property="isEclipseProject" />
</target>
<target name="-createEclipseLaunchForTestEnvironmentIfEclipseProject" depends="-loadTestEnvironmentProperties" if="isEclipseProject">
<antcall target="createEclipseLaunchForTestEnvironment" />
</target>
<target name="createEclipseLaunchForTestEnvironment" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties" description="Creates an eclipse launch target for the current test environment.">
<copy
file="buildScripts/eclipse-run-tests.template"
tofile="RunLombokTests ${test.location.name}.launch"
preservelastmodified="true"
overwrite="true">
<filterset>
<filter token="JAVAC_LOCATION" value="${test.location.javac}" />
<filter token="ECJ_LOCATION" value="${test.location.ecj}" />
<filter token="RT_LOCATION" value="${test.location.bootclasspath}" />
<filter token="JAVA_VERSION" value="${test.javaversion}" />
<filter token="PATH_SEP" value="${path.separator}" />
</filterset>
</copy>
<echo>WARNING: If you wish to test JDK8 features in eclipse, there must be a JDK8 installation configured in your eclipse, and it must be called 'JavaSE-1.8'.</echo>
</target>
<target name="setupJavaOpenJDK6TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against OpenJDK6.">
<mkdir dir="lib/openJDK6Environment" />
<get src="https://projectlombok.org/ivyrepo/langtools/javac-1.6.0.18.jar" dest="lib/openJDK6Environment/javac6.jar" verbose="true" usetimestamp="true" />
<get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk6.jar" dest="${rt-openjdk6}" verbose="true" usetimestamp="true" />
<propertyfile file="testenvironment.properties">
<entry key="test.location.javac" value="lib/openJDK6Environment/javac6.jar" />
<entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" />
<entry key="test.location.bootclasspath" value="${rt-openjdk6}" />
<entry key="test.location.name" value="OpenJDK6" />
<entry key="test.javaversion" value="6" />
</propertyfile>
<echo>Tests will now run against OpenJDK6</echo>
<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
</target>
<target name="setupJavaOpenJDK7TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against OpenJDK7.">
<mkdir dir="lib/openJDK7Environment" />
<get src="https://projectlombok.org/ivyrepo/langtools/javac-1.7.0.jar" dest="lib/openJDK7Environment/javac7.jar" verbose="true" usetimestamp="true" />
<get src="https://projectlombok.org/ivyrepo/langtools/rt-openjdk7.jar" dest="lib/openJDK7Environment/rt-openjdk7.jar" verbose="true" usetimestamp="true" />
<propertyfile file="testenvironment.properties">
<entry key="test.location.javac" value="lib/openJDK7Environment/javac7.jar" />
<entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" />
<entry key="test.location.bootclasspath" value="lib/openJDK7Environment/rt-openjdk7.jar" />
<entry key="test.location.name" value="OpenJDK7" />
<entry key="test.javaversion" value="7" />
</propertyfile>
<echo>Tests will now run against OpenJDK7</echo>
<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
</target>
<target name="setupJavaOracle7TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against Oracle JDK7.">
<mkdir dir="lib/oracleJDK7Environment" />
<get src="https://projectlombok.org/ivyrepo/langtools/oracle-jdk7-tools.jar" dest="lib/oracleJDK7Environment/tools.jar" verbose="true" usetimestamp="true" />
<get src="https://projectlombok.org/ivyrepo/langtools/oracle-jdk7-rt.jar" dest="lib/oracleJDK7Environment/rt.jar" verbose="true" usetimestamp="true" />
<propertyfile file="testenvironment.properties">
<entry key="test.location.javac" value="lib/oracleJDK7Environment/tools.jar" />
<entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" />
<entry key="test.location.bootclasspath" value="lib/oracleJDK7Environment/rt.jar" />
<entry key="test.location.name" value="OracleJDK7" />
<entry key="test.javaversion" value="7" />
</propertyfile>
<echo>Tests will now run against Oracle JDK7</echo>
<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
</target>
<target name="setupJavaOracle8TestEnvironment" depends="ensureTestDeps, contrib" description="Sets up the test so that 'ant test' will test against Oracle JDK8.">
<mkdir dir="lib/oracleJDK8Environment" />
<get src="https://projectlombok.org/ivyrepo/langtools/jdk8-javac.jar" dest="lib/oracleJDK8Environment/javac8.jar" verbose="true" usetimestamp="true" />
<get src="https://projectlombok.org/ivyrepo/langtools/oracle-jdk8-rt.jar" dest="lib/oracleJDK8Environment/rt.jar" verbose="true" usetimestamp="true" />
<get src="https://projectlombok.org/ivyrepo/langtools/jdk8-javac-sources.zip" dest="lib/oracleJDK8Environment/javac8-sources.zip" verbose="true" usetimestamp="true" />
<propertyfile file="testenvironment.properties">
<entry key="test.location.javac" value="lib/oracleJDK8Environment/javac8.jar" />
<entry key="test.location.ecj" value="lib/ecj8/org.eclipse.jdt.core.compiler-ecj.jar" />
<entry key="test.location.bootclasspath" value="lib/oracleJDK8Environment/rt.jar" />
<entry key="test.location.name" value="OracleJDK8" />
<entry key="test.javaversion" value="8" />
</propertyfile>
<echo>Tests will now run against Oracle JDK8</echo>
<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
</target>
<target name="-failIfNoTestEnvironmentProperties" unless="test.javaversion">
<fail>ERROR: No test environment set up.
You need to set up a test environment, which consists of a version of javac, and a JRE runtime classpath ('rt.jar').
Eventually, this environment concept will be extended to also include an ecj and/or eclipse to test against.
You can let this ant script set them up for you:
* ant setupJavaOpenJDK6TestEnvironment
* ant setupJavaOpenJDK7TestEnvironment
* ant setupJavaOracle7TestEnvironment
* ant setupJavaOracle8TestEnvironment
These will set up test environments based on OpenJDK6 and OpenJDK7, and download all required files automatically. This will be a relatively large download. You can switch by running this command again; the downloads are cached so switching is fast.
You can also create your own by writing a 'testenvironment.properties' file. The relevant properties are:
* test.location.javac = /path/to/javac6.jar
* test.location.ecj = /path/to/ecj6.jar
* test.location.bootclasspath = /path/to/rt.jar
* test.location.name = RandomUsefulNameToIdentifyThisSetup
* test.javaversion = 6
</fail>
</target>
<target name="test" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties, -test-compile, dist, test-ecj, -test-check, -test8, -test9" description="Runs all tests." />
<target name="testfast" depends="-loadTestEnvironmentProperties, -failIfNoTestEnvironmentProperties, -test-compile, -test-check, -test8, -test9" />
<target name="-test-check">
<condition property="test9.run">
<and>
<not><isset property="tests.skip" /></not>
<matches string="${ant.java.version}" pattern="${pattern.jdk9Plus}" />
</and>
</condition>
<condition property="test8.run">
<and>
<not><isset property="tests.skip" /></not>
<matches string="${ant.java.version}" pattern="${pattern.jdkUpto8}" />
</and>
</condition>
</target>
<target name="-test9" if="test9.run">
<echo>Running test suite in JDK9+ mode</echo>
<junit haltonfailure="no" fork="true">
<jvmarg value="-javaagent:dist/lombok.jar" />
<jvmarg value="-Ddelombok.bootclasspath=${test.location.bootclasspath}" />
<jvmarg value="--add-opens" />
<jvmarg value="jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED" />
<jvmarg value="--add-opens" />
<jvmarg value="jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED" />
<formatter type="plain" usefile="false" unless="tests.quiet" />
<classpath refid="test.path" />
<classpath path="${test.location.ecj}" />
<classpath path="${test.location.javac}" />
<classpath path="build/lombok" />
<classpath path="build/tests" />
<classpath path="build/teststubs" />
<batchtest>
<fileset dir="test/core/src">
<include name="lombok/RunAllTests.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="-test8" if="test8.run">
<echo>Running test suite in JDK6-8 mode</echo>
<junit haltonfailure="no" fork="true">
<jvmarg value="-javaagent:dist/lombok.jar" />
<jvmarg value="-Ddelombok.bootclasspath=${test.location.bootclasspath}" />
<formatter type="plain" usefile="false" unless="tests.quiet" />
<classpath refid="test.path" />
<classpath path="${test.location.ecj}" />
<classpath path="${test.location.javac}" />
<classpath path="build/lombok" />
<classpath path="build/tests" />
<classpath path="build/teststubs" />
<batchtest>
<fileset dir="test/core/src">
<include name="lombok/RunAllTests.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="utils-javadoc" depends="compile">
<tstamp>
<format property="javadoc.year" pattern="yyyy"/>
</tstamp>
<mkdir dir="build/utils-api" />
<javadoc sourcepath="src/utils" defaultexcludes="yes" destdir="build/utils-api" windowtitle="Lombok Utils">
<classpath refid="build.path" />
<link href="http://download.oracle.com/javase/6/docs/api/" />
<header><![CDATA[<a href='https://projectlombok.org/' target='_blank'>Lombok</a> - ]]>v${lombok.version}</header>
<bottom><![CDATA[<i>Copyright © 2011-${javadoc.year} The Project Lombok Authors, licensed under the <a href='http://www.opensource.org/licenses/mit-license.php' target='_blank'>MIT licence</a>.]]></bottom>
</javadoc>
<!-- bugfix for boneheaded javadoc bug where ?is-external=true is inserted before an anchor ref, breaking the anchor ref.
is-external=true doesn't actually do anything, so, we'll just get rid of it. -->
<replaceregexp match="\?is-external=true#" replace="#" flags="gi">
<fileset dir="build/utils-api" includes="**/*.html" />
</replaceregexp>
</target>
<target name="utils-maven" depends="version, dist-utils, utils-javadoc" description="Build a maven artifact bundle for lombok-utils.">
<jar destfile="dist/lombok-utils-${lombok.version}-javadoc.jar">
<fileset dir="build/utils-api" />
</jar>
<jar destfile="dist/lombok-utils-${lombok.version}-sources.jar">
<fileset dir="src/utils" />
</jar>
<mkdir dir="build/utils-mavenPublish" />
<copy tofile="build/utils-mavenPublish/pom.xml" overwrite="true" file="doc/utils-maven-pom.xml">
<filterchain>
<replacetokens>
<token key="VERSION" value="${lombok.version}" />
</replacetokens>
</filterchain>
</copy>
<tar destfile="build/utils-mavenPublish/utils-mavenPublish.tar.bz2" compression="bzip2">
<tarfileset dir="dist">
<include name="lombok-utils-${lombok.version}.jar" />
<include name="lombok-utils-${lombok.version}-sources.jar" />
<include name="lombok-utils-${lombok.version}-javadoc.jar" />
</tarfileset>
<tarfileset dir="build/utils-mavenPublish" includes="pom.xml" />
</tar>
</target>
<target name="javadoc" depends="compile, version" description="Builds javadoc into doc/api.">
<ant antfile="buildScripts/website.ant.xml" target="javadoc" inheritAll="false">
<property name="lombok.version" value="${lombok.version}" />
<property name="lombok.fullversion" value="${lombok.fullversion}" />
</ant>
</target>
<target name="-prepare-maven" depends="version, dist, javadoc">
<jar destfile="dist/lombok-${lombok.version}-javadoc.jar">
<fileset dir="doc/api" />
</jar>
<jar destfile="dist/lombok-${lombok.version}-sources.jar">
<fileset dir="src/core" />
<fileset dir="src/launch" />
<fileset dir="src/utils" />
<fileset dir="src/eclipseAgent" />
<fileset dir="src/installer" />
<fileset dir="src/delombok" />
<fileset dir="test/transform/src" />
<fileset dir="test/core/src" />
</jar>
<mkdir dir="build/mavenPublish" />
<!-- Could already be set for edge releases -->
<property name="lombok.version.mvn" value="${lombok.version}" />
<copy tofile="build/mavenPublish/pom.xml" overwrite="true" file="doc/maven-pom.xml">
<filterchain>
<replacetokens>
<token key="VERSION" value="${lombok.version.mvn}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="maven" depends="-prepare-maven" description="Build a maven artifact bundle.">
<tar destfile="build/mavenPublish/mavenPublish.tar.bz2" compression="bzip2">
<tarfileset dir="dist">
<include name="lombok-${lombok.version}.jar" />
<include name="lombok-${lombok.version}-sources.jar" />
<include name="lombok-${lombok.version}-javadoc.jar" />
</tarfileset>
<tarfileset dir="build/mavenPublish" includes="pom.xml" />
</tar>
</target>
<target name="maven-publish" depends="config-ssh, maven, utils-maven" description="Build a maven artifact bundle then upload it to projectlombok.org and ask the server to upload it to maven central">
<ivy:scpUpload
from="build/mavenPublish/mavenPublish.tar.bz2"
to="/data/lombok/staging"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
<ivy:scpUpload
from="build/utils-mavenPublish/utils-mavenPublish.tar.bz2"
to="/data/lombok/staging"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
<ivy:sshExec
cmd="/data/lombok/stagingCmd/publishToMavenCentral"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
<echo>The artifact has been published to staging. Now go to https://oss.sonatype.org/ and log in as Reinier, then doublecheck if all is well and 'release' it.</echo>
<ivy:sshExec
cmd="/data/lombok/stagingCmd/showMavenCentralPassword"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
</target>
<target name="publish" description="Publishes the latest build to googlecode." depends="config-ssh, version, dist, dist-utils">
<ivy:scpUpload
from="dist/lombok-utils-${lombok.version}.jar"
to="/data/lombok/staging"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
<ivy:sshExec
cmd="/data/lombok/stagingCmd/deployLombokUtils '${lombok.version}'"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
<ivy:scpUpload
from="dist/lombok-${lombok.version}.jar"
to="/data/lombok/staging"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
<ivy:sshExec
cmd="/data/lombok/stagingCmd/deployLombok '${lombok.version}'"
server="projectlombok.org"
username="${ssh.username}"
keyfile="${ssh.keyfile}"
knownHosts="ssh.knownHosts" />
<echo>WARNING: You should now immediately run an edge release!</echo>
</target>
<target name="publish-all" depends="clean, version, website-publish, maven-publish, publish"
description="Publishes lombok itself, updates the maven repository and the website." />
<target name="edge-release" depends="config-ssh, clean, version, dist, make-edge-as-maven_snapshot_repo"
description="Publishes an edge release for those who need to test a cutting edge build.">
<ant antfile="buildScripts/website.ant.xml" target="edgeRelease" inheritAll="false">
<property name="lombok.version" value="${lombok.version}" />
<property name="lombok.fullversion" value="${lombok.fullversion}" />
<property name="ssh.username" value="${ssh.username}" />
<property name="ssh.keyfile" value="${ssh.keyfile}" />
</ant>
</target>
<property file="ssh.configuration" />
<target name="config-ssh" unless="ssh.username">
<input message="What is your SSH username on the projectlombok.org server? (Enter to abort)." addproperty="ssh.username" />
<condition property="ssh.usernameBlank"><equals arg1="${ssh.username}" arg2="" trim="true" /></condition>
<fail if="ssh.usernameBlank">Aborted.</fail>
<input message="Where is your ssh keyfile located?" addproperty="ssh.keyfile" defaultvalue="${user.home}/.ssh/id_rsa" />
<input message="SSH configuration saved as 'ssh.configuration'. Delete this file to reconfigure. Press enter to continue." />
<propertyfile file="ssh.configuration">
<entry key="ssh.username" value="${ssh.username}" />
<entry key="ssh.keyfile" value="${ssh.keyfile}" />
</propertyfile>
</target>
<target name="website-only" description="Prepares the website for distribution using the lombok version currently 'live'.">
<ant antfile="buildScripts/website.ant.xml" target="website-only" inheritAll="false" />
</target>
<target name="website" depends="version, compile" description="Prepares the website for distribution.">
<ant antfile="buildScripts/website.ant.xml" target="website" inheritAll="false">
<property name="lombok.version" value="${lombok.version}" />
<property name="lombok.fullversion" value="${lombok.fullversion}" />
</ant>
</target>
<target name="website-supporters" depends="ensureSupportersDeps, website-only" description="Updates the supporters repo and adds it to the website build.">
<ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false" />
</target>
<target name="website-supporters-fast" depends="website-only" description="Updates the supporters repo and adds it to the website build.">
<ant antfile="buildScripts/supporters.ant.xml" target="deployToWebsiteBuild" inheritAll="false">
<property name="noUpdateRepo" value="true" />
</ant>
</target>
<target name="website-only-publish" depends="config-ssh, clean, ensureSupportersDeps"
description="Prepares the website (using lombok version current 'live') for distribution and then publishes it to projectlombok.org.">
<ant antfile="buildScripts/website.ant.xml" target="website-only-publish" inheritAll="false">
<property name="ssh.username" value="${ssh.username}" />
<property name="ssh.keyfile" value="${ssh.keyfile}" />
</ant>
</target>
<target name="website-publish" depends="config-ssh, clean, version, ensureSupportersDeps, compile"
description="Prepares the website for distribution and then publishes it to projectlombok.org.">
<ant antfile="buildScripts/website.ant.xml" target="website-publish" inheritAll="false">
<property name="lombok.version" value="${lombok.version}" />
<property name="lombok.fullversion" value="${lombok.fullversion}" />
<property name="ssh.username" value="${ssh.username}" />
<property name="ssh.keyfile" value="${ssh.keyfile}" />
</ant>
</target>
<target name="-mvn-ext">
<condition property="mvn-ext" value=".cmd" else="">
<os family="windows" />
</condition>
</target>
<target name="-version-edge">
<property name="lombok.version.mvn" value="edge-SNAPSHOT" />
</target>
<target name="make-edge-as-maven_snapshot_repo" depends="-version-edge,-mvn-ext,-prepare-maven" description="Create a maven repo for the current snapshot into a build dir. The intent is for you to put that on a server someplace. Will invoke your local mvn installation.">
<property environment="env" />
<delete quiet="true" dir="build/edge-releases" />
<mkdir dir="build/edge-releases" />
<condition property="mvn-exe" value="${env.MAVEN_HOME}/bin/mvn${mvn-ext}" else="mvn${mvn-ext}">
<isset property="env.MAVEN_HOME" />
</condition>
<exec executable="${mvn-exe}" failifexecutionfails="false" resultproperty="mvn-result">
<arg value="deploy:deploy-file" />
<arg value="-Dfile=dist/lombok-${lombok.version}.jar" />
<arg value="-Dsources=dist/lombok-${lombok.version}-sources.jar" />
<arg value="-Djavadoc=dist/lombok-${lombok.version}-javadoc.jar" />
<arg value="-DgroupId=org.projectlombok" />
<arg value="-DartifactId=lombok" />
<arg value="-Dversion=edge-SNAPSHOT" />
<arg value="-DpomFile=build/mavenPublish/pom.xml" />
<arg value="-Durl=file://${basedir}/build/edge-releases" />
</exec>
<condition property="mvn-notfound" value="true">
<not><isset property="mvn-result" /></not>
</condition>
<fail message="mvn is not on your path and/or MAVEN_HOME is not set. Add mvn to your path or set MAVEN_HOME to continue." if="mvn-notfound" />
</target>
<target name="testAp-compile" depends="ensureBuildDeps">
<delete file="build/testAP/META-INF/services/javax.annotation.processing.Processor" quiet="true" />
<ivy:compile destdir="build/testAP" source="1.7" target="1.7" ecj="true">
<bootclasspath path="${rt-openjdk8}" />
<src path="src/testAP" />
</ivy:compile>
<mkdir dir="build/testAP/META-INF" />
<mkdir dir="build/testAP/META-INF/services" />
<echo file="build/testAP/META-INF/services/javax.annotation.processing.Processor">org.projectlombok.testAp.TestAp</echo>
</target>
<target name="testAp-dist" depends="testAp-compile">
<mkdir dir="dist" />
<tstamp>
<format property="releaseTimestamp" pattern="yyyy-MM-dd" />
</tstamp>
<zip destfile="dist/testAp-${releaseTimestamp}.jar">
<fileset dir="." includes="LICENSE" />
<fileset dir="build/testAp" />
</zip>
<copy file="dist/testAp-${releaseTimestamp}.jar" tofile="dist/testAp.jar" />
</target>
<target name="testAp" depends="testAp-dist, dist">
<echo>Running in order: First Lombok, Then testAP</echo>
<delete dir="build/useTestAp" quiet="true" />
<mkdir dir="build/useTestAp" />
<javac verbose="false" source="1.7" target="1.7" destdir="build/useTestAp" includeantruntime="false">
<src path="src/useTestAP" />
<classpath location="dist/lombok.jar" />
<classpath location="dist/testAp.jar" />
<compilerarg value="-processor" />
<compilerarg value="lombok.launch.AnnotationProcessorHider$AnnotationProcessor,org.projectlombok.testAp.TestAp" />
</javac>
<echo>Running in order: First TestAP, Then Lombok</echo>
<delete dir="build/useTestAp" quiet="true" />
<mkdir dir="build/useTestAp" />
<javac verbose="false" source="1.7" target="1.7" destdir="build/useTestAp" includeantruntime="false">
<src path="src/useTestAP" />
<classpath location="dist/lombok.jar" />
<classpath location="dist/testAp.jar" />
<compilerarg value="-processor" />
<compilerarg value="org.projectlombok.testAp.TestAp,lombok.launch.AnnotationProcessorHider$AnnotationProcessor" />
</javac>
</target>
<target name="-compileMapstruct">
<mkdir dir="build/mapstruct" />
<javac includeAntRuntime="false" source="1.9" target="1.9" destdir="build/mapstruct">
<src path="src/j9stubs" />
<!-- This includes org.mapstruct.ap.spi.AstModifyingAnnotationProcessor; putting this on the classpath doesn't work (needs to be internal or a module) so we just add it and then delete the class file for convenience. -->
</javac>
<mkdir dir="build/lombok/secondaryLoading.SCL.lombok/org/mapstruct/ap/spi" />
<move file="build/mapstruct/org/mapstruct/ap/spi/AstModifyingAnnotationProcessor.class" tofile="build/lombok/secondaryLoading.SCL.lombok/org/mapstruct/ap/spi/AstModifyingAnnotationProcessor.SCL.lombok" />
</target>
<target name="-mapstructBindingPrepare" depends="-compileMapstruct">
<mkdir dir="build/mapstruct-module-path" />
<copy file="dist/lombok.jar" todir="build/mapstruct-module-path" />
<jar destfile="build/mapstruct-module-path/mapstruct-processor.jar" basedir="build/mapstruct" includes="org/**">
<manifest>
<attribute name="Automatic-Module-Name" value="org.mapstruct.processor" />
</manifest>
</jar>
<mkdir dir="build/mapstruct-binding/maven" />
<copy tofile="build/mapstruct-binding/maven/pom.xml" overwrite="true" file="doc/mapstruct-binding-maven-pom.xml">
<filterchain>
<replacetokens>
<token key="VERSION" value="${mapstruct-binding.version}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="-mapstructBindingDoc" depends="-mapstructBindingPrepare">
<mkdir dir="build/mapstruct-binding/api" />
<javadoc
Package="true"
packagenames="lombok.*"
sourcepath="src/bindings/mapstruct"
classpath="build/mapstruct"
defaultexcludes="yes"
destdir="build/mapstruct-binding/api"
windowtitle="Lombok Mapstruct Binding"
source="1.8" />
<!-- bugfix for boneheaded javadoc bug where ?is-external=true is inserted before an anchor ref, breaking the anchor ref.
is-external=true doesn't actually do anything, so, we'll just get rid of it. -->
<replaceregexp match="\?is-external=true#" replace="#" flags="gi">
<fileset dir="build/mapstruct-binding/api" includes="**/*.html" />
</replaceregexp>
<jar destfile="dist/lombok-mapstruct-binding-${mapstruct-binding.version}-javadoc.jar" basedir="build/mapstruct-binding/api" includes="**" />
</target>
<target name="-mapstructBindingJar" depends="dist,-mapstructBindingPrepare">
<mkdir dir="build/mapstruct-binding/classes" />
<echo file="build/mapstruct-binding/classes/META-INF/services/org.mapstruct.ap.spi.AstModifyingAnnotationProcessor">lombok.mapstruct.NotifierHider$AstModificationNotifier</echo>
<javac includeAntRuntime="false" source="1.9" target="1.9" destdir="build/mapstruct-binding/classes" modulepath="build/mapstruct-module-path">
<src path="src/bindings/mapstruct" />
</javac>
<jar destfile="dist/lombok-mapstruct-binding-${mapstruct-binding.version}.jar" basedir="build/mapstruct-binding/classes" includes="**" />
</target>
<target name="-mapstructBindingSrc" depends="-mapstructBindingJar">
<jar destfile="dist/lombok-mapstruct-binding-${mapstruct-binding.version}-sources.jar" basedir="src/bindings/mapstruct" includes="**" />
</target>
<target name="mapstructBinding" depends="dist,-mapstructBindingJar,-mapstructBindingDoc,-mapstructBindingSrc">
</target>
<target name="mapstructMaven" depends="mapstructBinding,-mvn-ext" description="Create a maven repo for mapstruct binding into a build dir.">
<property environment="env" />
<delete quiet="true" dir="build/mapstruct-binding-maven" />
<mkdir dir="build/mapstruct-binding-maven" />
<condition property="mvn-exe" value="${env.MAVEN_HOME}/bin/mvn${mvn-ext}" else="mvn${mvn-ext}">
<isset property="env.MAVEN_HOME" />
</condition>
<exec executable="${mvn-exe}" failifexecutionfails="false" resultproperty="mvn-result">
<arg value="deploy:deploy-file" />
<arg value="-Dfile=dist/lombok-mapstruct-binding-${mapstruct-binding.version}.jar" />
<arg value="-Dsources=dist/lombok-mapstruct-binding-${mapstruct-binding.version}-sources.jar" />
<arg value="-Djavadoc=dist/lombok-mapstruct-binding-${mapstruct-binding.version}-javadoc.jar" />
<arg value="-DgroupId=org.projectlombok" />
<arg value="-DartifactId=lombok-mapstruct-binding" />
<arg value="-Dversion=${mapstruct-binding.version}" />
<arg value="-DpomFile=build/mapstruct-binding/maven/pom.xml" />
<arg value="-Durl=file://${basedir}/build/mapstruct-binding-maven" />
</exec>
<condition property="mvn-notfound" value="true">
<not><isset property="mvn-result" /></not>
</condition>
<fail message="mvn is not on your path and/or MAVEN_HOME is not set. Add mvn to your path or set MAVEN_HOME to continue." if="mvn-notfound" />
</target>
</project>
|