Add showkase wrapper tool - #134
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Sentinel tool module that acts as a lightweight launcher for Airbnb Showkase, plus a matching no-op artifact for release variants, so consuming apps can register ShowkaseTool(MyRootModule::class) from shared sources while keeping the Showkase runtime/processor app-owned and variant-scoped.
Changes:
- Added
tool-showkase(launcher) andtool-showkase-no-op(stub) modules, including publishing + ProGuard/R8 rules. - Integrated the new modules into the build (settings include, lint/detekt aggregation, deploy tasks) and dependency catalog (Showkase coordinates).
- Documented setup and usage in both the root README and a dedicated
tool-showkase/README.md.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tool-showkase/src/main/res/values/strings.xml | Adds the tool display name string resource. |
| tool-showkase/src/main/kotlin/com/infinum/sentinel/ui/tools/ShowkaseTool.kt | Implements the Sentinel tool that launches ShowkaseBrowserActivity for the app’s root module. |
| tool-showkase/src/main/AndroidManifest.xml | Minimal manifest for the library module. |
| tool-showkase/README.md | Documents consumer setup (variant-scoped runtime + KSP) and troubleshooting. |
| tool-showkase/proguard-rules.txt | Keeps the tool’s API class during the module’s own minification. |
| tool-showkase/consumer-rules.pro | Supplies consumer keep rules for Showkase root/codegen classes needed at runtime with shrinking. |
| tool-showkase/build.gradle.kts | Configures the new Android library module and its (api/compileOnly) dependencies. |
| tool-showkase/api/tool-showkase.api | Adds API surface tracking for the new published artifact. |
| tool-showkase/.gitignore | Ignores module build outputs. |
| tool-showkase-no-op/src/main/kotlin/com/infinum/sentinel/ui/tools/ShowkaseTool.kt | Provides a no-op tool implementation for non-debug variants while preserving the API. |
| tool-showkase-no-op/proguard-rules.txt | Keeps the no-op public API class during shrinking. |
| tool-showkase-no-op/build.gradle.kts | Configures the no-op artifact as an Android library module for publishing. |
| tool-showkase-no-op/api/tool-showkase-no-op.api | Adds API surface tracking for the no-op artifact. |
| tool-showkase-no-op/.gitignore | Ignores module build outputs. |
| settings.gradle.kts | Includes the two new modules in the build. |
| README.md | Documents the new tool modules and adds Showkase setup guidance. |
| gradle/libs.versions.toml | Adds Showkase version + coordinates and new tool artifacts to the version catalog. |
| deploy.gradle.kts | Adds deployment tasks for the new tool artifacts and wires them into aggregate deploy tasks. |
| build.gradle.kts | Adds the new modules to lintAll / detektAll aggregators. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
KCeh
left a comment
There was a problem hiding this comment.
Looks solid 🚀
We still need to add tool to sample app and then we can do testing 👍
Also, small note for upcoming release: we should probably try to resolve (at least some of) compile warnings
|
|
||
| # The generated provider, matched two ways in case R8 cannot see one of the supertypes. | ||
| # Members are kept too because the class is only ever instantiated reflectively. | ||
| -keep class * implements com.airbnb.android.showkase.models.ShowkaseProvider { *; } | ||
| -keep @com.airbnb.android.showkase.annotation.ShowkaseRootCodegen class * { *; } |
There was a problem hiding this comment.
Is this correct? I think there is a chance for R8 to fail (missing class)
Let's double-check this
There was a problem hiding this comment.
Not much experience with this so I was winging it a bit. I have tried deploying Sentinel locally and including it in client project, it worked with rules above. I did reconsider this part and adjusted the rules which I will push later. There is section in showkase README that says rules are not even needed, but I didn't find that to be the case when using it.
| -keeppackagenames | ||
| -keep public class com.infinum.sentinel.ui.tools.ShowkaseTool { | ||
| public protected *; | ||
| } |
There was a problem hiding this comment.
I suggest following other proguard configs and add:
-keep public class com.infinum.sentinel.databinding.**
just in case
| **`app/build.gradle`** | ||
|
|
||
| ```groovy | ||
| def sentinelVersion = "2.0.0" |
There was a problem hiding this comment.
I suggests ether omitting concrete versions or using an automated approach (like in replaceVersionsInFile) for keeping them up to date. We will forget to update versions here sooner or later
There was a problem hiding this comment.
Omitting the versions sounds simpler ngl 😄 .
| // The processor. Use a variant-scoped configuration, never the project-wide `ksp`. | ||
| kspDebug "com.airbnb.android:showkase-processor:$showkaseVersion" |
There was a problem hiding this comment.
This is maybe worth mentioning in tool readme
| debugImplementation "com.infinum.sentinel:tool-showkase:$sentinelVersion" | ||
| releaseImplementation "com.infinum.sentinel:tool-showkase-no-op:$sentinelVersion" | ||
| debugImplementation "com.airbnb.android:showkase:1.0.5" | ||
| kspDebug "com.airbnb.android:showkase-processor:1.0.5" |
|
|
||
| ## Setup | ||
|
|
||
| **`app/build.gradle`** |
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 23 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
tool-showkase/README.md:24
kspDebugis created only after the KSP Gradle plugin is applied, but this full setup never tells consumers to applycom.google.devtools.ksp. A project that does not already use KSP will fail during Gradle configuration instead of generating Showkase code. Please include the plugin application (and explain where its compatible version is declared) before this dependency block.
// The processor. Use a variant-scoped configuration, never the project-wide `ksp`,
// and keep it on the same version as the runtime above.
kspDebug "com.airbnb.android:showkase-processor:x.x.x"
README.md:223
- This short setup also uses
kspDebugwithout stating that thecom.google.devtools.kspplugin must be applied. Readers following only the main README can get an unknown-configuration error. Add the KSP plugin prerequisite or plugin snippet here as well.
debugImplementation "com.airbnb.android:showkase:1.0.5"
kspDebug "com.airbnb.android:showkase-processor:1.0.5"
| plugins { | ||
| id("com.android.application") | ||
| id("org.jetbrains.kotlin.android") | ||
| alias(libs.plugins.kotlin.compose) |
KCeh
left a comment
There was a problem hiding this comment.
Looks good, before I hit approve can you just quickly check one thing:
Can we simplify tool API - check my comment for more info
| try { | ||
| view.context.startActivity( | ||
| ShowkaseBrowserActivity.getIntent(view.context, rootModule.java.canonicalName.orEmpty()).apply { | ||
| flags = Intent.FLAG_ACTIVITY_SINGLE_TOP | ||
| addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | ||
| }, | ||
| ) | ||
| } catch (error: NoClassDefFoundError) { |
There was a problem hiding this comment.
I saw one project that implemented custom Showkase tool in simpler way (no rootModule was needed):
context.startActivity(Showkase.getBrowserIntent(context).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
Where Showkase is
package com.airbnb.android.showkase.models
/**
* Object that will be the receiver for all extension functions that are generated as part of
* Showkase. Some examples of extension funtions that will be generated for your use are
* "createShowkaseBrowserIntent" that allows you to start the ShowkaseBrowser and
* "getShowkaseMetadata" that gives you access to all the metadata that's available to Showkase.
*/
object Showkase
can we make API simpler? Or was that some project-specific trick?
| toolshowkase = { module = "com.infinum.sentinel:tool-showkase", version.ref = "sentinel" } | ||
| toolshowkasenoop = { module = "com.infinum.sentinel:tool-showkase-no-op", version.ref = "sentinel" } |
There was a problem hiding this comment.
Can we add those to bundles section of version catalog? so we don't forget



Summary
Changes
Type
Additional information
Description
Since Showkase is now often used in projects for displaying existing composables, I investigated possibility of adding it to Sentinel to avoid having to create a custom Sentinel tool in our projects. The resulting setup should make it easier to run Showkase inside of Sentinel.
Still have some testing to do.
Checklist
Additional notes