Skip to content

Ensure compatibility with older Kotlin consumers#3505

Merged
omarismail94 merged 1 commit into
square:masterfrom
omarismail94:updateagp
Jan 26, 2026
Merged

Ensure compatibility with older Kotlin consumers#3505
omarismail94 merged 1 commit into
square:masterfrom
omarismail94:updateagp

Conversation

@omarismail94

Copy link
Copy Markdown
Collaborator

Lowering the bundled stdlib version via coreLibrariesVersion. This prevents forcing a stdlib upgrade on our users. We:

  • Set Kotlin API and language versions to 2.0.
  • Explicitly set coreLibrariesVersion to 2.0.21 to maximize compatibility.
  • Force JS and Wasm stdlib dependencies to match the toolchain version as work-around for KT-71032

TESTED: ./gradlew clean check . I also published to local repository and checked the .module files for the artifacts and the kotlin-stdlib was correctly set to 2.0.21

Lowering the bundled stdlib version via coreLibrariesVersion. This prevents forcing a stdlib upgrade on our users. We:
* Set Kotlin API and language versions to 2.0.
* Explicitly set `coreLibrariesVersion` to 2.0.21 to maximize compatibility.
* Force JS and Wasm stdlib dependencies to match the toolchain version as work-around for KT-71032

TESTED: ./gradlew clean check . I also published to local repository and checked the .module files
for the artifacts and the kotlin-stdlib was correctly set to 2.0.21
Comment thread wire-gradle-plugin/build.gradle.kts
@omarismail94
omarismail94 merged commit b5dfc10 into square:master Jan 26, 2026
9 checks passed
@oldergod

Copy link
Copy Markdown
Member

Coming back to this thread because the implementation scope on KGP ended up breaking downstream consumers in 7.0.0-alpha05.
The plugin POM now carries a runtime dependency on kotlin-gradle-plugin (2.3.21 as of alpha05).
On the reasons given above for moving away from compileOnly — I think all three are about kotlin-stdlib, not KGP, and none of them actually need KGP at implementation scope:

  1. Consumers missing stdlib / too-old stdlib: the plugin's own kotlin-stdlib dependency stays in the POM at compile scope (pinned by coreLibrariesVersion to 2.0.21) regardless of KGP's scope. compileOnly on KGP doesn't remove it.
  2. Minimum stdlib bound: same — that bound comes from the stdlib dependency, which is unaffected.
  3. stdlib appearing in 6.0.0-alpha01 despite compileOnly: expected, and correct — that's the plugin's own code dependency, not KGP's.

I'm putting up a PR restoring compileOnly here #3661

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.

2 participants