spring-boot/buildSrc
Andy Wilkinson 273600bcdd Retain distinction between compile and runtime deps of optional deps
Previously, the optional configuration was added to the compile and
runtime classpaths of each source set and the the javadoc classpath
as well. This had a few disadvantages, the most notable of which is
that it meant that the configuration was ifrst resolved and then
the outcome of the resolution was added to the compile and runtime
classpaths. As a result, none of the attributes on the compile and
runtime classpaths were considered to influence variant selection.

This commit reworks the optional dependencies plugin so that the
compile and runtime classpaths of each source set are now configured
to extend from the optional configuration. This allows each
classpath configuration's attributes to influence the dependencies
that are selected from the optional configuration during resolution.
For example, when resolving the compile classpath, compile
dependencies (Usage.JAVA_API) will be selected and when resolving the
runtime classpath, runtime dependencies (Usage.JAVA_RUNTIME) will be
selected.

The above-described change means that runtime dependencies of an
optional dependencies will no longer leak into the compile classpath.
As a result of this, our Gradle plugin's test infrastructure has
been updated so that it no longer references runtime dependencies of
the Kotlin Gradle plugin at compile time.

Closes gh-27965
2021-09-13 10:47:14 +01:00
..
src Retain distinction between compile and runtime deps of optional deps 2021-09-13 10:47:14 +01:00
build.gradle Add dependency lock and constraint version alignment to Bomr 2021-06-23 17:09:24 +01:00
gradle.properties Merge branch '2.2.x' into 2.3.x 2020-12-04 18:21:57 -08:00
settings.gradle Adopt Gradle Enterprise Conventions Plugin 2020-02-04 11:24:40 +00:00