Skip to content

Commit 2c6e778

Browse files
committed
change
1 parent 676e238 commit 2c6e778

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

buildSrc/src/main/kotlin/com/addzero/kmp/kmp-component.gradle.kts

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import com.google.devtools.ksp.gradle.KspAATask
2+
import org.gradle.kotlin.dsl.withType
23
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
4+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
35
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
46

57
plugins {
@@ -28,14 +30,21 @@ kotlin {
2830
}
2931

3032
// 修复 KSP 任务依赖问题
31-
listOf(
32-
KotlinCompile::class,
33-
Kotlin2JsCompile::class,
34-
KspAATask::class
35-
).forEach { taskClass ->
36-
tasks.withType(taskClass).configureEach {
37-
if (name != "kspCommonMainKotlinMetadata") {
38-
dependsOn("kspCommonMainKotlinMetadata")
39-
}
33+
//listOf(
34+
// KotlinCompile::class,
35+
// Kotlin2JsCompile::class,
36+
// KspAATask::class
37+
//).forEach { taskClass ->
38+
// tasks.withType(taskClass).configureEach {
39+
// if (name != "kspCommonMainKotlinMetadata") {
40+
// dependsOn("kspCommonMainKotlinMetadata")
41+
// }
42+
// }
43+
//}
44+
45+
tasks.withType<KotlinCompilationTask<*>>().configureEach {
46+
if (name != "kspKotlin" || name != "kspCommonMainKotlinMetadata") {
47+
dependsOn(":backend:model:kspKotlin")
48+
dependsOn(":shared:kspCommonMainKotlinMetadata")
4049
}
4150
}

composeApp/src/commonMain/kotlin/com/addzero/kmp/App.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ fun App() {
3333

3434
FollowSystemTheme(colorScheme = colorScheme) {
3535
// GradientThemeWrapper(themeType = currentTheme) {
36-
// MainLayoutWithLogin()
37-
MainLayout()
36+
MainLayoutWithLogin()
37+
// MainLayout()
3838
ToastListener()
3939
// }
4040
}

0 commit comments

Comments
 (0)