diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2021-03-16 17:09:13 +0100 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2021-03-16 17:09:13 +0100 |
commit | 476a43b970b01eafcc053eead69db57a0ab854cf (patch) | |
tree | 5055f27404a968952129ee493bbf4f572655f2a6 /buildScripts | |
parent | a49aec582b129687cee7d2c87b586a20bceb0c43 (diff) | |
download | lombok-476a43b970b01eafcc053eead69db57a0ab854cf.tar.gz lombok-476a43b970b01eafcc053eead69db57a0ab854cf.tar.bz2 lombok-476a43b970b01eafcc053eead69db57a0ab854cf.zip |
[build] sped up the build considerable.
We used to use the mango SPI processor, but this had two major issues:
* ecj wouldn't run annotation processors, requiring a separate proc:only compile run with javac
* mangoSPI couldn't do incremental compilation, so this required a full rebuild just to generate SPI files, every time.
Addressed by updating to IPP40 which does support explicit annotation processors even for ecj, and
adding our own SPI generating annotation processor to the build which can deal with incrementals.
There are some limits; removing a `@Provides` annotation on an existing type will need a full clean to pick that up, for example.
These limits seem quite exotic, though.
Diffstat (limited to 'buildScripts')
-rw-r--r-- | buildScripts/compile.ant.xml | 64 | ||||
-rw-r--r-- | buildScripts/create-eclipse-project.ant.xml | 3 | ||||
-rw-r--r-- | buildScripts/ivy.xml | 1 | ||||
-rw-r--r-- | buildScripts/setup.ant.xml | 4 |
4 files changed, 28 insertions, 44 deletions
diff --git a/buildScripts/compile.ant.xml b/buildScripts/compile.ant.xml index bc1d3e8d..0d08d482 100644 --- a/buildScripts/compile.ant.xml +++ b/buildScripts/compile.ant.xml @@ -1,5 +1,5 @@ <!-- - Copyright (C) 2020 The Project Lombok Authors. + Copyright (C) 2020-2021 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 @@ -50,7 +50,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil <echo level="info">Lombok version: ${lombok.version} (${lombok.fullversion})</echo> </target> - <property name="packing.basedirs" value="build/lombok-transplants,build/lombok-utils,build/lombok-utils6,build/lombok-main,build/lombok-main8,build/lombok-meta,build/lombok-deps" /> + <property name="packing.basedirs" value="build/lombok-transplants,build/lombok-utils,build/lombok-utils6,build/lombok-main,build/lombok-main8,build/lombok-deps" /> <loadresource property="packing.basedirs.colon"> <propertyresource name="packing.basedirs" /> <filterchain><tokenfilter> @@ -62,21 +62,31 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil <pathelement path="${packing.basedirs.colon}" /> </path> - <target name="compile" depends="version, deps, -setup.build" description="Compiles the code"> + <target name="-compile.spiProcessor" depends="version, -setup.build" description="Compiles the services file generating processor"> + <ivy:compile destdir="build/spiProcessor" source="1.8" target="1.8" ecj="true"> + <src path="src/spiProcessor" /> + <classpath location="build/spiProcessor" /> + </ivy:compile> + <mkdir dir="build/spiProcessor/META-INF/services" /> + <echo file="build/spiProcessor/META-INF/services/javax.annotation.processing.Processor">lombok.spi.SpiProcessor</echo> + <jar destfile="build/spiProcessor.jar"> + <fileset dir="build/spiProcessor" /> + </jar> + </target> + + <target name="compile" depends="version, deps, -setup.build, -compile.spiProcessor" description="Compiles the code"> <!-- 1. Compile stubs. 2. Compile transplants. 3. Compile lombok-utils. - 4. Compile lombok. - 5. Run SPI processor. - 6. Create other manifest entries. --> + 4. Compile lombok. --> <!-- 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 (as lombok is an annotation processor), which means if there are bugs in it, you can't compile anymore until you 'ant clean'. That's very undesirable. 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/META-INF/services/javax.annotation.processing.Processor" quiet="true" /> + <delete file="build/lombok-main/META-INF/services/javax.annotation.processing.Processor" quiet="true" /> <!-- first, compile stubs. Lombok needs to produce class files that run in a wide variety of JDK, javac, and ecj/eclipse versions. @@ -162,7 +172,8 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil <classpath refid="cp.build" /> <classpath refid="cp.eclipse-oxygen" /> <classpath refid="cp.javac6" /> - <classpath path="build/lombok-utils:build/lombok-utils6:build/lombok-main" /> + <classpath path="build/lombok-utils:build/lombok-utils6:build/lombok-main:build/spiProcessor.jar" /> + <annotationProcessor jar="build/spiProcessor.jar" processor="lombok.spi.SpiProcessor" /> </ivy:compile> <!-- This is really part of the eclipse agent, but references lombok, so that had to be compiled first --> @@ -183,7 +194,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil <bootclasspath location="build/stubs" /> <src path="src/core8" /> <classpath refid="cp.javac8" /> - <classpath path="build/lombok-main:build/lombok-main8" /> + <classpath path="build/lombok-main:build/lombok-main8:build" /> </ivy:compile> <!-- @@ -195,37 +206,11 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil <classpath refid="cp.build" /> </ivy:compile> - <!-- Run the SPI processor to create the services files listing all lombok handlers --> - <delete dir="build/lombok-proc-result" quiet="true" /> - <ivy:compile destdir="build/lombok-proc-result" release="9" nowarn="true"> - <classpath location="build/stubs" /> - <compilerarg value="-proc:only" /> - <compilerarg value="-processor" /> - <compilerarg value="org.mangosdk.spi.processor.SpiProcessor" /> - <src path="src/core" /> - <src path="src/installer" /> - <src path="src/eclipseAgent" /> - <src path="src/delombok" /> - <classpath refid="cp.build" /> - <classpath refid="cp.javac6" /> - <classpath refid="cp.eclipse-oxygen" /> - <classpath path="build/lombok-utils:build/lombok-utils6:build/lombok-main" /> - </ivy:compile> - - <mkdir dir="build/lombok-meta" /> - - <copy todir="build/lombok-meta"> - <fileset dir="build/lombok-proc-result"> - <include name="META-INF/services/*" /> - </fileset> - </copy> - - <mkdir dir="build/lombok-meta/META-INF" /> - <mkdir dir="build/lombok-meta/META-INF/services" /> - <echo file="build/lombok-meta/META-INF/services/javax.annotation.processing.Processor">lombok.launch.AnnotationProcessorHider$AnnotationProcessor + <mkdir dir="build/lombok-main/META-INF/services" /> + <echo file="build/lombok-main/META-INF/services/javax.annotation.processing.Processor">lombok.launch.AnnotationProcessorHider$AnnotationProcessor lombok.launch.AnnotationProcessorHider$ClaimingProcessor</echo> - <mkdir dir="build/lombok-meta/META-INF/gradle" /> - <echo file="build/lombok-meta/META-INF/gradle/incremental.annotation.processors">lombok.launch.AnnotationProcessorHider$AnnotationProcessor,isolating + <mkdir dir="build/lombok-main/META-INF/gradle" /> + <echo file="build/lombok-main/META-INF/gradle/incremental.annotation.processors">lombok.launch.AnnotationProcessorHider$AnnotationProcessor,isolating lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo> </target> @@ -272,7 +257,6 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo> </patternset> <fileset dir="build/lombok-main"><patternset refid="packing.entrypoints" /></fileset> - <fileset dir="build/lombok-meta"><patternset refid="packing.entrypoints" /></fileset> <!-- now include everything else but renamed for the shadowloader system, to make these classes invisible to other projects. --> <patternset id="packing.shadowed"> diff --git a/buildScripts/create-eclipse-project.ant.xml b/buildScripts/create-eclipse-project.ant.xml index 383ebd8b..909645d0 100644 --- a/buildScripts/create-eclipse-project.ant.xml +++ b/buildScripts/create-eclipse-project.ant.xml @@ -1,5 +1,5 @@ <!-- - Copyright (C) 2010-2020 The Project Lombok Authors. + Copyright (C) 2010-2021 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 @@ -28,6 +28,7 @@ This buildfile is part of projectlombok.org. It creates the infrastructure neede <target name="eclipse.projectfiles" depends="deps"> <ivy:eclipsegen source="1.6" srcout="bin/main"> + <srcdir dir="src/spiProcessor" /> <srcdir dir="src/core" /> <srcdir dir="src/core8" /> <srcdir dir="src/launch" /> diff --git a/buildScripts/ivy.xml b/buildScripts/ivy.xml index 94549a00..7994af89 100644 --- a/buildScripts/ivy.xml +++ b/buildScripts/ivy.xml @@ -38,7 +38,6 @@ <dependency org="org.projectlombok" name="lombok.patcher" rev="0.40" conf="build,stripe->default" /> <dependency org="zwitserloot.com" name="cmdreader" rev="1.2" conf="build,stripe->runtime" /> - <dependency org="projectlombok.org" name="spi" rev="0.2.7" conf="build" /> <dependency org="org.apache.ant" name="ant" rev="1.10.5" conf="build->default" /> <!-- test deps --> diff --git a/buildScripts/setup.ant.xml b/buildScripts/setup.ant.xml index e71f8143..f81c5134 100644 --- a/buildScripts/setup.ant.xml +++ b/buildScripts/setup.ant.xml @@ -1,5 +1,5 @@ <!-- - Copyright (C) 2020 The Project Lombok Authors. + Copyright (C) 2020-2021 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 @@ -140,7 +140,7 @@ This buildfile is part of projectlombok.org. It sets up the build itself. <target name="-ipp.load" depends="-ipp.download"> <taskdef classpath="lib/ivyplusplus.jar" resource="com/zwitserloot/ivyplusplus/antlib.xml" uri="antlib:com.zwitserloot.ivyplusplus" /> - <ivy:ensureippversion version="1.38" property="ivyplusplus.minimumAvailable" /> + <ivy:ensureippversion version="1.40" property="ivyplusplus.minimumAvailable" /> </target> <target name="-ipp.redownload" unless="ivyplusplus.minimumAvailable"> |