aboutsummaryrefslogtreecommitdiff
path: root/buildScripts/compile.ant.xml
diff options
context:
space:
mode:
Diffstat (limited to 'buildScripts/compile.ant.xml')
-rw-r--r--buildScripts/compile.ant.xml97
1 files changed, 54 insertions, 43 deletions
diff --git a/buildScripts/compile.ant.xml b/buildScripts/compile.ant.xml
index c456ec75..54017496 100644
--- a/buildScripts/compile.ant.xml
+++ b/buildScripts/compile.ant.xml
@@ -28,15 +28,14 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil
<!-- compiles just 'version.java' and runs the produced class file, setting up the various version properties -->
<target name="version" depends="ipp.setup, deps.jdk-runtime, -setup.build" 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">
+ <ivy:compile destdir="build/lombok-version" source="1.5" target="1.5" ecj="true" nowarn="true">
<bootclasspath path="${jdk6-rt.loc}" />
<src path="src/core" />
<include name="lombok/core/Version.java" />
</ivy:compile>
<java
classname="lombok.core.Version"
- classpath="build/lombok"
+ classpath="build/lombok-version"
failonerror="true"
output="build/version.txt">
<arg value="full" />
@@ -44,18 +43,30 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil
<ivy:loadversion property="lombok.fullversion" file="build/version.txt" />
<java
classname="lombok.core.Version"
- classpath="build/lombok"
+ classpath="build/lombok-version"
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>
+ <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" />
+ <loadresource property="packing.basedirs.colon">
+ <propertyresource name="packing.basedirs" />
+ <filterchain><tokenfilter>
+ <filetokenizer/>
+ <replacestring from="," to=":" />
+ </tokenfilter></filterchain>
+ </loadresource>
+ <path id="packing.basedirs.path">
+ <pathelement path="${packing.basedirs.colon}" />
+ </path>
+
<target name="compile" depends="version, deps, -setup.build" description="Compiles the code">
<!--
1. Compile stubs.
- 2. Compile lombok-utils.
- 3. Compile transplants.
+ 2. Compile transplants.
+ 3. Compile lombok-utils.
4. Compile lombok.
5. Run SPI processor.
6. Create other manifest entries. -->
@@ -65,7 +76,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil
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-INF/services/javax.annotation.processing.Processor" quiet="true" />
+ <delete file="build/lombok-meta/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.
@@ -106,40 +117,40 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil
</filterchain>
</copy>
- <ivy:compile destdir="build/lombok" source="1.4" target="1.4" ecj="true">
+ <ivy:compile destdir="build/lombok-transplants" source="1.4" target="1.4" ecj="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${jdk6-rt.loc}" />
<src path="build/transformedSources" />
</ivy:compile>
- <ivy:compile destdir="build/lombok/Class50" source="1.4" target="1.6" ecj="true">
+ <ivy:compile destdir="build/lombok-transplants/Class50" source="1.4" target="1.6" ecj="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${jdk6-rt.loc}" />
<src path="build/transformedSources" />
</ivy:compile>
- <ivy:compile destdir="build/lombok" source="1.5" target="1.5" ecj="true">
+ <ivy:compile destdir="build/lombok-utils" source="1.5" target="1.5" ecj="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${jdk6-rt.loc}" />
<src path="src/utils" />
<exclude name="lombok/javac/**" />
- <classpath path="build/lombok" />
+ <classpath location="build/lombok-utils" />
<classpath refid="cp.javac6" />
<classpath refid="cp.ecj8" />
</ivy:compile>
- <ivy:compile destdir="build/lombok" source="1.6" target="1.6" ecj="true">
+ <ivy:compile destdir="build/lombok-utils6" source="1.6" target="1.6" ecj="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${jdk6-rt.loc}" />
<src path="src/utils" />
<include name="lombok/javac/**" />
- <classpath location="build/lombok" />
<classpath refid="cp.javac6" />
+ <classpath path="build/lombok-utils:build/lombok-utils6" />
</ivy:compile>
<!--
compile lombok proper. We target java 1.6 to be as compatible with older releases as we can, using a JDK6 boot rt to ensure we don't
use API that didn't exist in those versions yet. -->
- <ivy:compile destdir="build/lombok" source="1.6" target="1.6" ecj="true" nowarn="true">
+ <ivy:compile destdir="build/lombok-main" source="1.6" target="1.6" ecj="true" nowarn="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${jdk6-rt.loc}" />
<src path="src/launch" />
@@ -148,40 +159,39 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil
<src path="src/eclipseAgent" />
<src path="src/delombok" />
<exclude name="**/*Transplants.java" />
- <classpath location="build/lombok" />
<classpath refid="cp.build" />
<classpath refid="cp.eclipse-oxygen" />
<classpath refid="cp.javac6" />
+ <classpath path="build/lombok-utils:build/lombok-utils6:build/lombok-main" />
</ivy:compile>
<!-- This is really part of the eclipse agent, but references lombok, so that had to be compiled first -->
- <ivy:compile destdir="build/lombok/Class50" source="1.5" target="1.6" ecj="true">
+ <ivy:compile destdir="build/lombok-main/Class50" source="1.5" target="1.6" ecj="true">
<bootclasspath location="build/stubs" />
<bootclasspath path="${jdk6-rt.loc}" />
<src path="src/eclipseAgent" />
<include name="lombok/launch/PatchFixesHider.java" />
- <classpath location="build/lombok" />
<classpath refid="cp.build" />
<classpath refid="cp.eclipse-oxygen" />
+ <classpath path="build/lombok-utils:build/lombok-utils6:build/lombok-main" />
</ivy:compile>
<!--
a couple of classes to cater to the bits of javac8+ that require j8 language constructs/API types; the main lombok
compile refers to these via reflection -->
- <ivy:compile destdir="build/lombok" source="1.8" target="1.8" ecj="true" nowarn="true" includesystembootclasspath="true">
+ <ivy:compile destdir="build/lombok-main8" source="1.8" target="1.8" ecj="true" nowarn="true" includesystembootclasspath="true">
<bootclasspath location="build/stubs" />
<src path="src/core8" />
- <classpath location="build/lombok" />
<classpath refid="cp.javac8" />
+ <classpath path="build/lombok-main:build/lombok-main8" />
</ivy:compile>
<!--
We also act as a jigsaw module so that module-based compile runs can use module-style dependency management. Obviously,
that bit we can only compile with jdk9+. -->
- <ivy:compile destdir="build/lombok" release="9">
+ <ivy:compile destdir="build/lombok-main" release="9">
<src path="src/core9" />
<compilerarg value="-Xlint:none" />
- <classpath location="build/lombok" />
<classpath refid="cp.build" />
</ivy:compile>
@@ -196,24 +206,26 @@ This buildfile is part of projectlombok.org. It takes care of compiling and buil
<src path="src/installer" />
<src path="src/eclipseAgent" />
<src path="src/delombok" />
- <classpath location="build/lombok" />
<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>
- <copy todir="build/lombok">
+ <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-INF" />
- <mkdir dir="build/lombok/META-INF/services" />
- <echo file="build/lombok/META-INF/services/javax.annotation.processing.Processor">lombok.launch.AnnotationProcessorHider$AnnotationProcessor
+ <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
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
+ <mkdir dir="build/lombok-meta/META-INF/gradle" />
+ <echo file="build/lombok-meta/META-INF/gradle/incremental.annotation.processors">lombok.launch.AnnotationProcessorHider$AnnotationProcessor,isolating
lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo>
</target>
@@ -226,7 +238,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo>
</target>
<target name="-deps.unpack" depends="deps">
- <ivy:cachedunjar dest="build/lombok" marker="build/unpackDeps.marker">
+ <ivy:cachedunjar dest="build/lombok-deps" marker="build/unpackDeps.marker">
<path refid="cp.stripe" />
</ivy:cachedunjar>
</target>
@@ -248,7 +260,7 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo>
lombok classes served up in autocomplete dialogs, amongst other reasons.
Thus, we list here only the few class files that serve as 'entry points'. -->
- <fileset dir="build/lombok">
+ <patternset id="packing.entrypoints">
<include name="module-info.class" />
<include name="lombok/*.class" />
<include name="lombok/experimental/**" />
@@ -257,21 +269,20 @@ lombok.launch.AnnotationProcessorHider$ClaimingProcessor,isolating</echo>
<include name="lombok/delombok/ant/Tasks*" />
<include name="lombok/javac/apt/Processor.class" />
<include name="lombok/META-INF/**" />
- </fileset>
+ </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 clsases invisible to other projects. -->
+ <!-- now include everything else but renamed for the shadowloader system, to make these classes invisible to other projects. -->
+ <patternset id="packing.shadowed">
+ <exclude name="com/sun/tools/javac/**" />
+ <invert><patternset refid="packing.entrypoints" /></invert>
+ </patternset>
<mappedresources>
- <fileset dir="build/lombok">
- <exclude name="com/sun/tools/javac/**" />
- <exclude name="module-info.class" />
- <exclude name="lombok/*.class" />
- <exclude name="lombok/experimental/**" />
- <exclude name="lombok/extern/**" />
- <exclude name="lombok/launch/**" />
- <exclude name="lombok/delombok/ant/Tasks*" />
- <exclude name="lombok/javac/apt/Processor.class" />
- <exclude name="lombok/META-INF/**" />
- </fileset>
+ <multirootfileset basedirs="${packing.basedirs}">
+ <patternset refid="packing.shadowed" />
+ </multirootfileset>
<firstmatchmapper>
<globmapper from="*.class" to="*.SCL.lombok" />
<identitymapper />