chore: bump android/apple/kotlin/swift deps to latest, migrate JVM SDKs to Gradle KTS#1521
chore: bump android/apple/kotlin/swift deps to latest, migrate JVM SDKs to Gradle KTS#1521
Conversation
…ate to Gradle KTS
Major version bumps across the four SDKs:
Android (templates/android/):
- AGP 8.2.2 → 9.1.1 (built-in Kotlin support, no kotlin-android plugin)
- Gradle 8.5 → 9.3.1
- Kotlin 1.9.10 → 2.3.20
- compileSdk/targetSdk 34 → 36
- OkHttp 4.12.0 → 5.3.2 (BOM-managed)
- coroutines 1.7.1 → 1.10.2, gson 2.10.1 → 2.11.0
- AndroidX bundle: lifecycle 2.8.7, appcompat 1.7.0, fragment 1.8.5,
activity 1.9.3, browser 1.8.0, core-ktx 1.15.0
- Test deps: robolectric 4.14.1, ext junit 1.2.1, test core 1.6.1
- Example deps: material 1.12.0, constraintlayout 2.2.0,
navigation 2.8.5, firebase BOM 33.7.0, espresso 3.6.1
- jvmTarget 1.8 → 11
- Migrated build.gradle / settings.gradle / scripts to Kotlin DSL
- nexus-publish 1.3.0 → 2.0.0
Kotlin (templates/kotlin/):
- Kotlin 1.9.10 → 2.3.20, Gradle 7.4.2 → 9.3.1
- OkHttp BOM 4.12.0 → 5.3.2, gson 2.9.0 → 2.11.0
- coroutines 1.7.1 → 1.10.2
- Migrated build.gradle / settings.gradle / scripts to Kotlin DSL,
inlined publish/setup scripts (apply-from can't access plugin types)
- Removed unused createBuildConfig task
- jvmTarget 1.8 → 11
Swift / Apple (templates/{swift,apple}/Package.swift.twig):
- swift-tools-version 5.1 → 6.0
- async-http-client 1.19.0 → 1.33.0
- swift-nio 2.58.0 → 2.94.0
- Platforms bumped: macOS 11→12, watchOS 7→8, tvOS 13→15
OkHttp 5 API adaptations:
- Realtime.kt RealWebSocket constructor adds webSocketCloseTimeout param
- ListenableCookieJar inlines cookieToString / delimiterOffset /
trimSubstring helpers (made internal in OkHttp 5)
- Model.kt adds null-safe `?.` for non-required sub_schema properties
(Kotlin 2.x stricter null checks)
Test/CI infrastructure:
- Android test docker images bumped to alvrme/alpine-android:android-36-jdk17
- Swift/Apple test docker images bumped from swift:5.6-focal to swift:6.0-jammy
- SDK build-validation Swift toolchain bumped from 5.9.2 to 6.0.3
- Dropped KotlinJava8Test, KotlinJava11Test (Gradle 9 needs JDK 17+)
- Dropped Android14Java8Test, Android14Java11Test (not in CI matrix; AGP 9 needs JDK 17+)
- CI matrix updated to drop KotlinJava8 / KotlinJava11 entries
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR bumps dependency versions across the Android, Kotlin, Swift, and Apple SDKs, with OkHttp 4→5 as the headline change, and migrates both JVM SDKs from Groovy Gradle scripts to Kotlin DSL (
Confidence Score: 4/5Safe to merge pending resolution of the previously-flagged The Kotlin JVM target gap in the Android library, the
Important Files Changed
Reviews (7): Last reviewed commit: "fix(kotlin): align Kotlin SDK gradle wra..." | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Updates the generated Android, Kotlin (JVM), Swift, and Apple SDK templates to newer toolchains/dependencies, including migrating Android/Kotlin Gradle templates from Groovy to Kotlin DSL and adjusting Android source to be compatible with OkHttp 5.
Changes:
- Bumped Swift/Apple package toolchain & dependency versions and updated Swift CI images to Swift 6.
- Migrated Android + Kotlin SDK Gradle templates to Kotlin DSL, updated Gradle/AGP versions, and refreshed dependency sets.
- Adapted Android source templates for OkHttp 5 (Realtime
RealWebSocketsignature change; inlined internal cookie helpers) and tightened Kotlin null-safety in modeltoMap()generation.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Swift56Test.php | Swift Docker image updated to Swift 6.0 for SDK tests. |
| tests/KotlinJava8Test.php | Removed Kotlin-on-JDK8 CI test. |
| tests/KotlinJava11Test.php | Removed Kotlin-on-JDK11 CI test. |
| tests/AppleSwift56Test.php | Swift Docker image updated to Swift 6.0 for Apple SDK tests. |
| tests/Android5Java17Test.php | Android test Docker image moved to API 36 (JDK 17). |
| tests/Android14Java8Test.php | Removed Android-on-JDK8 CI test. |
| tests/Android14Java17Test.php | Android test Docker image moved to API 36 (JDK 17). |
| tests/Android14Java11Test.php | Removed Android-on-JDK11 CI test. |
| templates/swift/Package.swift.twig | Swift package tools/deps/platform bumps for Swift SDK template. |
| templates/kotlin/src/main/kotlin/io/appwrite/models/Model.kt.twig | Adjusted toMap() generation for nullable sub-schema properties (Kotlin 2.x null-safety). |
| templates/kotlin/settings.gradle.twig | Removed Groovy settings template. |
| templates/kotlin/settings.gradle.kts.twig | Added Kotlin DSL settings template. |
| templates/kotlin/scripts/setup.gradle | Removed Groovy setup script (now inlined into KTS build). |
| templates/kotlin/scripts/publish.gradle | Removed Groovy publish script (now inlined into KTS build). |
| templates/kotlin/scripts/configure.gradle | Removed unused BuildConfig generation script. |
| templates/kotlin/gradle/wrapper/gradle-wrapper.properties | Updated Kotlin template Gradle wrapper version. |
| templates/kotlin/build.gradle.twig | Removed Groovy build template. |
| templates/kotlin/build.gradle.kts.twig | Added Kotlin DSL build template (deps + publishing/signing + nexus publish config). |
| templates/apple/Package.swift.twig | Swift package tools/deps/platform bumps for Apple SDK template. |
| templates/android/settings.gradle.kts | Added Kotlin DSL settings with pluginManagement/repository management. |
| templates/android/settings.gradle | Removed Groovy settings file. |
| templates/android/scripts/publish-module.gradle | Removed Groovy publishing script (publishing now inlined). |
| templates/android/scripts/publish-config.gradle | Removed Groovy publish config script (publishing now inlined). |
| templates/android/library/src/main/java/io/package/services/Realtime.kt.twig | Updated RealWebSocket construction for OkHttp 5 API change. |
| templates/android/library/src/main/java/io/package/models/Model.kt.twig | Adjusted toMap() generation for nullable sub-schema properties (Kotlin 2.x null-safety). |
| templates/android/library/src/main/java/io/package/cookies/ListenableCookieJar.kt.twig | Inlined cookie helper functions removed from OkHttp internals in v5. |
| templates/android/library/build.gradle.twig | Removed Groovy Android library build template. |
| templates/android/library/build.gradle.kts.twig | Added Kotlin DSL Android library build template (deps + publishing/signing). |
| templates/android/gradle/wrapper/gradle-wrapper.properties | Updated Android template Gradle wrapper to 9.3.1. |
| templates/android/example/build.gradle.twig | Removed Groovy Android example build template. |
| templates/android/example/build.gradle.kts.twig | Added Kotlin DSL Android example build template and updated deps. |
| templates/android/build.gradle.twig | Removed Groovy top-level Android build template. |
| templates/android/build.gradle.kts.twig | Added Kotlin DSL top-level Android build template including nexus publishing config. |
| src/SDK/Language/Kotlin.php | Switched generated Kotlin SDK to KTS build/settings files and removed old script copies. |
| src/SDK/Language/Android.php | Switched generated Android SDK to KTS build/settings files and removed old script copies. |
| .github/workflows/tests.yml | Removed KotlinJava8/11 jobs from CI matrix. |
| .github/workflows/sdk-build-validation.yml | Updated Swift toolchain download to Swift 6.0.3. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists No newline at end of file | ||
| zipStorePath=wrapper/dists |
| 'cp tests/languages/swift/Tests.swift tests/sdks/swift/Tests/AppwriteTests/Tests.swift', | ||
| ]; | ||
| protected string $command = | ||
| 'docker run --network="mockapi" --rm -v $(pwd):/app -w /app/tests/sdks/swift swift:5.6-focal swift test'; | ||
| 'docker run --network="mockapi" --rm -v $(pwd):/app -w /app/tests/sdks/swift swift:6.0-jammy swift test'; | ||
|
|
| 'cp tests/languages/apple/Tests.swift tests/sdks/apple/Tests/AppwriteTests/Tests.swift', | ||
| ]; | ||
| protected string $command = | ||
| 'docker run --network="mockapi" --rm -v $(pwd):/app -w /app/tests/sdks/apple swift:5.6-focal swift test'; | ||
| 'docker run --network="mockapi" --rm -v $(pwd):/app -w /app/tests/sdks/apple swift:6.0-jammy swift test'; | ||
|
|
| 'chmod +x tests/sdks/android/gradlew', | ||
| ]; | ||
| protected string $command = | ||
| 'docker run --network="mockapi" --rm -v $(pwd):/app -w /app/tests/sdks/android alvrme/alpine-android:android-21-jdk17 sh -c "./gradlew :library:testReleaseUnitTest --stacktrace -q && cat library/result.txt"'; | ||
| 'docker run --network="mockapi" --rm -v $(pwd):/app -w /app/tests/sdks/android alvrme/alpine-android:android-36-jdk17 sh -c "./gradlew :library:testReleaseUnitTest --stacktrace -q && cat library/result.txt"'; | ||
|
|
| 'chmod +x tests/sdks/android/gradlew', | ||
| ]; | ||
| protected string $command = | ||
| 'docker run --rm --network="mockapi" -v $(pwd):/app -w /app/tests/sdks/android alvrme/alpine-android:android-34-jdk17 sh -c "./gradlew :library:testReleaseUnitTest --stacktrace -q && cat library/result.txt"'; | ||
| 'docker run --rm --network="mockapi" -v $(pwd):/app -w /app/tests/sdks/android alvrme/alpine-android:android-36-jdk17 sh -c "./gradlew :library:testReleaseUnitTest --stacktrace -q && cat library/result.txt"'; | ||
|
|
AGP 9 only generates testDebugUnitTest by default for library modules; the release variant unit test task is no longer registered unless explicitly enabled. Switching the Android5Java17 / Android14Java17 commands to the debug variant aligns with the new default. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Robolectric 4.14.1 fails to load conscrypt_openjdk_jni native libs in CI causing UnsatisfiedLinkError before our test code ever runs. Robolectric 4.16.1 includes fixes for native lib resolution, and setting robolectric.conscryptMode=OFF avoids the OpenSSL provider init path entirely (the SDK uses OkHttp's default JSSE socket factory, so we don't need Conscrypt for tests). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Removing -q lets the actual error surface in CI logs while keeping stdout reserved for result.txt so phpunit assertions still match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pin Android/Kotlin SDKs to the floor consumers can actually reach
today instead of the bleeding edge:
- AGP 9.1.1 → 8.13.0 (latest 8.x; consumers don't need AGP 9 toolchain)
- Gradle 9.3.1 → 8.13
- Kotlin 2.3.20 → 2.2.21
Kotlin 2.2.x is the floor: OkHttp 5.3.2 (and the Okio/Kotlin
transitives it brings in) are themselves built with Kotlin 2.2,
so dropping below 2.2 would cause "incompatible Kotlin metadata
version" errors at consume time. 2.2.21 is the latest patch.
AGP 8.x still needs the kotlin-android plugin and the
android.kotlinOptions { jvmTarget = "11" } block; restored both.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Consumers were crashing on launch when their app already had OkHttp 5.x
and Gradle resolved OkHttp 5.x globally — the SDK had been compiled
against OkHttp 4.x internal symbols that no longer exist (or moved
behind 'internal' visibility) in 5.x.
Switching to OkHttp's public surface so the SDK works against any
OkHttp 5.x at runtime, regardless of which patch the consumer pins:
- Realtime.kt: replace direct RealWebSocket construction (internal
class in okhttp3.internal.ws) with the public
OkHttpClient.newWebSocket(request, listener) API. WebSocket
configuration (pingInterval, webSocketCloseTimeout,
minWebSocketMessageToCompress) still flows through OkHttpClient
via the public Builder, so behaviour is unchanged.
- ListenableCookieJar.kt: drop okhttp3.internal.platform.Platform.
Use android.util.Log for the IOException warning instead. Kept the
inlined cookieToString / delimiterOffset / trimSubstring helpers
added earlier — those were already internal-free.
Dependency declaration:
- library/build.gradle.kts: switch okhttp from
`implementation` (with BOM) to `api("com.squareup.okhttp3:okhttp:5.3.2")`
so the consumer sees the SDK's OkHttp dependency transitively and
Gradle dependency resolution (highest-version-wins) picks a single
compatible artifact. With public-only API surface, the SDK will
also keep compiling against future OkHttp 5.x patches without
source changes.
Restored AGP 9 (revert of previous AGP 8.13 fallback):
- AGP 9.1.1, Gradle 9.3.1 — Kotlin 2.2.x is already the consumer floor
(forced transitively by OkHttp 5.3.2's own Kotlin metadata version),
so using AGP 9's built-in Kotlin support adds no extra cutoff.
- Removed the kotlin-android plugin from root + module builds (AGP 9
enables Kotlin support by default).
- Removed the android.kotlinOptions block (AGP 9 derives jvmTarget
from compileOptions.targetCompatibility).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| import java.util.Properties | ||
|
|
||
| plugins { | ||
| kotlin("jvm") version "2.2.21" |
There was a problem hiding this comment.
The Kotlin JVM plugin is pinned to
2.2.21, but the PR description states the upgrade target is Kotlin 2.3.20. 2.2.21 is not a standard Kotlin release (patch versions in the 2.x series increment by 10: .0, .10, .20), so this looks like a transposition of 2.3.20. If Gradle resolves this version and cannot find it, the build will fail; if it silently falls back, users will get an older compiler than documented.
| kotlin("jvm") version "2.2.21" | |
| kotlin("jvm") version "2.3.20" |
Caught by Copilot review: the Kotlin SDK gradle-wrapper.properties was still pinned to Gradle 8.13 from the earlier AGP 8.13 downshift, while the Android template moved back to 9.3.1 when AGP 9 was restored. Both SDKs should track the same Gradle version. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Latest-compatible dependency bumps across the four Apple/JVM SDKs, with the Android OkHttp 4 → 5 upgrade as the headline change. Android and Kotlin SDKs are also migrated from Groovy to Kotlin DSL gradle scripts.
Android
kotlin-androidplugin requirement)Kotlin
Swift / Apple
swift-tools-version5.1 → 6.0Gradle KTS migration (Android + Kotlin)
*.gradle/*.gradle.twigrewritten as*.gradle.kts/*.gradle.kts.twigbuild.gradle.kts(Kotlin DSLapply(from = …)cannot resolve plugin extension types)settings.gradle.ktsfor Android addspluginManagement { google() }for AGP plugin resolutioncreateBuildConfigtask in Kotlin SDKSource code adaptations for OkHttp 5
Realtime.kt:RealWebSocketconstructor now takes awebSocketCloseTimeoutparameterListenableCookieJar.kt: inlinedcookieToString,delimiterOffset,trimSubstring(madeinternalin OkHttp 5)Model.kt(kotlin + android): non-required sub-schema properties now use?.toMap()/?.map { it.toMap() }(Kotlin 2.x stricter null checks)Test / CI infrastructure
alvrme/alpine-android:android-{21,34}-jdk17→android-36-jdk17swift:5.6-focal→swift:6.0-jammyKotlinJava8TestandKotlinJava11Test(Gradle 9 needs JDK 17+ to run)Android14Java8TestandAndroid14Java11Test(not in CI matrix, would also fail with AGP 9)Test plan
uvx djlint templates/ --lint) ✅ verified locallycomposer lint) ✅ verified locally🤖 Generated with Claude Code