Build: Fix usages of deprecated convention in kotlin-native
Required for Gradle 7+ #KTI-559
This commit is contained in:
+1
-1
@@ -251,7 +251,7 @@ class NamedNativeInteropConfig implements Named {
|
||||
}
|
||||
|
||||
// TODO: the interop plugin should probably be reworked to execute clang from build scripts directly
|
||||
environment['PATH'] = project.files(project.hostPlatform.clang.clangPaths).asPath +
|
||||
environment['PATH'] = project.files(project.extensions.platformManager.hostPlatform.clang.clangPaths).asPath +
|
||||
File.pathSeparator + environment['PATH']
|
||||
|
||||
args compilerOpts.collectMany { ['-compiler-option', it] }
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@ import org.gradle.api.tasks.Input
|
||||
import org.gradle.api.tasks.InputFiles
|
||||
import org.gradle.api.tasks.OutputFile
|
||||
import org.gradle.api.tasks.TaskAction
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import org.jetbrains.kotlin.bitcode.CompileToBitcode
|
||||
import java.io.FileReader
|
||||
import java.io.FileWriter
|
||||
@@ -63,7 +64,7 @@ open class GenerateCompilationDatabase @Inject constructor(@Input val target: St
|
||||
|
||||
@TaskAction
|
||||
fun run() {
|
||||
val plugin = project.convention.getPlugin(ExecClang::class.java)
|
||||
val plugin = project.extensions.getByType<ExecClang>()
|
||||
val executable = plugin.resolveExecutable(executable)
|
||||
val args = listOf(executable) + compilerFlags + plugin.clangArgsForCppRuntime(target)
|
||||
val entries: List<Entry> = files.map { Entry.create(srcRoot, it, args, outputDir) }
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.gradle.api.Project
|
||||
import org.gradle.api.Task
|
||||
import org.gradle.api.provider.Provider
|
||||
import org.gradle.api.tasks.*
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import org.gradle.language.base.plugins.LifecycleBasePlugin
|
||||
import org.gradle.process.ExecSpec
|
||||
import org.jetbrains.kotlin.konan.exec.Command
|
||||
@@ -528,7 +529,7 @@ open class KonanDynamicTest : KonanStandaloneTest() {
|
||||
|
||||
private fun clang() {
|
||||
val log = ByteArrayOutputStream()
|
||||
val plugin = project.convention.getPlugin(ExecClang::class.java)
|
||||
val plugin = project.extensions.getByType<ExecClang>()
|
||||
val artifactsDir = "$outputDirectory/${project.testTarget}"
|
||||
|
||||
fun flagsContain(opt: String) = project.globalTestArgs.contains(opt) || flags.contains(opt)
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.bitcode
|
||||
import org.gradle.api.DefaultTask
|
||||
import org.gradle.api.file.FileCollection
|
||||
import org.gradle.api.tasks.*
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import org.jetbrains.kotlin.ExecClang
|
||||
import org.jetbrains.kotlin.konan.target.Family
|
||||
import org.jetbrains.kotlin.konan.target.HostManager
|
||||
@@ -161,7 +162,7 @@ open class CompileToBitcode @Inject constructor(
|
||||
@TaskAction
|
||||
fun compile() {
|
||||
objDir.mkdirs()
|
||||
val plugin = project.convention.getPlugin(ExecClang::class.java)
|
||||
val plugin = project.extensions.getByType<ExecClang>()
|
||||
|
||||
plugin.execKonanClang(target) {
|
||||
workingDir = objDir
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@ import javax.inject.Inject
|
||||
import org.gradle.api.*
|
||||
import org.gradle.api.file.ConfigurableFileCollection
|
||||
import org.gradle.api.tasks.*
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import org.jetbrains.kotlin.ExecClang
|
||||
import org.jetbrains.kotlin.bitcode.CompileToBitcode
|
||||
import org.jetbrains.kotlin.bitcode.CompileToBitcodeExtension
|
||||
@@ -37,7 +38,7 @@ open class CompileNativeTest @Inject constructor(
|
||||
|
||||
@TaskAction
|
||||
fun compile() {
|
||||
val plugin = project.convention.getPlugin(ExecClang::class.java)
|
||||
val plugin = project.extensions.getByType<ExecClang>()
|
||||
val args = clangArgs + sanitizerFlags + listOf(inputFile.absolutePath, "-o", outputFile.absolutePath)
|
||||
if (target.family.isAppleFamily) {
|
||||
plugin.execToolchainClang(target) {
|
||||
|
||||
Reference in New Issue
Block a user