Repository navigation
Android getting-started: ThicketAndroidPlugin, templates/hello-thicket-android, a verify script - #164
Merged
Merged
Conversation
…t-android, a verify script docs/18 option A, as the owner chose (2026-11-12): sbt compiles, the app's own Gradle project packages, a debug APK by default. - ThicketAndroidPlugin (sbt-thicket): thicket-renderer-android at the plugin's version, -release 17, the SDK's android.jar on the compile classpath only (ANDROID_HOME / ANDROID_SDK_ROOT / default; android-36), exportJars, and thicketAndroidJars / thicketApk / thicketApkRelease: the runtime jars into android/app/libs (stale ones deleted), then gradlew assemble<Variant>. - templates/hello-thicket-android: the counter app as a ThicketActivity, plus an app-owned Gradle project carrying S2's three mandatory settings (R8 full mode off, the *$lzy* keep rule, the **/*.tasty exclusion). Defaults to 0.2.0 like the other templates, though the plugin needs the next release. - bin/verify-getting-started-android.sh: local-publish or THICKET_VERSION (Central-only) mode, as the others; builds outside the repo, installs on the emulator, reads "Clicked 0 times" with uiautomator, taps, reads "Clicked 1 times", checks the process is alive and no FATAL EXCEPTION. VARIANT=release checks the R8 build. ALLOW_NO_DEVICE=1 stops after the APK; CI runs that. - Docs: README getting-started, sbt-thicket README, docs/14 §14.3, decision log. Measured (s2test emulator, API 36): - debug: PASS, APK 3 320 274 bytes; release: PASS, APK 182 026 bytes. - Before `.safeArea()` on the template's root, the check FAILED: Android 15+ draws edge to edge, the title bar (y 166-237) lay over the button (y 130-256) and took the tap; "Clicked 1 times" never appeared. - ALLOW_NO_DEVICE=1 with no device: PASS (build only); without it: FAIL, exit 1. - sbt --error checkLinux: exit 0, 356 passed, 0 failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
The change still has an unresolved cross-platform bug where the Gradle invocation is hard-coded to use the Unix gradlew wrapper, which will break the Android build tasks on Windows despite including gradlew.bat.
1 open issue
What changed in this PR
Adds an Android getting-started workflow for Thicket using an sbt plugin that compiles Scala and an app-owned Gradle project that packages APKs, plus a template, verification script, CI wiring, and docs updates.
Changes:
- Add
ThicketAndroidPluginto stage runtime jars intoandroid/app/libsand run GradleassembleDebug/Release. - Add
templates/hello-thicket-androidwith a minimalThicketActivitycounter app and Gradle wrapper/project configured for Scala-on-Android packaging/R8 constraints. - Add
bin/verify-getting-started-android.sh, run its build-only mode in Linux CI, and update README/docs/decision log.
| File | Description |
|---|---|
| tools/sbt-thicket/src/main/scala/thicket/sbt/ThicketAndroidPlugin.scala | Introduces a new sbt plugin that wires Android compile-time dependencies, exports/stages jars into an Android Gradle project, and provides tasks to build debug/release APKs via the Gradle wrapper. |
| tools/sbt-thicket/README.md | Documents how to use the new Android sbt plugin and the associated getting-started workflow. |
| templates/hello-thicket-android/src/main/scala/hello/MainActivity.scala | Adds the Android template app entrypoint implemented as a ThicketActivity with a minimal counter UI. |
| templates/hello-thicket-android/project/plugins.sbt | Configures the template’s sbt meta-build to use the sbt-thicket plugin (versioned via env/defaults) and relevant resolvers. |
| templates/hello-thicket-android/project/build.properties | Pins the sbt version used by the Android template. |
| templates/hello-thicket-android/build.sbt | Defines the template sbt build that enables ThicketAndroidPlugin for compiling/staging artifacts for the Gradle project. |
| templates/hello-thicket-android/android/settings.gradle.kts | Adds Gradle settings for the template’s app-owned Android project. |
| templates/hello-thicket-android/android/gradlew.bat | Adds the Windows Gradle wrapper script for the template Android project. |
| templates/hello-thicket-android/android/gradlew | Adds the Unix Gradle wrapper script for the template Android project. |
| templates/hello-thicket-android/android/gradle/wrapper/gradle-wrapper.properties | Pins the Gradle wrapper distribution/version for the template Android project. |
| templates/hello-thicket-android/android/gradle.properties | Adds Gradle properties for the template, including Scala-required build/shrinker settings. |
| templates/hello-thicket-android/android/build.gradle.kts | Adds the root Gradle build configuration for the template Android project. |
| templates/hello-thicket-android/android/app/src/main/AndroidManifest.xml | Adds a minimal Android manifest defining the application and launcher activity for the template. |
| templates/hello-thicket-android/android/app/scala3.pro | Adds R8/Proguard rules required for Scala 3 runtime behavior on Android. |
| templates/hello-thicket-android/android/app/build.gradle.kts | Defines the Android app module configuration including SDK levels, packaging exclusions, shrinker settings, and jar dependencies from libs/. |
| templates/hello-thicket-android/.gitignore | Updates ignore rules for the Android template, including generated build outputs and staged libs. |
| README.md | Updates the main README with Android getting-started instructions using the new template and plugin. |
| docs/decisions.md | Records the decision and rationale for the chosen Android getting-started approach. |
| docs/14-releasing.md | Updates release documentation to note Android-related plugin/template availability and constraints. |
| bin/verify-getting-started-android.sh | Adds a verification script that builds the Android template outside the repo and optionally installs/runs UI checks (with a CI-friendly build-only mode). |
| .github/workflows/ci.yml | Wires the Android getting-started verification script into CI in build-only mode on Linux. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
One conflict: docs/decisions.md, where both sides added a 2026-11-12 entry at the top of the log. Both kept, the Android entry first. Statements #162 brought in that this branch makes untrue, corrected in the same merge: README's "no Android template or plugin yet" and docs/13's phase-5 "Still open: an Android template and plugin". docs/18's status (#163) goes from "being built" to built. Measured: sbt --error checkLinux on the merged tree, exit 0, 356 passed, 0 failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to feat/android-getting-started
rleibman
added a commit
that referenced
this pull request
Nov 13, 2026
One conflict: docs/decisions.md, where main's two 2026-11-12 entries and this branch's 2026-11-03 camera-preview entry were both added at the top. All kept, newest first. Brought in line with rules main gained since this branch: - thicket-camera-preview-apple sets `description` (#157: every published module does; the POM's description is what Central's search shows). - The Swift-carrying Apple modules are eight with this one, not seven: docs/14 §14.5 and bin/release.sh's header. docs/14's 2026-11-09 rehearsal record keeps "seven", which was true then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This builds option A from
docs/18(#163), as you chose: sbt compiles the Scala, and the app's own Gradle project packages it, with a debug APK by default.What's added
ThicketAndroidPlugininsbt-thicket. It adds:thicket-renderer-androidat the plugin's own version;-release 17;android.jaron the compile classpath only, fromANDROID_HOME;exportJars;thicketApk(debug) andthicketApkRelease. Each copies the runtime jars intoandroid/app/libs, deleting old ones first, then runsgradlew assemble<Variant>.templates/hello-thicket-android: the counter app as aThicketActivity, plus a Gradle project the app owns. It already carries the three settings phase 0 found Scala needs on Android: R8 full mode off, the*$lzy*keep rule, and the**/*.tastyexclusion.bin/verify-getting-started-android.sh. Two modes like the others: local publish, orTHICKET_VERSIONfor Central only.Clicked 0 timeswithuiautomator, taps the button, and readsClicked 1 times.FATAL EXCEPTIONwas logged.VARIANT=releasechecks the R8 build.ALLOW_NO_DEVICE=1stops after the APK; CI now runs that in the Linux job.Docs: the README's getting-started, the sbt-thicket README,
docs/14§14.3, and a decision-log entry.Measured (
s2testemulator, API 36)VARIANT=release).safeArea()on the template's rootALLOW_NO_DEVICE=1, no devicesbt --error checkLinuxFindings, not fixed here
.safeArea()is hidden under the system bars and the title bar on Android 15+. On GTK and macOS the same tree is fine. That's a trap for anyone writing one tree for every platform. Options:AppRootapplying the safe area by default, orThicketActivityplacing pages below the action bar. That's a design choice, so I've left it for you.docs/18's status stays "being built" in docs/18: options for an Android app outside this repository (proposed) #163. I'll mark it built once both PRs are in, so this PR doesn't have to sit on top of docs/18: options for an Android app outside this repository (proposed) #163.🤖 Generated with Claude Code