Commit fd1f598
authored
[android][breaking]Target jvm 11 (#79)
## 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](./CONTRIBUTING.md)
> - [ ] I have read and agree with the [Code of Conduct](./CODE_OF_CONDUCT.md)
> - [ ] I've updated the relevant platform README (`platforms/swift/README.md` and/or `platforms/android/README.md`)
---
<details>
<summary>Releasing a new Swift version?</summary>
- [ ] 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)
</details>
<details>
<summary>Releasing a new Android version?</summary>
- [ ] 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`
</details>
> [!TIP]
> See the [Contributing documentation](./CONTRIBUTING.md) for the full release process per platform.1 parent 79de76a commit fd1f598
5 files changed
Lines changed: 14 additions & 15 deletions
File tree
- platforms/android
- lib
- api
- src
- main/java/com/shopify/checkoutkit
- test/java/com/shopify/checkoutkit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | | - | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1091 | 1091 | | |
1092 | 1092 | | |
1093 | 1093 | | |
1094 | | - | |
1095 | | - | |
1096 | 1094 | | |
1097 | 1095 | | |
1098 | 1096 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | 111 | | |
113 | | - | |
114 | 112 | | |
115 | | - | |
116 | 113 | | |
117 | 114 | | |
118 | 115 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
352 | 354 | | |
353 | 355 | | |
354 | 356 | | |
| |||
368 | 370 | | |
369 | 371 | | |
370 | 372 | | |
371 | | - | |
| 373 | + | |
| 374 | + | |
372 | 375 | | |
373 | 376 | | |
374 | 377 | | |
| |||
0 commit comments