[K/N] Refactor :kotlin-native:dependencies
Move K/N dependencies handling logic into gradle plugins:
`NativeDependenciesDownloader` is instantiated in
`:kotlin-native:dependencies` and provides a single configuration that
contains all directories with the dependencies. The configuration has
a variant for each target.
`NativeDependencies` is instantiated by projects that require native
dependencies (i.e. previously used to depend on
`:kotlin-native:dependencies:update`). This plugin creates a configuration
that by default depends on `:kotlin-native:dependencies`. Its extension
provides `llvmDependency`, `libffiDependency`, `hostPlatformDependency`,
`targetDependency()` to depend on the parts needed for the project and
provides accessors `llvmPath`, `libffiPath`, `hostPlatform` that are
safe to use during configuration time, but which do not automatically
resolve those dependencies.
`llvmDir`, `*LibffiDir` properties on `:kotlin-native` are removed
completely, as their use is replaced by `NativeDependencies`. As a
consequence, `evaluationDependsOn(":kotlin-native:dependencies")` is
also gone.
All direct dependencies on `:kotlin-native:dependencies:update` are
replaced with dependencies on specific parts via `NativeDependencies`
This commit is contained in:
committed by
Space Team
parent
9de791b9ac
commit
4922223bec
@@ -21,6 +21,7 @@ buildscript {
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
application
|
||||
id("native-dependencies")
|
||||
}
|
||||
|
||||
application {
|
||||
@@ -59,11 +60,11 @@ tasks {
|
||||
project(":kotlin-native:Interop:Runtime")
|
||||
)
|
||||
dependsOn(projectsWithNativeLibs.map { "${it.path}:nativelibs" })
|
||||
dependsOn(nativeDependencies.llvmDependency)
|
||||
systemProperty("java.library.path", projectsWithNativeLibs.joinToString(File.pathSeparator) {
|
||||
File(it.buildDir, "nativelibs").absolutePath
|
||||
})
|
||||
val llvmDir = project.findProperty("llvmDir")
|
||||
val libclangPath = "$llvmDir/" + if (org.jetbrains.kotlin.konan.target.HostManager.hostIsMingw) {
|
||||
val libclangPath = "${nativeDependencies.llvmPath}/" + if (org.jetbrains.kotlin.konan.target.HostManager.hostIsMingw) {
|
||||
"bin/libclang.dll"
|
||||
} else {
|
||||
"lib/${System.mapLibraryName("clang")}"
|
||||
|
||||
Reference in New Issue
Block a user