Skip to content

Fix Kotlin release; stop publishing moq-clock + @moq/clock#1488

Merged
kixelated merged 2 commits into
mainfrom
claude/sad-matsumoto-9d7dcc
May 24, 2026
Merged

Fix Kotlin release; stop publishing moq-clock + @moq/clock#1488
kixelated merged 2 commits into
mainfrom
claude/sad-matsumoto-9d7dcc

Conversation

@kixelated
Copy link
Copy Markdown
Collaborator

@kixelated kixelated commented May 24, 2026

Two related release-pipeline cleanups. The first half came out of the post-release publishing audit; the second half is the user-requested followup.

Kotlin release: inline android.gradle.kts

apply(from = "android.gradle.kts") script plugins don't inherit the parent's plugin classpath at compile time, so the apply-from script never resolved kotlin {}, JvmTarget, androidTarget, or com.android.build.gradle.LibraryExtension. Every moq-ffi-v* tag has been failing Release Kotlin with 35 unresolved references since #1432 introduced the file.

  • Fold the Android source-set wiring and LibraryExtension config back into kt/moq/build.gradle.kts, guarded by if (androidEnabled).
  • Declare AGP apply false in the plugins block so its types land on the (single) script classpath; apply() only fires under -Pandroid.enabled=true.
  • The AGP plugin marker now resolves against google() at sync time even for JVM-only builds — comments in kt/moq/build.gradle.kts, kt/settings.gradle.kts, kt/gradle.properties, and kt/README.md updated to reflect that.
  • Widen the release-kt.yml PR trigger from kt/scripts/package.sh to kt/** so future Kotlin build edits get exercised by the dry-run.

Stop publishing moq-clock and @moq/clock

Both are example binaries — useful as a moq-net reference and for sanity-checking relays, not something anyone should be cargo installing or npm installing.

  • rs/moq-clock/Cargo.toml: publish = false so cargo refuses to push.
  • .release-plz.toml: per-package release = false so release-plz stops bumping the version, tagging, and invoking cargo publish.
  • Delete .github/workflows/moq-clock.yml (the per-tag binary release).
  • Delete .github/homebrew/Formula/moq-clock.rb.tmpl and remove moq-clock from release-brew.yml's workflow_run triggers + README seed.
  • js/clock/package.json: private: true so npm refuses to publish even if a release script gets added later.
  • rs/moq-clock/README.md: drop the cargo install instructions and crates.io/docs.rs badges; point users at cargo run -p moq-clock.

The crate stays in the workspace and builds with everything else; only the publish/release plumbing is severed. Existing artifacts (the moq-clock-v* GitHub Releases, crates.io versions, and moq-clock.rb in moq-dev/homebrew-tap) are left in place — they're immutable or out of scope for this change.

Test plan

  • Release Kotlin PR dry-run on this PR reaches :moq:publishToMavenLocal without unresolved references.
  • release-brew.yml dry-run still renders the remaining four templates cleanly.
  • Once merged, the next moq-ffi-v* tag actually publishes dev.moq:moq to Maven Central.
  • Once merged, the next release-plz PR no longer bumps moq-clock.

🤖 Generated with Claude Code

…nabled=true

`apply(from = "android.gradle.kts")` script plugins don't inherit the
parent's plugin classpath at compile time, so the apply-from script
couldn't resolve `kotlin {}`, `androidTarget`, `JvmTarget`, or
`com.android.build.gradle.LibraryExtension`. Every `moq-ffi-v*` tag has
been failing the Kotlin release with 35 unresolved references since the
file was introduced in #1432.

Fold the Android-specific source-set wiring and `LibraryExtension`
config back into the module's `build.gradle.kts`, guarded by
`if (androidEnabled)`. Declare AGP `apply false` in the plugins block so
its types are on the (single) script classpath; the actual `apply` only
runs when `-Pandroid.enabled=true`. The plugin marker now resolves
against google() at sync even for JVM-only builds — comments updated to
reflect that.

Also widen the release-kt.yml PR trigger from `kt/scripts/package.sh` to
`kt/**` so future Kotlin build edits get exercised by the dry-run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

Review Change Stack

Walkthrough

This PR refactors Android build configuration in the Kotlin Multiplatform moq module and clarifies the Android opt-in model across documentation and configuration. The changes consolidate Android-specific Gradle setup from a separate android.gradle.kts file into moq/build.gradle.kts while maintaining the gate behind the -Pandroid.enabled=true flag. Documentation in gradle.properties, settings.gradle.kts, and README is updated to explain that the AGP plugin is available during sync but not applied without the flag, allowing JVM builds without an Android SDK. The release workflow trigger is also broadened to watch all kt/** changes instead of only the package script.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title focuses on inlining android.gradle.kts, which is the primary technical fix for the Kotlin release compilation failure. However, the description also includes a second major objective: stopping publication of moq-clock and @moq/clock. The title only partially captures the main changeset. Revise the title to reflect both major objectives, such as: 'Fix Kotlin release and stop publishing moq-clock' or split into a more focused scope that matches just the first objective.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description clearly explains both the Kotlin release build fix (with detailed technical reasoning) and the moq-clock publication cleanup, directly corresponding to the file changes across the repository.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/sad-matsumoto-9d7dcc
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/sad-matsumoto-9d7dcc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Both are example binaries — useful as a moq-net reference and for
sanity-checking relays, not something anyone should be `cargo install`ing
or `npm install`ing.

- rs/moq-clock/Cargo.toml: `publish = false` so cargo refuses to push.
- .release-plz.toml: per-package `release = false` so release-plz stops
  bumping the version, tagging, and invoking cargo publish.
- Delete .github/workflows/moq-clock.yml (the per-tag binary release).
- Delete .github/homebrew/Formula/moq-clock.rb.tmpl and remove moq-clock
  from release-brew.yml's workflow_run triggers + README seed.
- js/clock/package.json: `private: true` so npm refuses to publish even
  if a `release` script gets added later.
- rs/moq-clock/README.md: drop the `cargo install` instructions and the
  crates.io/docs.rs badges; point users at `cargo run -p moq-clock`.

The crate stays in the workspace and builds with everything else; only
the publish/release plumbing is severed.

Existing artifacts (the moq-clock-v* GitHub Releases, crates.io
versions, and the moq-clock.rb in moq-dev/homebrew-tap) are left in
place — they're immutable / out of scope for this change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kixelated kixelated changed the title fix(kt): inline android.gradle.kts so Kotlin release compiles Fix Kotlin release; stop publishing moq-clock + @moq/clock May 24, 2026
@kixelated kixelated merged commit f9eb9db into main May 24, 2026
13 checks passed
@kixelated kixelated deleted the claude/sad-matsumoto-9d7dcc branch May 24, 2026 20:33
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.

1 participant