airbnb / Showkase

🔦 Showkase is an annotation-processor based Android library that helps you organize, discover, search and visualize Jetpack Compose UI elements
https://medium.com/airbnb-engineering/introducing-showkase-a-library-to-organize-discover-and-visualize-your-jetpack-compose-elements-d5c34ef01095
Apache License 2.0
2.08k stars 106 forks source link

Feature request: Add support for K2 compiler. #371

Open lubo-pisk opened 6 months ago

lubo-pisk commented 6 months ago

I have following configuration:

K2 Compiler Kotlin 2.0.0-Beta1 Kotlin KSP 2.0.0-Beta1-1.0.15 Showkase 1.0.2

and attribute with annotation:

@ShowkaseTypography(group = "My Styleguide")
val headline1Medium = TextStyle(
   fontFamily = Roboto,
   fontSize = 24.sp,
   lineHeight = 35.sp,
   fontWeight = FontWeight.W500,
)

Generated class:

package cz.lubo.pisk.style.res.theme

import com.airbnb.android.showkase.models.ShowkaseBrowserTypography

public val body1BoldMyStyleguideBody1Bold: ShowkaseBrowserTypography = 
ShowkaseBrowserTypography(
   typographyGroup = "My Styleguide",
   typographyName = "Body1Bold",
   typographyKDoc = "",
   textStyle = body1Bold
)

Build with error:

e: file:///Users/pisk/AndroidStudioProjects/ExampleProject/shared/styleRes/build/
generated/ksp/android/androidDebug/kotlin/cz/lubo/pisk/style/res/theme/
body1BoldAlzaStyleguideBody1Bold.kt:11:21 Unresolved reference 'body1Bold'.