如何在LibGDX中连接Kotlin协程?

问题描述 投票:0回答:1

目前 Kotlin 协程的最新版本: 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2'

libgdx
1个回答
0
投票

build.gradle(应用程序):


停止:

project(":desktop") {
apply plugin: "java-library"
dependencies {
    implementation project(":core")
    api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
    api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
  
    // Kotlin Coroutines / Flow
    def kotlinCoroutinesFlow = "1.5.2"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines- 
    core:$kotlinCoroutinesFlow"
    }
 }

核心:

project(":core") {
apply plugin: "java-library"
dependencies {
    api "com.badlogicgames.gdx:gdx:$gdxVersion"
 
    // Kotlin Coroutines / Flow
    def kotlinCoroutinesFlow = "1.5.2"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesFlow"
    }
}

安卓:

project(":android") {
apply plugin: "com.android.application"
configurations { natives }
dependencies {
    implementation project(":core")
    api "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
   
    // Kotlin Coroutines / Flow
    def kotlinCoroutinesFlow = "1.5.2"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesFlow"
    }
}

iOS:

project(":ios") {
apply plugin: "java-library"
apply plugin: "robovm"
dependencies {
    implementation project(":core")
    api "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
    api "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
    api "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
    api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
   
    // Kotlin Coroutines / Flow
    def kotlinCoroutinesFlow = "1.5.2"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesFlow"
    }
}
© www.soinside.com 2019 - 2024. All rights reserved.