Commit Graph

3 Commits

Author SHA1 Message Date
Brian Clozel a8d553218c Introduce Gradle Toolchain support in build
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
2021-03-15 14:33:41 +01:00
Brian Clozel fbc1b96aa6 Add git repo as output for build tasks
This is required for exporting the Gradle Build Scan URL to
notifications.

See gh-22490
2020-04-29 11:05:50 +02:00
Brian Clozel 60725294e2 Only run checks in pipelines with JDK variants
This commit updates the build pipeline to only run the checks
(formatting and tests) with the build when non-JDK8 variants are used
for sanity checks.

See gh-22490
2020-04-28 15:34:37 +02:00