[Gradle] Test CInterop commonization doesn't trigger configuration resolution
...before taskGraph is ready KT-56858 Verification Pending
This commit is contained in:
committed by
Space Team
parent
fc33892e70
commit
792c08ec7d
+4
-1
@@ -96,6 +96,9 @@ abstract class MppCInteropDependencyTransformationIT : BaseGradleIT() {
|
||||
/* Assert p2 & p3 compiled tests */
|
||||
assertTasksExecuted(":p2:compileTestKotlinLinuxX64")
|
||||
assertTasksExecuted(":p3:compileTestKotlinLinuxX64")
|
||||
|
||||
/* Configurations should not be resolved during configuration phase */
|
||||
assertNotContains("Configuration resolved before Task Graph is ready")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,7 +260,7 @@ abstract class MppCInteropDependencyTransformationIT : BaseGradleIT() {
|
||||
)
|
||||
project.build(":p3:transformNativeMainCInteropDependenciesMetadata", options = repositoryDependencyOptions) {
|
||||
assertSuccessful()
|
||||
/* Same binaries to transform; but the outputs are different (transformed libraries file) */
|
||||
/* Same binaries to transform; but project(":p2") is excluded from Task Inputs now */
|
||||
assertTasksExecuted(":p3:transformNativeMainCInteropDependenciesMetadata")
|
||||
}
|
||||
}
|
||||
|
||||
+13
@@ -1,4 +1,5 @@
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform") apply false
|
||||
@@ -21,3 +22,15 @@ allprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Setup configuration resolution hook
|
||||
// Report configurations that is going to be resolved before the task graph is ready
|
||||
val isResolutionAllowed = AtomicBoolean(false)
|
||||
project.gradle.taskGraph.whenReady { isResolutionAllowed.set(true) }
|
||||
|
||||
configurations.all {
|
||||
incoming.beforeResolve {
|
||||
if (isResolutionAllowed.get()) return@beforeResolve
|
||||
println("!!!Configuration resolved before Task Graph is ready: $name")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user