Deps-Update and Build Fixes

This commit is contained in:
shabinder 2021-04-28 21:34:17 +05:30
parent 149c9aceb3
commit 3a30cbcc58
5 changed files with 40 additions and 13 deletions

View File

@ -28,7 +28,7 @@ object Versions {
const val ktLint = "10.0.0"
// DI
const val koin = "3.0.1-beta-1"
const val koin = "3.0.1"
// Logger
const val kermit = "0.1.8"
@ -50,6 +50,13 @@ object Versions {
const val targetSdkVersion = 29
const val androidLifecycle = "2.3.0"
}
object HostOS {
// Host OS Properties
private val hostOs = System.getProperty("os.name")
val isMingwX64 = hostOs.startsWith("Windows",true)
val isMac = hostOs.startsWith("Mac",true)
val isLinux = hostOs.startsWith("Linux",true)
}
object Koin {
val core = "io.insert-koin:koin-core:${Versions.koin}"
val test = "io.insert-koin:koin-test:${Versions.koin}"

View File

@ -21,6 +21,18 @@ plugins {
}
kotlin {
/*IOS Target Can be only built on Mac*/
if(HostOS.isMac){
val sdkName: String? = System.getenv("SDK_NAME")
val isiOSDevice = sdkName.orEmpty().startsWith("iphoneos")
if (isiOSDevice) {
iosArm64("ios")
} else {
iosX64("ios")
}
}
jvm("desktop").compilations.all {
kotlinOptions {
useIR = true
@ -40,7 +52,6 @@ kotlin {
// nodejs()
binaries.executable()
}
ios()
sourceSets {
named("commonTest") {
dependencies {

View File

@ -23,6 +23,8 @@ plugins {
kotlin {
/*IOS Target Can be only built on Mac*/
if(HostOS.isMac){
val sdkName: String? = System.getenv("SDK_NAME")
val isiOSDevice = sdkName.orEmpty().startsWith("iphoneos")
if (isiOSDevice) {
@ -30,6 +32,7 @@ kotlin {
} else {
iosX64("ios")
}
}
jvm("desktop").compilations.all {
kotlinOptions {
@ -50,6 +53,7 @@ kotlin {
// nodejs()
binaries.executable()
}
sourceSets {
named("commonMain") {
dependencies {}
@ -86,6 +90,11 @@ kotlin {
implementation("org.jetbrains:kotlin-react-dom:17.0.1-pre.148-kotlin-1.4.30")
}
}
if(HostOS.isMac){
named("iosMain"){
dependencies { }
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {

View File

@ -30,6 +30,5 @@ kotlin {
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3-native-mt")
}
}
val iosMain by getting
}
}

View File

@ -50,7 +50,7 @@ kotlin {
implementation(SqlDelight.jdbcDriver)
}
}
if(HostOS.isMac){
val iosMain by getting {
dependencies {
implementation(SqlDelight.nativeDriver)
@ -58,3 +58,4 @@ kotlin {
}
}
}
}