Ciaran Sloan
11/22/2023, 3:02 PMJacob Ras
11/22/2023, 3:10 PMCiaran Sloan
11/22/2023, 3:11 PMkspCommonMainKotlinMetadata
and have some code generation happeningJacob Ras
11/22/2023, 3:13 PMJacob Ras
11/22/2023, 3:14 PMapp
module that I share between Android (activity inside) and iOS (exposes Compose Multiplatform entry point). In its build.gradle.kts
I have the following KSP-related stuff. Maybe there's something there that helps:
dependencies {
coreLibraryDesugaring(libs.desugaring)
debugImplementation(compose.uiTooling)
add("kspCommonMainMetadata", libs.koin.compiler)
}
// From <https://github.com/InsertKoinIO/hello-kmp/blob/annotations/shared/build.gradle.kts>
tasks.withType<KotlinCompile<*>>().configureEach {
if (name != "kspCommonMainKotlinMetadata") {
dependsOn("kspCommonMainKotlinMetadata")
}
}
// From <https://github.com/google/ksp/issues/567#issuecomment-1510477456>
kotlin.sourceSets.commonMain {
kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin")
}
Ciaran Sloan
11/22/2023, 3:15 PMkspCommonMainKotlinMetadata
source setCiaran Sloan
11/22/2023, 3:15 PMCiaran Sloan
11/22/2023, 3:16 PMJacob Ras
11/22/2023, 3:17 PMJacob Ras
11/22/2023, 3:17 PMJacob Ras
11/22/2023, 3:17 PMsourceSets["main"].resources.srcDirs("src/commonMain/resources")
is something I have inside the android{}
block.Ciaran Sloan
11/22/2023, 3:17 PMCiaran Sloan
11/22/2023, 3:19 PMCiaran Sloan
11/22/2023, 3:19 PMCiaran Sloan
11/22/2023, 3:20 PMCiaran Sloan
11/22/2023, 3:21 PMCiaran Sloan
11/22/2023, 3:21 PMsrcDirs("build/generated/ksp/main/kotlin")
but infact, it generated in build/generated/ksp/metadata/commonMain/kotlin
Ciaran Sloan
11/22/2023, 3:21 PMJacob Ras
11/22/2023, 3:23 PMCiaran Sloan
11/22/2023, 3:24 PMCiaran Sloan
11/22/2023, 3:24 PMJacob Ras
11/22/2023, 3:24 PMcurioustechizen
11/22/2023, 4:14 PMCiaran Sloan
11/22/2023, 4:14 PMCiaran Sloan
11/22/2023, 4:15 PMrudolf.hladik
11/22/2023, 6:15 PMrudolf.hladik
11/22/2023, 6:15 PMcurioustechizen
11/23/2023, 3:40 AMCiaran Sloan
11/23/2023, 8:52 AMafterEvaluate {
tasks.filter {
it.name.contains("SourcesJar", true)
}?.forEach {
println("SourceJarTask====>${it.name}")
it.dependsOn("kspCommonMainKotlinMetadata")
}
}
It also would have been helpful if the demo linked the open github issue providing more context on the workaround and why its in place ->
https://github.com/google/ksp/issues/567. I wasn't initially keen on putting in this workaround, without there being context on why its there