From c5186c0e71e968be5c3bd10132d66e23d80d9c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Doln=C3=ADk?= Date: Tue, 21 May 2024 13:08:38 +0200 Subject: [PATCH] Fix configuration cache. --- .../plugin/switflink/SwiftBundlingConfigurator.kt | 12 ++++++++---- .../plugin/switflink/SwiftUnpackingConfigurator.kt | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/SKIE/skie-gradle/plugin-impl/src/common/kotlin/co/touchlab/skie/plugin/switflink/SwiftBundlingConfigurator.kt b/SKIE/skie-gradle/plugin-impl/src/common/kotlin/co/touchlab/skie/plugin/switflink/SwiftBundlingConfigurator.kt index 3f0c0d32..e1328a77 100644 --- a/SKIE/skie-gradle/plugin-impl/src/common/kotlin/co/touchlab/skie/plugin/switflink/SwiftBundlingConfigurator.kt +++ b/SKIE/skie-gradle/plugin-impl/src/common/kotlin/co/touchlab/skie/plugin/switflink/SwiftBundlingConfigurator.kt @@ -60,17 +60,21 @@ object SwiftBundlingConfigurator { } private fun KotlinNativeCompilationShim.configureCompileTask(processSwiftSourcesTaskProvider: Provider) { + val processSwiftSourcesTaskOutput = processSwiftSourcesTaskProvider.flatMap { it.output } + + val compileTaskOutputFileProvider = compileTaskOutputFileProvider + compileTaskProvider.configure { - inputs.files(processSwiftSourcesTaskProvider.map { it.outputs }) + inputs.files(processSwiftSourcesTaskOutput) doLast { - copySwiftSourcesToKlib(compileTaskOutputFileProvider.get(), processSwiftSourcesTaskProvider.get()) + copySwiftSourcesToKlib(compileTaskOutputFileProvider.get(), processSwiftSourcesTaskOutput) } } } - private fun copySwiftSourcesToKlib(klib: File, processResourcesTask: ProcessSwiftSourcesTask) { - val swiftSourcesDirectory = processResourcesTask.output.get() + private fun copySwiftSourcesToKlib(klib: File, processSwiftSourcesTaskOutput: Provider) { + val swiftSourcesDirectory = processSwiftSourcesTaskOutput.get() if (!swiftSourcesDirectory.exists()) { return diff --git a/SKIE/skie-gradle/plugin-impl/src/common/kotlin/co/touchlab/skie/plugin/switflink/SwiftUnpackingConfigurator.kt b/SKIE/skie-gradle/plugin-impl/src/common/kotlin/co/touchlab/skie/plugin/switflink/SwiftUnpackingConfigurator.kt index 73bc7009..0470f012 100644 --- a/SKIE/skie-gradle/plugin-impl/src/common/kotlin/co/touchlab/skie/plugin/switflink/SwiftUnpackingConfigurator.kt +++ b/SKIE/skie-gradle/plugin-impl/src/common/kotlin/co/touchlab/skie/plugin/switflink/SwiftUnpackingConfigurator.kt @@ -24,8 +24,10 @@ object SwiftUnpackingConfigurator { output.set(bundledSwiftDirectory) } + val unpackTaskOutput = unpackTask.flatMap { it.output } + target.task.configure { - inputs.files(unpackTask.map { it.output }) + inputs.files(unpackTaskOutput) } } }