Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce0203 committed Aug 7, 2023
1 parent 464391b commit 523a859
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
4 changes: 4 additions & 0 deletions client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ korge {
targetJvm()
targetJs()
targetDesktopCross()
targetDefault()
targetAll()
entryPoint = "startMain"
}

kotlin {
Expand All @@ -25,6 +28,7 @@ kotlin {
val jsMain by getting
val jvmMain by getting
val mingwX64Main by getting
val macosArm64Main by getting
}
}

Expand Down
25 changes: 13 additions & 12 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ plugins { kotlin("multiplatform") }
korge {
targetJvm()
targetJs()
targetDesktop()
targetDesktopCross()
targetDefault()
targetAll()
}

kotlin {
targets {
this
}
sourceSets {
val commonMain by getting {
dependencies {
Expand Down Expand Up @@ -43,15 +43,16 @@ kotlin {
api(libs.logback)
}
}
val linuxArm64Main by getting {
configurations.all {
println(this.name)
exclude(libs.kotlinx.uuid.asProvider())
exclude(libs.kotlinx.serialization)
exclude(libs.koin)
exclude(libs.ktor.client.auth)
exclude(libs.ktor.client.content.negotation)
exclude(libs.ktor.serialization.kotlinx.json)
val macosArm64Main by getting {
dependencies {
api(libs.ktor.client.cio)
api(libs.logback)
}
}
val macosX64Main by getting {
dependencies {
api(libs.ktor.client.cio)
api(libs.logback)
}
}
}
Expand Down
File renamed without changes.
30 changes: 30 additions & 0 deletions shared/src/macosX64Main/kotlin/main.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import io.ktor.client.engine.cio.*
import korlibs.io.file.std.resourcesVfs
import korlibs.io.lang.readProperties
import network.ClientEngineFactory
import network.URLProvider
import org.koin.core.context.startKoin
import org.koin.core.qualifier.named
import org.koin.dsl.bind
import org.koin.dsl.module
import org.koin.mp.KoinPlatform

class Main
suspend fun main() {
val clientProps = resourcesVfs["client.properties"].readProperties()
val url = clientProps["server"]!!
val version = clientProps["version"]!!
startKoin {}
KoinPlatform.getKoin().loadModules(listOf(module {
single(named("version")) { version }
factory {
object : URLProvider {
override val url: String get() = url
}
} bind URLProvider::class
factory {
object : ClientEngineFactory { override fun getEngine() = CIO }
} bind ClientEngineFactory::class
}))
println("asdf")
}

0 comments on commit 523a859

Please sign in to comment.