Skip to content

Commit

Permalink
Fix configuration cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipDolnik committed May 21, 2024
1 parent 45a35b9 commit c5186c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,21 @@ object SwiftBundlingConfigurator {
}

private fun KotlinNativeCompilationShim.configureCompileTask(processSwiftSourcesTaskProvider: Provider<ProcessSwiftSourcesTask>) {
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<File>) {
val swiftSourcesDirectory = processSwiftSourcesTaskOutput.get()

if (!swiftSourcesDirectory.exists()) {
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

0 comments on commit c5186c0

Please sign in to comment.