diff options
Diffstat (limited to 'buildScripts/compile.ant.xml')
-rw-r--r-- | buildScripts/compile.ant.xml | 64 |
1 files changed, 24 insertions, 40 deletions
diff --git a/buildScripts/compile.ant.xml b/buildScripts/compile.ant.xml index bc1d3e8d..23a8a63c 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="create.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="dist/spiProcessor.jar"> + <fileset dir="build/spiProcessor" /> + </jar> + </target> + + <target name="compile" depends="version, deps, -setup.build, create.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:dist/spiProcessor.jar" /> + <annotationProcessor jar="dist/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"> |