CInteropProcess: Promote settings to constructor
This enforces that the specified c-interop settings cannot be re-set on a CInteropProcess.
This commit is contained in:
committed by
Space
parent
be84b7b419
commit
7cf8e9ec58
+1
-2
@@ -298,8 +298,7 @@ open class KotlinNativeTargetConfigurator<T : KotlinNativeTarget>(
|
||||
|
||||
private fun Project.createCInteropTasks(compilation: KotlinNativeCompilation) {
|
||||
compilation.cinterops.all { interop ->
|
||||
val interopTask = registerTask<CInteropProcess>(interop.interopProcessingTaskName) {
|
||||
it.settings = interop
|
||||
val interopTask = registerTask<CInteropProcess>(interop.interopProcessingTaskName, listOf(interop)) {
|
||||
it.destinationDir = provider { klibOutputDirectory(compilation).resolve("cinterop") }
|
||||
it.group = INTEROP_GROUP
|
||||
it.description = "Generates Kotlin/Native interop library '${interop.name}' " +
|
||||
|
||||
+2
-4
@@ -45,6 +45,7 @@ import org.jetbrains.kotlin.library.*
|
||||
import java.io.File
|
||||
import java.nio.charset.StandardCharsets
|
||||
import java.security.MessageDigest
|
||||
import javax.inject.Inject
|
||||
import org.jetbrains.kotlin.konan.file.File as KFile
|
||||
import org.jetbrains.kotlin.util.Logger as KLogger
|
||||
|
||||
@@ -921,10 +922,7 @@ internal class CacheBuilder(val project: Project, val binary: NativeBinary, val
|
||||
}
|
||||
}
|
||||
|
||||
open class CInteropProcess : DefaultTask() {
|
||||
|
||||
@Internal
|
||||
lateinit var settings: DefaultCInteropSettings
|
||||
open class CInteropProcess @Inject constructor(@get:Internal val settings: DefaultCInteropSettings) : DefaultTask() {
|
||||
|
||||
@Internal // Taken into account in the outputFileProvider property
|
||||
lateinit var destinationDir: Provider<File>
|
||||
|
||||
Reference in New Issue
Block a user