Skip to content

Add showkase wrapper tool - #134

Open
AsimRibo wants to merge 5 commits into
masterfrom
feature/showkase-tool
Open

Add showkase wrapper tool#134
AsimRibo wants to merge 5 commits into
masterfrom
feature/showkase-tool

Conversation

@AsimRibo

Copy link
Copy Markdown
Contributor

Summary

Changes

Type

  • Feature: This pull request introduces a new feature.
  • Bug fix: This pull request fixes a bug.
  • Refactor: This pull request refactors existing code.
  • Documentation: This pull request updates documentation.
  • Other: This pull request makes other changes.

Additional information

  • This pull request introduces a breaking change.

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

  • I have performed a self-review of my own code.
  • I have tested my changes, including edge cases.
  • I have added necessary tests for the changes introduced (if applicable).
  • I have updated the documentation to reflect my changes (if applicable).

Additional notes

@AsimRibo AsimRibo self-assigned this Aug 21, 2026
@AsimRibo
AsimRibo requested review from KCeh and a lite review from Copilot August 21, 2026 13:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and tool-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 KCeh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread tool-showkase/consumer-rules.pro Outdated
Comment on lines +10 to +14

# 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 * { *; }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? I think there is a chance for R8 to fail (missing class)

Let's double-check this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +1 to +4
-keeppackagenames
-keep public class com.infinum.sentinel.ui.tools.ShowkaseTool {
public protected *;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest following other proguard configs and add:
-keep public class com.infinum.sentinel.databinding.**

just in case

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

Comment thread tool-showkase/README.md Outdated
**`app/build.gradle`**

```groovy
def sentinelVersion = "2.0.0"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omitting the versions sounds simpler ngl 😄 .

@KCeh
KCeh requested a balanced review from Copilot August 23, 2026 15:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.

Comment thread tool-showkase/README.md Outdated
Comment on lines +25 to +26
// The processor. Use a variant-scoped configuration, never the project-wide `ksp`.
kspDebug "com.airbnb.android:showkase-processor:$showkaseVersion"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is maybe worth mentioning in tool readme

Comment thread README.md
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"
Comment thread tool-showkase/README.md

## Setup

**`app/build.gradle`**
@sonarqubecloud

Copy link
Copy Markdown

@AsimRibo
AsimRibo requested a review from KCeh August 26, 2026 12:31
@AsimRibo
AsimRibo marked this pull request as ready for review August 26, 2026 12:35
@KCeh
KCeh requested a balanced review from Copilot August 27, 2026 12:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • kspDebug is created only after the KSP Gradle plugin is applied, but this full setup never tells consumers to apply com.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 kspDebug without stating that the com.google.devtools.ksp plugin 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"

Comment thread sample/build.gradle.kts
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
alias(libs.plugins.kotlin.compose)

@KCeh KCeh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, before I hit approve can you just quickly check one thing:
Can we simplify tool API - check my comment for more info

Comment on lines +32 to +39
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) {

@KCeh KCeh Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread gradle/libs.versions.toml
Comment on lines +58 to +59
toolshowkase = { module = "com.infinum.sentinel:tool-showkase", version.ref = "sentinel" }
toolshowkasenoop = { module = "com.infinum.sentinel:tool-showkase-no-op", version.ref = "sentinel" }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add those to bundles section of version catalog? so we don't forget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants