Compose Multiplatform 向导使用 Gradle 版本目录创建了一个项目,这对我来说是新东西。我现在明白了如何在依赖项中声明依赖项libs.versions.toml
以及如何在build.gradle.kts
依赖项中引用它们。但是,也有使用以下方式声明的依赖项compose.*
:
sourceSets {
val desktopMain by getting
androidMain.dependencies {
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.material)
}
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(libs.vinceglb.filekit.core)
}
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
implementation(libs.kotlinx.coroutines.swing)
}
}
我不明白这些来自哪里(即它是一个特定的构建功能还是带有特定的插件等)并且我特别想知道它们对应的确切库和版本。
此外,除了由于省略而缩短之外,它们还提供了其他好处吗libs.
?例如,compose.desktop.currentOs
它看起来不像是一个特定的库,而更像是一种选择平台相关库的快捷方式。