Skip to content

[android][breaking]Target jvm 11#79

Open
kiftio wants to merge 2 commits into
compile-with-kotlin2.xfrom
target-jvm-11
Open

[android][breaking]Target jvm 11#79
kiftio wants to merge 2 commits into
compile-with-kotlin2.xfrom
target-jvm-11

Conversation

@kiftio
Copy link
Copy Markdown
Contributor

@kiftio kiftio commented May 13, 2026

Summary

Raises the library's JVM target from 1.8 to 11. Unblocks Mockito 5.x in tests. Bundles two adjacent Kotlin-2.0 cleanups while we're cutting the major version: closing the Configuration.copy() visibility leak, and migrating tests off deprecated ShadowWebView.setCanGoBack.

Changes

  • lib/build.gradle: compileOptions.sourceCompatibility / targetCompatibility 1.8 → 11; Kotlin jvmTarget 1.8 → 11.
  • lib/build.gradle: Mockito core / kotlin / android 4.x → 5.x. // noinspection NewerVersionAvailable comments dropped — the JVM-target constraint they explained is gone.
  • lib/src/main/.../Configuration.kt: @ConsistentCopyVisibility annotation. Generated copy() now matches the primary constructor's internal visibility, closing the leak where consumers could bypass internal constructor via cfg.copy(...). Kotlin 2.5 will make this an error anyway.
  • lib/api/lib.api: 2-line removal — Configuration.copy(...) and copy$default(...) no longer in the public AAR.
  • lib/src/test/.../CheckoutDialogTest.kt: pushEntryToHistory(...) replaces deprecated setCanGoBack(true) in two back-press tests. Single inline comment explains the pattern.
  • CLAUDE.md: JVM-target reference 1.8 → 11; Mockito 4.x pin note dropped.

Why now

  • Major-version cut is the natural place to raise the JVM target.
  • Mockito 4.x has been pinned only because of the 1.8 floor; the // noinspection comments in lib/build.gradle flagged this explicitly. With JVM 11 in place, Mockito 5.x is unblocked.
  • The Configuration.copy() deprecation is a Kotlin 2.0+ language warning that will be a hard error in Kotlin 2.5. The breaking-API cost is small (only consumers calling cfg.copy() to construct dangling objects, which has no useful end-point) and the cost grows the longer we delay.
  • ShadowWebView.setCanGoBack is deprecated in Robolectric 4.16+ and slated for removal; the supported replacement is populating fake web history.

Consumer impact

  • JVM target: consumers must build with JDK 11+. This is the headline breaking change — needs a release-notes line.
  • API: Configuration.copy(...) and copy$default(...) removed (see lib.api). Affects only consumers explicitly calling .copy(...) on a Configuration. Since there is no setConfiguration(...) setter on the library, those calls already produced dangling objects with no library-visible effect.

Test plan

  • ./gradlew :lib:clean :lib:test :lib:detekt :lib:lintRelease :lib:apiCheck :lib:assembleRelease — green
  • Sample app ./gradlew assembleDebug from samples/MobileBuyIntegration/ — green
  • InteropTest (Java consumer test) — all cases pass
  • CheckoutDialogTest back-press cases (with new history-populated path) — pass

Stack

Stacked on compile-with-kotlin2.x. Merge after that one lands, or as a combined major-version cut.

Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

Releasing a new Swift version?
  • I have bumped the version in platforms/swift/ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated platforms/swift/CHANGELOG.md
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Android version?
  • I have bumped the versionName in platforms/android/lib/build.gradle
  • I have updated platforms/android/CHANGELOG.md
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

kiftio added 2 commits May 13, 2026 13:00
- @ConsistentCopyVisibility on Configuration so the generated copy()
  matches the primary constructor's internal visibility. Closes the
  leak where copy() could construct Configuration instances bypassing
  the internal constructor; Kotlin 2.5 will make this an error
  regardless. Public API change: Configuration.copy/copy$default are
  removed from the AAR (see lib/api/lib.api).
- pushEntryToHistory(...) replaces deprecated ShadowWebView.setCanGoBack
  in CheckoutDialogTest. Populating history is the supported way to
  make canGoBack() return true.
@kiftio kiftio requested a review from a team as a code owner May 13, 2026 12:09
@kiftio kiftio changed the title Target jvm 11 [android][breaking]Target jvm 11 May 13, 2026
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.

4 participants