Skip to content

Instantly share code, notes, and snippets.

@cdsap
Created August 4, 2022 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdsap/3def4322e9c7ef3bba780adf8f2832da to your computer and use it in GitHub Desktop.
Save cdsap/3def4322e9c7ef3bba780adf8f2832da to your computer and use it in GitHub Desktop.
Room + Ksp + Variants
androidComponents {
onVariants { variant ->
afterEvaluate {
tasks.named<KspTask>("ksp${variant.name.capitalize()}Kotlin").configure {
options.add(
org.jetbrains.kotlin.gradle.plugin.SubpluginOption(
"apoption",
"room.schemaLocation=${project.layout.projectDirectory.dir("schemas-${variant.name}").asFile.path}"
)
)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment