compose-ai-contrib
June 6, 2026 · View on GitHub
Non-Gradle integrations of compose-preview
— fixtures and contract tests that exercise the published
ee.schimke.composeai:* artifacts from JetBrains Amper and Bazel
builds.
The published artifacts (preview-discovery, daemon-launch-builder,
render-cli) ship as plain Maven coordinates with java -jar
entrypoints. This repo proves they're consumable without AGP or
Gradle, and pins the wire formats — previews.json and
daemon-launch.json — that downstream build-system integrations key
off.
Fixtures
| Directory | Build system | Demonstrates |
|---|---|---|
amper-android/ | Amper 0.10 | Android APK with @Composable @Preview and @NotificationPreview, no Gradle |
amper-cmp-desktop/ | Amper 0.10 | Compose Desktop module driving a real RenderSession end-to-end |
bazel/ | Bazel (bzlmod) | Resources discovery rule producing resources.json |
bazel-desktop/ | Bazel (bzlmod) | Compose Desktop kt_jvm_library packed into a portable preview bundle (bundle_preview); bundle published in CI |
bazel-apk/ | Bazel (bzlmod) | Compose APK via rules_kotlin + rules_android on Bazel 9 |
buck2/ | Buck2 (bundled prelude) | Resources discovery rule producing resources.json — byte-identical to the Bazel sample |
Each directory is self-contained — see its README for build instructions.
Standalone binaries
| Module | Description |
|---|---|
compose-preview-scripting/ | compose-preview-scripting <path.composepreview.kts> — Kotlin scripting host that renders previews via gradle-preview-driver and evaluates a user script against the result set. Lifted from upstream's examples/scripting/ reference (yschimke/compose-ai-tools PR #1375). Builds against preview-data-api + gradle-preview-driver, published to Maven Central since composeai 0.11.15. |
bundle-producer/ | Build-system-agnostic portable-bundle producer — the ClassGraph reachability closure, the PNG+ZIP polyglot writer, and Maven-coordinate / maven_install.json recovery the Amper and Bazel drivers use to emit a schema-v4 bundle.json the upstream :bundle-viewer can open. See docs/portable-bundles.md. |
Documentation
docs/amper.md— Amper integration walkthrough.docs/bazel.md— Bazel integration walkthrough.docs/portable-bundles.md— portable preview bundles: what the Amper and Bazel producers emit (coordinates/embedded/mixed), and the contrib-side confirmation of the tools-repo design.
Repo Gradle build
A thin Gradle project at the root drives one job: the contract test in
contract-tests/amper-cmp-desktop/,
which resolves the published ee.schimke.composeai:* artifacts from
Maven Central, builds a daemon-launch.json descriptor against the
Amper fixture's compiled output, and renders the fixture's @Preview
through SubprocessRenderSessions. End-to-end proof that the released
artifacts work for a non-Gradle consumer.
# build the Amper fixture (produces kotlin-output/)
cd amper-cmp-desktop && ./amper build && cd ..
# run the contract test
./gradlew :contract-tests:amper-cmp-desktop:test
The version of compose-ai-tools under test is pinned in
gradle/libs.versions.toml under
composeai. Bump in lockstep with upstream releases.
CI
Build / test workflows
.github/workflows/contract-tests.ymlbuilds the Amper Desktop fixture and runs the contract test..github/workflows/amper-android.ymlbuilds the Amper Android fixture..github/workflows/bazel.ymlbuilds the Bazel resources-discovery target, the Compose Desktop preview bundle (uploaded as thebazel-desktop-bundleartifact), and the Compose APK target..github/workflows/buck2.ymlbuilds the Buck2 resources-discovery target and verifies byte-for-byte parity with the Bazel sample's output..github/workflows/compose-preview-scripting.ymlbuilds the scripting binary, renders the demo previews, and runs example scripts.
Preview / resource publish workflows
Each build system that can produce renders or resource manifests has a matching
*-apply.yml workflow that runs on PRs touching that project and on pushes to
main. On PRs it posts a sticky comment with changed renders/resources; on
main it updates the compose-preview/main baseline branch.
| Workflow | Publishes | Branch path |
|---|---|---|
amper-apply.yml | @Preview renders from Amper Desktop fixture | compose-preview/amper/{main,pr} |
scripting-apply.yml | @Preview renders from compose-preview-scripting demo | compose-preview/scripting/{main,pr} |
bazel-apply.yml | app_resources.json from Bazel resources-discovery | compose-preview/bazel/{main,pr} |
buck2-apply.yml | app_resources.json from Buck2 resources-discovery | compose-preview/buck2/{main,pr} |
amper-android is excluded — Android preview rendering requires the Gradle
plugin + Robolectric, neither of which is available in a pure Amper module.
Versioning
This repo doesn't publish artifacts; it consumes them. The single
composeai version in gradle/libs.versions.toml is the only knob —
when yschimke/compose-ai-tools
cuts a release, bump that line and let CI prove the new version still
works for non-Gradle consumers.