You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m rolling out an extension onto our convention plugins to selectively opt-into Showkase. the API surface looks like this
myExtension {
optInto {
showkase(true)
}
}
The value set here is evaluated in our convention plugin and is used to selectively add the Showkase dependencies to modules that opted in
classComposeConventionPlugin : Plugin<Project> {
overridefunapply(target:Project): Unit= target.run {
val handler = myExtension().optInHandler
handler.applyTo(this)
}
}
// part of the handler class, which in turn is part of my registered extensioninternalfunapplyTo(project:Project) {
// This must happen in afterEvaluate to ensure the extension was configured
project.afterEvaluate {
if (enableShowkase.getOrElse(false)) {
pluginManager.apply(libs.plugins.ksp.get().pluginId)
extensions.configure<KspExtension> {
arg("skipPrivatePreviews", "true")
}
dependencies {
"implementation"(libs.showkase.annotation)
"debugImplementation"(libs.showkase)
"kspDebug"(libs.showkase.processor)
}
}
}
}
We must do this in afterEvaluate because if you do it any earlier, Gradle wouldn’t have configured the extension yet. However, this seems to be too late for the ShowkaseProcessor class.
This processor seems to kick in quite early in the lifecycle and doesn't wait for all projects in the graph to be configured. Is there a way for me to tell the processor to kick into gear at a later point in time when my code is ready, or is this just how KSP processors work?
The text was updated successfully, but these errors were encountered:
I’m rolling out an extension onto our convention plugins to selectively opt-into Showkase. the API surface looks like this
myExtension { optInto { showkase(true) } }
The value set here is evaluated in our convention plugin and is used to selectively add the Showkase dependencies to modules that opted in
We must do this in
afterEvaluate
because if you do it any earlier, Gradle wouldn’t have configured the extension yet. However, this seems to be too late for the ShowkaseProcessor class.This processor seems to kick in quite early in the lifecycle and doesn't wait for all projects in the graph to be configured. Is there a way for me to tell the processor to kick into gear at a later point in time when my code is ready, or is this just how KSP processors work?
The text was updated successfully, but these errors were encountered: