[Test] Disable Configuration Cache for native tasks

cherry-picked from 538cb41a320df93ca85a194b8566ea44457187ca

^KT-43293
This commit is contained in:
Anton Lakotka
2022-04-14 15:08:17 +02:00
committed by Space
parent d2c6489de9
commit dfd89a45f7
4 changed files with 41 additions and 21 deletions
@@ -728,27 +728,27 @@ class HierarchicalMppIT : KGPBaseTest() {
assertTasksExecuted(":lib:publish")
}
val gccIncompatibleTasks = listOf(
":generateProjectStructureMetadata",
":transformCommonMainDependenciesMetadata",
":cinteropFooLinuxX64",
":compileKotlinLinuxX64",
":linkDebugSharedLinuxX64",
)
build("clean", "assemble", buildOptions = options) {
assertTasksExecuted(
":generateProjectStructureMetadata",
":transformCommonMainDependenciesMetadata"
)
assertOutputContains(
"""Task `:generateProjectStructureMetadata` of type `.+`: invocation of 'Task\.project' at execution time is unsupported"""
.toRegex()
)
assertOutputContains(
"""Task `:transformCommonMainDependenciesMetadata` of type `.+`: invocation of 'Task.project' at execution time is unsupported"""
.toRegex()
)
assertTasksExecuted(gccIncompatibleTasks)
gccIncompatibleTasks.forEach { task ->
assertOutputContains(
"""Task `:$task` of type `.+`: .+(at execution time is unsupported)|(not supported with the configuration cache)"""
.toRegex()
)
}
}
build("clean", "assemble", buildOptions = options) {
assertOutputContains("Configuration cache entry discarded")
assertTasksExecuted(
":generateProjectStructureMetadata",
":transformCommonMainDependenciesMetadata"
)
assertTasksExecuted(gccIncompatibleTasks)
}
}
}
@@ -12,7 +12,16 @@ allprojects {
kotlin {
jvm()
linuxX64()
linuxX64 {
binaries { sharedLib() }
compilations.getByName("main").apply {
cinterops {
val foo by creating {
defFile(project.file("foo.def"))
}
}
}
}
sourceSets {
val commonMain by getting {
@@ -0,0 +1,7 @@
package = test.cinterop
---
static int testCinterop(char* str) {
return 42;
}
@@ -158,6 +158,10 @@ abstract class AbstractKotlinNativeCompile<
compilation.konanTarget
}
init {
notCompatibleWithConfigurationCache("Task $name does not support Gradle Configuration Cache. Check KT-43293 for more info")
}
@get:Classpath
override val libraries: ConfigurableFileCollection by project.provider {
// Avoid resolving these dependencies during task graph construction when we can't build the target:
@@ -313,10 +317,6 @@ constructor(
) : AbstractKotlinNativeCompile<KotlinCommonOptions, KotlinNativeCompilationData<*>, StubK2NativeCompilerArguments>(objectFactory),
KotlinCompile<KotlinCommonOptions> {
init {
notCompatibleWithConfigurationCache("Task $name does not support Gradle Configuration Cache. Check KT-43293 for more info")
}
@get:Input
override val outputKind = LIBRARY
@@ -1093,6 +1093,10 @@ open class CInteropProcess @Inject constructor(@get:Internal val settings: Defau
val outputFile: File
get() = outputFileProvider.get()
init {
notCompatibleWithConfigurationCache("Task $name does not support Gradle Configuration Cache. Check KT-43293 for more info")
}
// Inputs and outputs.
@OutputFile