https://kotlinlang.org logo
#compose
Title
# compose
j

Joseph Hawkes-Cates

02/02/2022, 4:57 PM
This seems like a basic question, but I’m not finding an answer by searching or googling. My starter compose project did not include the compose-compiler dependency and I don’t see it in my dependency tree either. The description of this on developer.android.com says “Transform @Composable functions and enable optimizations with a Kotlin compiler plugin.” What are the main features that dependency adds?
l

Lukasz Kalnik

02/02/2022, 5:05 PM
I think the point is that you don't add it as a dependency. It is activated by the build.gradle.kts configuration:
Copy code
buildFeatures {
                compose = true
            }
            composeOptions {
                kotlinCompilerExtensionVersion = composeVersion
            }
And this doesn't add any features, it generates all the code for compose to work.
j

Joseph Hawkes-Cates

02/02/2022, 5:06 PM
yeah, from the description I was wondering how it works at all without it. Makes sense that kotlinCompilerExtensionVersion is setting that. thanks!
👍 1