7c139e059a
In Gradle 5.3, there was a change to the internal logic of publishing `SoftwareComponent`s with the 'maven-publish' plugin, and, simultaneously, a new public API was introduced for user-defined software components, see https://github.com/gradle/gradle/pull/8399 Earlier, the 'maven-publish' plugin used the Gradle `Usage` attribute values to arrange the dependencies of a software component's `UsageContext`s into the Maven scopes. Now that mechanism doesn't work and a `SoftwareComponent` must provide an explicit mapping of the variants to POMs by using the `SoftwareComponentFactory.adhoc` API. However, the new API lacks some features we need to properly publish an MPP, such as adding a component to another one as a variant, so we still create old-style software components under the hood and then wrap them into the new API (and then wrap the adhoc components once again). We also continue to use the old-style components for Kotlin-specific logic like finding a target in another project that a dependency resolved to, as the components produced by the new API lack crucial information that is used in the logic, like references to `KotlinCompilation`s. Issue #KT-30379 Fixed