[K/N][perf] Workaround KGP bug when dirs are queried instantly

This commit is contained in:
Pavel Punegov
2022-08-18 13:50:36 +02:00
committed by Space
parent 5034581788
commit 1502e6628b
@@ -1,10 +1,12 @@
import org.jetbrains.kotlin.konan.target.HostManager
buildscript { buildscript {
ext.rootBuildDirectory = file('../..') ext.rootBuildDirectory = file('../..')
ext { ext {
def properties = new java.util.Properties() def properties = new java.util.Properties()
properties.load(new java.io.FileReader(project.file("$rootBuildDirectory/../gradle.properties"))) properties.load(new java.io.FileReader(project.file("$rootBuildDirectory/../gradle.properties")))
properties.each { k, v-> properties.each { k, v ->
def key = k as String def key = k as String
def value = project.findProperty(key) ?: v def value = project.findProperty(key) ?: v
project.logger.info("${project.name} $key: $value") project.logger.info("${project.name} $key: $value")
@@ -115,6 +117,7 @@ kotlin {
} }
} }
if (HostManager.hostIsMingw) {
fromPreset(presets.mingwX64, 'windows') { fromPreset(presets.mingwX64, 'windows') {
binaries.all { binaries.all {
linkerOpts = ["-L${getMingwPath()}/lib".toString()] linkerOpts = ["-L${getMingwPath()}/lib".toString()]
@@ -125,7 +128,9 @@ kotlin {
} }
} }
} }
}
if (HostManager.hostIsLinux) {
fromPreset(presets.linuxX64, 'linux') { fromPreset(presets.linuxX64, 'linux') {
compilations.main.cinterops { compilations.main.cinterops {
libcurl { libcurl {
@@ -133,6 +138,9 @@ kotlin {
} }
} }
} }
}
if (HostManager.hostIsMac) {
fromPreset(presets.macosX64, 'macosX64') { fromPreset(presets.macosX64, 'macosX64') {
compilations.main.cinterops { compilations.main.cinterops {
libcurl { libcurl {
@@ -147,13 +155,14 @@ kotlin {
} }
} }
} }
}
fromPreset(presets.js, 'js') { fromPreset(presets.js, 'js') {
compilations.main.kotlinOptions { compilations.main.kotlinOptions {
main = "noCall" main = "noCall"
} }
} }
configure([findByName('windows'), findByName('linux'), findByName('macosX64'), findByName('macosArm64')]) { configure([findByName('windows'), findByName('linux'), findByName('macosX64'), findByName('macosArm64')].findAll { it != null }) {
def isCurrentHost = (name == getHostName()) def isCurrentHost = (name == getHostName())
compilations.all { compilations.all {
cinterops.all { cinterops.all {