Open Nek-12 opened 11 months ago
Looks like K2 is enabled by default in Kotlin 2.0. Did anyone get the library working with k2 enabled?
You can use it with K2, we've been doing that for a while, just don't use KSP2.
Looks like https://github.com/FooIbar/compose-destinations/commit/7875839d4d6729cf93b3a98c91d09e1c7fa1a993 is the only change needed to support KSP2. Note KSP 1.0.20 does not have https://github.com/google/ksp/pull/1871, so those arguments that have class literals as default values need to be explicitly specified, e.g.
@Destination<RootGraph>(navArgs = Nothing::class, style = DestinationStyle.Default::class)
Ok thank you @FooIbar
But just so we're clear. Using 1.0.20 KSP means we'd have to specify all field defaults for annotations that have class types, but only if using K2 as well, right?
Ok thank you @FooIbar
But just so we're clear. Using 1.0.20 KSP means we'd have to specify all field defaults for annotations that have class types, but only if using K2 as well, right?
Yes, only if using KSP2. That fix has been cherry-picked to the 1.0.21 branch https://github.com/google/ksp/commit/fc0cdbf52448e3423d0c381ff3c42e5fed95c1c1, which should be released soon?
You scared me for a moment.. I thought for a moment that they would be dropping that completely 😅 made no sense but we never know..
You scared me for a moment.. I thought for a moment that they would be dropping that completely 😅 made no sense but we never know..
I should have made it clearer. That is only for testing KSP2 compatibility with 1.0.20 https://github.com/FooIbar/compose-destinations/commit/d7e79dd31ebed6c6812d28e88ab63ec704c3e97b.
Update: Tested with 1.0.21, it's only partially fixed. Filed a bug on KSP https://github.com/google/ksp/issues/1910.
Currently, trying to build with KSP2 / K2 fails with:
gradle.properties
: