[build] Remove support for JDK 8. #1120
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: 7a32bb9
Context: https://stackoverflow.com/questions/55853220/handling-change-in-newlines-by-xml-transformation-for-cdata-from-java-8-to-java
Context: https://bugs.java.com/bugdatabase/view_bug?bug_id=8223291
Background: Since commit bc5bcf4, two JDKs were required in order to fully build and test Java.Interop: JDK 1.8 and JDK-11. This is because
src/Java.Interoprequires JDK-11+ to build, while some unit tests required JDK 1.8 to pass (because Java XML output changed between JDK 1.8 and JDK-11; see also 7a32bb9).Recently, a question arose: how well does .NET Android work with JDK 17? (Android Studio recently bumped the bundled JDK from JDK-11 to JDK-17.) The "straightforward" approach of "provision JDK-17 and just build everything with JDK-17" quickly meant that Java.Interop needed to build under JDK-17.
This in turn segued into a "how do I make the MSBuild property meanings clearer", as
$(JavaCPath)would be for JDK 1.8, while$(JavaC11Path)was for JDK-11, but with JDK-17 being provisioned$(JavaC11Path)actually was for JDK-17, which is just confusing.After discussion, we decided that we don't need to continue using JDK 1.8 anymore. Android API-31 requires JDK-11 in order to use various Android SDK build tools, and the Google Play Store requires a target SDK version of API-33 starting 2023-Aug. There is not much point in maintaining JDK 1.8 support.
JDK 11 or later is now required.
Update to use Gradle 8.1.1. This is needed for later JDK-17 support.
java/util/Collection.javaexisted to help test API documentation import (when$ANDROID_SDK_PATHis set). JDK-11 does not support compilingjava/util/Collection.javaanymore; it errors out with:"Rename" this type to
android/animation/TypeEvaluator.java, and update the API documentation import tests accordingly.Update the
ExpectedTypeDeclaration.MajorVersionvalues to 0x37.The
.classfiles for nested types has seen the addition of a newNestHostconstant; see also:Update
ExpectedTypeDeclaration.ConstantPoolCountas appropriate.Additional
NestHost-related fallout is thatJavaType.classnow includescom/xamarin/JavaType$RNC$RPNCin theInnerClassestable.Update
tools/java-source-utilsunit tests so that JDK-11 can now be used to run (and pass!) the unit tests. (This previously required JDK 1.8.)