Description: Build with Java 11, using the javac 'release' parameter to replace the bootclasspaths
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/buildScripts/compile.ant.xml
+++ b/buildScripts/compile.ant.xml
@@ -76,7 +76,6 @@
 	
 	<target name="create.mavenEcjBootstrapAgent" depends="-setup.build" description="Compiles the Maven ECJ bootstrap agent">
 		<ivy:compile destdir="build/mavenEcjBootstrapAgent" source="1.6" target="1.6" ecj="true">
-			<bootclasspath path="${jdk6-rt.loc}" />
 			<src path="src/mavenEcjBootstrapAgent" />
 		</ivy:compile>
 		<mkdir dir="build/lombok-main/lombok/launch" />
@@ -107,11 +106,11 @@
 			Instead of depending on conflicting versions, we write stub files; just enough for compilation to succeed.
 			
 			However, the stubs themselves also have a ton of dependencies; to avoid _that_, we have stubs for stubs, too! -->
-		<ivy:compile destdir="build/stubsstubs" source="1.5" target="1.5" ecj="true">
+		<ivy:compile destdir="build/stubsstubs" release="8" ecj="false">
 			<bootclasspath path="${jdk6-rt.loc}" />
 			<src path="src/stubsstubs" />
 		</ivy:compile>
-		<ivy:compile destdir="build/stubs" source="1.5" target="1.5" ecj="true">
+		<ivy:compile destdir="build/stubs" release="8" ecj="false">
 			<bootclasspath path="${jdk6-rt.loc}" />
 			<src path="src/stubs" />
 			<src path="src/javac-only-stubs" />
@@ -141,30 +140,26 @@
 			</filterchain>
 		</copy>
 		
-		<ivy:compile destdir="build/lombok-transplants" source="1.4" target="1.4" ecj="true">
-			<bootclasspath location="build/stubs" />
-			<bootclasspath path="${jdk6-rt.loc}" />
+		<ivy:compile destdir="build/lombok-transplants" source="1.4" target="1.4" ecj="false">
+			<compilerarg value="-Xbootclasspath/p:build/stubs" />
 			<src path="build/transformedSources" />
 		</ivy:compile>
 		
-		<ivy:compile destdir="build/lombok-transplants/Class50" source="1.4" target="1.6" ecj="true">
-			<bootclasspath location="build/stubs" />
-			<bootclasspath path="${jdk6-rt.loc}" />
+		<ivy:compile destdir="build/lombok-transplants/Class50" source="1.4" target="1.6" ecj="false">
+			<compilerarg value="-Xbootclasspath/p:build/stubs" />
 			<src path="build/transformedSources" />
 		</ivy:compile>
 		
-		<ivy:compile destdir="build/lombok-utils" source="1.5" target="1.5" ecj="true">
-			<bootclasspath location="build/stubs" />
-			<bootclasspath path="${jdk6-rt.loc}" />
+		<ivy:compile destdir="build/lombok-utils" source="1.5" target="1.5" ecj="false">
+			<compilerarg value="-Xbootclasspath/p:build/stubs" />
 			<src path="src/utils" />
 			<exclude name="lombok/javac/**" />
 			<classpath location="build/lombok-utils" />
 			<classpath refid="cp.javac6" />
 			<classpath refid="cp.ecj8" />
 		</ivy:compile>
-		<ivy:compile destdir="build/lombok-utils6" source="1.6" target="1.6" ecj="true">
-			<bootclasspath location="build/stubs" />
-			<bootclasspath path="${jdk6-rt.loc}" />
+		<ivy:compile destdir="build/lombok-utils6" source="1.6" target="1.6" ecj="false">
+			<compilerarg value="-Xbootclasspath/p:build/stubs" />
 			<src path="src/utils" />
 			<include name="lombok/javac/**" />
 			<classpath refid="cp.javac6" />
@@ -174,9 +169,10 @@
 		<!--
 			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-main" source="1.6" target="1.6" ecj="true" nowarn="true">
-			<bootclasspath location="build/stubs" />
-			<bootclasspath path="${jdk6-rt.loc}" />
+		<ivy:compile destdir="build/lombok-main" source="1.6" target="1.6" ecj="false" nowarn="true">
+			<compilerarg value="-Xbootclasspath/p:build/stubs" />
+			<classpath path="build/stubs" />
+			<classpath path="build/stubsstubs" />
 			<src path="src/launch" />
 			<src path="src/core" />
 			<src path="src/installer" />
@@ -191,9 +187,8 @@
 		</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-main/Class50" source="1.5" target="1.6" ecj="true">
-			<bootclasspath location="build/stubs" />
-			<bootclasspath path="${jdk6-rt.loc}" />
+		<ivy:compile destdir="build/lombok-main/Class50" source="1.5" target="1.6" ecj="false">
+			<compilerarg value="-Xbootclasspath/p:build/stubs" />
 			<src path="src/eclipseAgent" />
 			<include name="lombok/launch/PatchFixesHider.java" />
 			<classpath refid="cp.build" />
