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 SummaryBroad dependency bump and tooling modernisation across the Android, Kotlin, Apple, and Swift SDKs, with the OkHttp 4 → 5 upgrade and Android/Kotlin Gradle KTS migration as the headline changes.
Minor note: the PR description lists Confidence Score: 5/5Safe to merge; the changes are version bumps and build-script migrations with all previously identified gaps already surfaced in earlier review threads. The core OkHttp 5 source adaptations are correct, the Gradle KTS templates are well-structured, and the Swift/Apple manifests look intentional. All meaningful findings were caught in prior review rounds; nothing new blocking was found in this pass. templates/android/library/build.gradle.kts.twig and templates/kotlin/gradle/wrapper/gradle-wrapper.properties were the subject of earlier threads and are worth a final sign-off once those items are addressed. Important Files Changed
Reviews (4): Last reviewed commit: "test: redirect gradle logs to stderr for..." | Re-trigger Greptile |
| 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 |
There was a problem hiding this comment.
The Kotlin SDK's Gradle wrapper is pinned to
9.1.0, but the PR description says the target is Gradle 9.3.1, and the Android SDK wrapper already uses 9.3.1. The two SDKs ending up with different Gradle versions is likely unintentional and can produce inconsistent CI results or resolve different dependency metadata.
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip | |
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip |
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>
| import okhttp3.HttpUrl | ||
| import okhttp3.internal.cookieToString | ||
| import okhttp3.internal.delimiterOffset | ||
| import okhttp3.internal.platform.Platform |
There was a problem hiding this comment.
Remaining OkHttp internal API usage after migration
The PR explicitly inlines delimiterOffset, trimSubstring, and cookieToString because they were made internal in OkHttp 5, but okhttp3.internal.platform.Platform was not addressed. Both saveFromResponse and loadForRequest still call Platform.get().log(…), which is an internal OkHttp API with no stability guarantee. A future OkHttp 5.x patch could relocate or remove Platform, breaking the generated SDK without warning. The standard replacement is java.util.logging.Logger (available everywhere) or android.util.Log.w() — the file already imports android.util.Log indirectly via the package.
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>
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