From 8af8b161442d23bcc414053ec43ecf42635706f2 Mon Sep 17 00:00:00 2001 From: Aleksey Mikhailov Date: Sun, 14 Jan 2024 20:19:03 +0700 Subject: [PATCH] #535 fix klibs pass --- .../generator/platform/apple/SetupAppleUtils.kt | 2 +- .../gradle/tasks/CopyExecutableResourcesToApp.kt | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/resources-generator/src/main/kotlin/dev/icerock/gradle/generator/platform/apple/SetupAppleUtils.kt b/resources-generator/src/main/kotlin/dev/icerock/gradle/generator/platform/apple/SetupAppleUtils.kt index 75b2731c..338bb9e1 100644 --- a/resources-generator/src/main/kotlin/dev/icerock/gradle/generator/platform/apple/SetupAppleUtils.kt +++ b/resources-generator/src/main/kotlin/dev/icerock/gradle/generator/platform/apple/SetupAppleUtils.kt @@ -149,7 +149,7 @@ internal fun setupExecutableResources(target: KotlinNativeTarget) { project.tasks.register(copyTaskName) { dependsOn(executable.linkTaskProvider) - klibs.set(executable.linkTaskProvider.map { it.klibs }) + klibs.from(executable.linkTaskProvider.map { it.klibs }) outputDirectory.set( project.layout.dir( diff --git a/resources-generator/src/main/kotlin/dev/icerock/gradle/tasks/CopyExecutableResourcesToApp.kt b/resources-generator/src/main/kotlin/dev/icerock/gradle/tasks/CopyExecutableResourcesToApp.kt index 99454f38..b7dff4c6 100644 --- a/resources-generator/src/main/kotlin/dev/icerock/gradle/tasks/CopyExecutableResourcesToApp.kt +++ b/resources-generator/src/main/kotlin/dev/icerock/gradle/tasks/CopyExecutableResourcesToApp.kt @@ -6,10 +6,10 @@ package dev.icerock.gradle.tasks import dev.icerock.gradle.utils.toKonanFile import org.gradle.api.DefaultTask +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty -import org.gradle.api.file.FileCollection -import org.gradle.api.provider.Property -import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Classpath +import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.TaskAction import org.jetbrains.kotlin.library.KotlinLibraryLayout @@ -19,8 +19,9 @@ import java.io.FileFilter abstract class CopyExecutableResourcesToApp : DefaultTask() { - @get:Input - abstract val klibs: Property + @get:InputFiles + @get:Classpath + abstract val klibs: ConfigurableFileCollection @get:OutputDirectory abstract val outputDirectory: DirectoryProperty @@ -33,7 +34,7 @@ abstract class CopyExecutableResourcesToApp : DefaultTask() { fun copyResources() { val outputDir: File = outputDirectory.get().asFile - klibs.get() + klibs .filter { library -> library.extension == "klib" } .filter(File::exists) .forEach { inputFile ->