[Gradle] PomDependenciesRewriter: Fix missing 'component' in configuration cache
^KT-60159 Verification Pending
This commit is contained in:
committed by
Space Team
parent
b9a520b593
commit
2ab2f408f3
+1
-1
@@ -1257,7 +1257,7 @@ open class NewMultiplatformIT : BaseGradleIT() {
|
|||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
)
|
)
|
||||||
|
|
||||||
build("clean", "publish") {
|
build("clean", "publish", options = defaultBuildOptions().copy(configurationCache = true)) {
|
||||||
assertSuccessful()
|
assertSuccessful()
|
||||||
assertFileContains(
|
assertFileContains(
|
||||||
"repo/com/exampleapp/sample-app-nodejs/1.0/sample-app-nodejs-1.0.pom",
|
"repo/com/exampleapp/sample-app-nodejs/1.0/sample-app-nodejs-1.0.pom",
|
||||||
|
|||||||
+1
-7
@@ -17,7 +17,6 @@ import org.gradle.api.internal.component.UsageContext
|
|||||||
import org.gradle.api.provider.Provider
|
import org.gradle.api.provider.Provider
|
||||||
import org.jetbrains.kotlin.gradle.dsl.multiplatformExtensionOrNull
|
import org.jetbrains.kotlin.gradle.dsl.multiplatformExtensionOrNull
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinCompilationToRunnableFiles
|
|
||||||
import org.jetbrains.kotlin.gradle.plugin.KotlinTargetComponent
|
import org.jetbrains.kotlin.gradle.plugin.KotlinTargetComponent
|
||||||
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.Companion.kotlinPropertiesProvider
|
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider.Companion.kotlinPropertiesProvider
|
||||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinUsageContext.MavenScope
|
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinUsageContext.MavenScope
|
||||||
@@ -31,9 +30,7 @@ internal data class ModuleCoordinates(
|
|||||||
|
|
||||||
internal class PomDependenciesRewriter(
|
internal class PomDependenciesRewriter(
|
||||||
project: Project,
|
project: Project,
|
||||||
|
component: KotlinTargetComponent
|
||||||
@field:Transient
|
|
||||||
private val component: KotlinTargetComponent
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// Get the dependencies mapping according to the component's UsageContexts:
|
// Get the dependencies mapping according to the component's UsageContexts:
|
||||||
@@ -52,9 +49,6 @@ internal class PomDependenciesRewriter(
|
|||||||
pomXml: XmlProvider,
|
pomXml: XmlProvider,
|
||||||
includeOnlySpecifiedDependencies: Provider<Set<ModuleCoordinates>>? = null
|
includeOnlySpecifiedDependencies: Provider<Set<ModuleCoordinates>>? = null
|
||||||
) {
|
) {
|
||||||
if (component !is SoftwareComponentInternal)
|
|
||||||
return
|
|
||||||
|
|
||||||
val dependenciesNode = (pomXml.asNode().get("dependencies") as NodeList).filterIsInstance<Node>().singleOrNull() ?: return
|
val dependenciesNode = (pomXml.asNode().get("dependencies") as NodeList).filterIsInstance<Node>().singleOrNull() ?: return
|
||||||
|
|
||||||
val dependencyNodes = (dependenciesNode.get("dependency") as? NodeList).orEmpty().filterIsInstance<Node>()
|
val dependencyNodes = (dependenciesNode.get("dependency") as? NodeList).orEmpty().filterIsInstance<Node>()
|
||||||
|
|||||||
Reference in New Issue
Block a user