kevin.cianfarini
08/29/2023, 2:33 PMkapt
does not seem to see sources in our commonMain
sourceset when generating stubs for android after the upgrade to Kotlin 1.9.0. In Kotlin 1.8.22 stubs were generated for everything in the androidMain
sourceset and the commonMain
sourceset, but after upgrading to 1.9.0 we’re only seeing stubs generated for the androidMain
sourceset.
Does anyone have any tips on how we might begin to debut this? How does kapt locate source files to generate stubs for?tapchicoma
08/29/2023, 4:35 PMKotlinJvmCompile
task. But since 1.9.0 manual sources configuration for KotlinJvmCompile
task is not back-propagated to the generate stubs task.
Is it your case?kevin.cianfarini
08/29/2023, 4:45 PMkevin.cianfarini
08/29/2023, 4:48 PMBut since 1.9.0 manual sources configuration for?task is not back-propagated to the generate stubs task.KotlinJvmCompile
tapchicoma
08/29/2023, 4:50 PMRichard Leggett
08/30/2023, 8:59 AMkapt
working in a KMM shared code module.
val androidMain by getting {
dependencies {
...various dependencies...
configurations.getByName("kapt").dependencies.add(
DefaultExternalModuleDependency(
"com.google.dagger",
"hilt-compiler",
libs.versions.hilt.get()
)
)
}
}
Do you think this could be causing stub generation to fail for commonMain
sources?
I'll try to create an absolute barebones reproducer pending this, since the current one is still a module within the main codebase.tapchicoma
08/30/2023, 9:01 AMRichard Leggett
08/30/2023, 5:42 PMRichard Leggett
08/31/2023, 3:26 PMcommonMain
.
We annotate those viewmodels with @SharedViewModel
. Which is type aliased to @HiltViewModel
on Android (and no-op on iOS) using expect/actual
.
Until now this has worked well, but since upgrading to Kotlin 1.9 it looks like the annotation is ignored / none of these shared VMs' are found by HiltViewModelFactory
. Only ViewModels defined/annotated in androidMain
remain present.tapchicoma
08/31/2023, 3:27 PMbut since upgrading to Kotlin 1.9Still sounds that some change in Kotlin may cause it
Richard Leggett
08/31/2023, 3:27 PMRichard Leggett
08/31/2023, 3:29 PM@HiltViewModel
annotated classes are present, but they never make it into the map of VMs Hilt provides when calling hiltViewModel()
. I need to figure out where that map of keys is actually generated.tapchicoma
08/31/2023, 3:30 PMtapchicoma
08/31/2023, 3:30 PMRichard Leggett
08/31/2023, 3:30 PMRichard Leggett
08/31/2023, 4:27 PMtapchicoma
09/15/2023, 10:28 AMkevin.cianfarini
09/15/2023, 11:38 AMRichard Leggett
09/15/2023, 11:48 AM