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" const val ktLint = "10.0.0"
// DI // DI
const val koin = "3.0.1-beta-1" const val koin = "3.0.1"
// Logger // Logger
const val kermit = "0.1.8" const val kermit = "0.1.8"
@ -50,6 +50,13 @@ object Versions {
const val targetSdkVersion = 29 const val targetSdkVersion = 29
const val androidLifecycle = "2.3.0" 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 { object Koin {
val core = "io.insert-koin:koin-core:${Versions.koin}" val core = "io.insert-koin:koin-core:${Versions.koin}"
val test = "io.insert-koin:koin-test:${Versions.koin}" val test = "io.insert-koin:koin-test:${Versions.koin}"

View File

@ -21,6 +21,18 @@ plugins {
} }
kotlin { 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 { jvm("desktop").compilations.all {
kotlinOptions { kotlinOptions {
useIR = true useIR = true
@ -40,7 +52,6 @@ kotlin {
// nodejs() // nodejs()
binaries.executable() binaries.executable()
} }
ios()
sourceSets { sourceSets {
named("commonTest") { named("commonTest") {
dependencies { dependencies {

View File

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