• B
    Introduce Gradle Toolchain support in build · a8d55321
    Brian Clozel 提交于
    Prior to this commit, the Spring Framework build would rely on
    setting a custom Java HOME for building all sources and tests
    with that JDK.
    
    This approach is not flexible enough, since we would be testing
    the source compatibility against a recent JDK, but not a common
    case experienced by the community: compiling and running
    application code with a recent JDK and the official, JDK8-based
    Framework artifacts.
    This method is also limiting our choice of JDKs to the ones
    currently supported by Gradle itself.
    
    This commit introduces the support of Gradle JVM Toolchains in
    the Spring Framework build.
    
    We can now select a specific JDK for compiling the main
    SourceSets (Java, Groovy and Kotlin) and another one for
    compiling and running the test SourceSets:
    
    `./gradlew check -PmainToolChain=8 -PtestToolchain=15`
    
    Gradle will automatically find the JDKs present on the host or
    download one automcatically. You can find out about the ones
    installed on your host using:
    
    `./gradlew -q javaToolchains`
    
    Finally, this commit also refactors the CI infrastructure to:
    
    * only have a single CI image (with all the supported JDKs)
    * use this new feature to compile with JDK8 but test it
    against JDK11 and JDK15.
    
    Closes gh-25787
    a8d55321
setup.sh 1.4 KB