Build modernization: Gradle 9.5, AGP 9.2, Kotlin 2.3, and tooling updates#736
Open
solcott wants to merge 18 commits into
Open
Build modernization: Gradle 9.5, AGP 9.2, Kotlin 2.3, and tooling updates#736solcott wants to merge 18 commits into
solcott wants to merge 18 commits into
Conversation
Contributor
Author
|
Looks like the following github actions are not on your orgs allow list: softprops/action-gh-release@v2 — used in create_swift_package.yml. Used for KMMBridge publishing. It looks like the Create Swift Package action has never been run. If you don't think it will be run in the future I can remove the KMMBridge support as well as create_swift_package.yml where these actions are used. |
… to 1.0.0 * Upgrade Gradle from 8.6 to 8.14.4 * Upgrade `org.gradle.toolchains.foojay-resolver-convention` from 0.8.0 to 1.0.0 Signed-off-by: scottolcott <scottolcott@gmail.com>
* Upgrade `actions/checkout` to v6 * Upgrade `actions/setup-java` to v5 * Migrate `gradle/gradle-build-action@v3` to `gradle/actions/setup-gradle@v6` * Upgrade `codecov/codecov-action` to v6 Signed-off-by: scottolcott <scottolcott@gmail.com>
The dependency is already added by Kotlin Target Hierarchy template Signed-off-by: scottolcott <scottolcott@gmail.com>
Signed-off-by: scottolcott <scottolcott@gmail.com>
Defining disabled rules was deprecated in build.gradle.kts files Signed-off-by: scottolcott <scottolcott@gmail.com>
* Migrate deprecated `kotlinOptions` to `compilerOptions` using `JvmTarget.JVM_11` in `build.gradle.kts` * Add `browser()` target to the `wasmJs` configuration block * Defer Kotlin compiler options configuration by using `compileTaskProvider.configure` for multiplatform and native targets * Add explicit `kotlinx-atomic-fu` dependencies to `nativeMain`, `jsMain`, and `wasmJsMain` source sets via the version catalog * Fix minor spacing formatting in `configureCocoapods` Signed-off-by: scottolcott <scottolcott@gmail.com>
* Add `updateDaemonJvm` task configuration in `build.gradle.kts` to target Java 17 and the Azul vendor * Add `gradle/gradle-daemon-jvm.properties` with platform-specific toolchain URLs generated by the task Signed-off-by: scottolcott <scottolcott@gmail.com>
Replace hardcoded JVM, SDK, and dependency versions with version catalog
references throughout the build scripts and convention plugins.
Introduce jvmToolchain=17 and jvmCompat=11 version catalog entries to
clearly separate toolchain from target compatibility: the Gradle daemon
and Java/Kotlin compilers run on JDK 17, while compiled bytecode targets
JVM 11 for downstream consumer compatibility.
Version catalog (libs.versions.toml):
- Bump androidCompileSdk/targetSdk 33 -> 34
- Bump androidGradlePlugin 8.0.0 -> 8.2.2
- Bump atomicFu 0.24.0 -> 0.26.1
- Bump dokkaGradlePlugin 1.9.20 -> 2.2.0
- Bump ktlintGradle 12.1.0 -> 12.3.0
- Bump jacocoGradlePlugin 0.8.12 -> 0.8.14
- Bump mavenPublishPlugin 0.34.0 -> 0.35.0
- Bump spotlessPluginGradle 6.4.1 -> 8.5.1
- Bump testCore 1.6.1 -> 1.7.0
- Bump kover 0.9.0-RC -> 0.9.8
- Bump truth 1.1.3 -> 1.4.5
- Bump binary-compatibility-validator 0.15.0-Beta.2 -> 0.18.1
- Add jvmToolchain (17) and jvmCompat (11) version entries
- Add spotless plugin alias
- Remove unused molecule and paging dependencies
Convention plugins:
- Add VersionCatalogExt.kt with typed accessors for version catalog
entries (jvmToolchain, jvmCompat, store, SDK versions)
- Replace hardcoded Versions object and magic numbers with version
catalog lookups in AndroidConventionPlugin and
KotlinMultiplatformConventionPlugin
- Wire jvmToolchain for compiler toolchain resolution (JDK 17) and
jvmCompat for sourceCompatibility/targetCompatibility (JVM 11)
- Migrate to Dokka 2.x API (DokkaExtension replaces DokkaTask)
- Add ktlint plugin and configure rules to preserve single-line
expression-body style (= with(project) {)
Root build.gradle.kts:
- Use version catalog alias for spotless plugin
- Derive JVM target/compatibility from libs.versions.jvmCompat
tooling/plugins/build.gradle.kts:
- Add ktlint plugin with rule overrides for expression-body formatting
- Derive Java/Kotlin JVM settings from version catalog
Signed-off-by: scottolcott <scottolcott@gmail.com>
…endencies
* Upgrade Gradle to 9.5.1 and Kotlin to 2.3.21
* Migrate from `com.android.library` to `com.android.kotlin.multiplatform.library` in convention plugins
* Enable Gradle configuration cache and disable configure-on-demand in `gradle.properties`
* Update coroutines testing API from `TestCoroutineScope` to `TestScope` and `runTest`
* Remove redundant `AndroidManifest.xml` files and centralize Android namespace configuration in convention plugins
* Add `-Xcontext-parameters` Kotlin compiler argument in tooling:plugin module
* Upgrade various dependencies:
* Android Gradle Plugin to 9.2.1
* Coroutines and Serialization to 1.11.0
* AtomicFU to 0.32.1
* Ktlint to 1.8.0 (plugin to 14.2.0)
* Update `configureAndroid` to use context receivers and the new `KotlinMultiplatformAndroidLibraryTarget` configuration block
* Temporarily comment out `kmmBridge` plugin and related configurations
Signed-off-by: scottolcott <scottolcott@gmail.com>
* Add `KMMBridge-Debug.yml` and `KMMBridge-Release.yml` workflows to trigger manual SPM builds * Update `create_swift_package.yml` to a reusable `workflow_call` that handles JDK 17 setup, GitHub releases, and `kmmBridgePublish` execution * Upgrade KMMBridge to version 1.2.1 and migrate plugin coordinates from `co.touchlab.faktory` to `co.touchlab.kmmbridge.github` * Enable and configure the KMMBridge plugin with SPM support in `KotlinMultiplatformConventionPlugin.kt` * Update `VERSION_NAME` to `5.1.0-SNAPSHOT` in `gradle.properties` * Uncomment KMMBridge dependencies in `build.gradle.kts` and tooling plugin configurations Signed-off-by: scottolcott <scottolcott@gmail.com>
* Move repository definitions to `dependencyResolutionManagement` and `pluginManagement` in `settings.gradle` * Replace legacy `buildscript` classpath dependencies with Version Catalog plugin aliases in `build.gradle.kts` * Remove redundant `allprojects` repository block * Update `libs.versions.toml` to include comprehensive plugin definitions and remove unused library entries * Fix typo in `updateDaemonJvm` task comment Signed-off-by: scottolcott <scottolcott@gmail.com>
Signed-off-by: scottolcott <scottolcott@gmail.com>
…upload * Add `contents: read`, `checks: write`, and `pull-requests: write` permissions to the `build-and-test` job * Add `--continue` flag to the Gradle build command to ensure all tests are executed * Add `mikepenz/action-junit-report@v5` step to publish test results * Restrict Codecov upload step to the `MobileNativeFoundation/Store` repository via an `if` condition Signed-off-by: scottolcott <scottolcott@gmail.com>
* Configure the `browser` target to use Karma with Chrome Headless * Set a 5s timeout for Mocha in both `browser` and `nodejs` test tasks Signed-off-by: scottolcott <scottolcott@gmail.com>
* Add `contents: write` and `packages: write` permissions to the `call-publish` job in `KMMBridge-Debug.yml` and `KMMBridge-Release.yml` Signed-off-by: scottolcott <scottolcott@gmail.com>
* Add `ENABLE_PUBLISHING=true` project property to the `create_swift_package.yml` workflow * Call `gitHubReleaseArtifacts()` within the KmmBridge configuration in `KotlinMultiplatformConventionPlugin` Signed-off-by: scottolcott <scottolcott@gmail.com>
* Remove `mikepenz/action-junit-report` step from `.github/workflows/ci.yml` Signed-off-by: scottolcott <scottolcott@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #736 +/- ##
=======================================
Coverage 80.17% 80.17%
=======================================
Files 42 42
Lines 928 928
Branches 177 177
=======================================
Hits 744 744
Misses 110 110
Partials 74 74 🚀 New features to boost your workflow:
|
Replace the separate debug/release dispatch workflows with a single KMMBridge-Publish workflow that publishes the release XCFramework. This removes the artifact-name collision that occurred when running both for the same version. For debugging Kotlin from Xcode, use KMMBridge local/dev publishing instead. Signed-off-by: scottolcott <scottolcott@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR modernizes the build infrastructure across the board — toolchain upgrades,
configuration cache adoption, CI improvements, and migration to current plugin APIs.
Changes
Gradle & Toolchain
gradle/gradle-daemon-jvm.propertiespinning the daemon to Azul JDK 17org.gradle.configuration-cache=true)configureondemand(incompatible with configuration cache)updateDaemonJvmtask configured for JDK 17 / AzulDependency & Plugin Updates
com.android.kotlin.multiplatform.libraryplugin)DokkaExtensionAPI)co.touchlab.kmmbridge.githubplugin)Build Script Modernization
buildscript {}block — all plugins now declared viaalias(libs.plugins.*)in the rootbuild.gradle.ktslibs.versions.tomlVersionCatalogExt.ktwith typed accessors for version catalog values (JVM toolchain, compat version, SDK levels, store version), replacing the hardcodedVersionsobjectjvmToolchain = 17,jvmCompat = 11)configureAndroid()updated for the new multiplatform Android library plugin API (namespace,withHostTest/withDeviceTest, compiler options)android { namespace = ... }andAndroidManifest.xmlfromcache,core, andmulticast— namespace now set centrally in the convention pluginsourceSets { val x by getting { } }tosourceSets { x { } }idiom across submodulesCI / GitHub Actions
actions/checkoutv4 → v6actions/setup-javav4 → v5gradle/gradle-build-action→gradle/actions/setup-gradle@v6codecov/codecov-actionv4 → v6permissionsblock to CI job (least-privilege:contents: read,checks: write,pull-requests: write)--continueflag to build step so all module failures are reported in one runmikepenz/action-junit-report@v5(runs on failure too)github.repository == 'MobileNativeFoundation/Store'to avoid failures on forkscreate_swift_package.yml/ KMMBridge workflows based on current KMMBridgeSPMQuickStart template; added separateKMMBridge-Debug.ymlandKMMBridge-Release.ymldispatch workflowsLint / Style
.editorconfigdisablingktlint_standard_import-orderingfor Kotlin filesadditionalEditorconfigrules to suppress several noisy checks project-wideOther
rx2: migrated deprecatedTestCoroutineScope→TestScopecacheAPI: relaxedgetAllPresent()fromabstractto default interface methodgradle.properties: removed deprecatedkotlin.js.compiler=irVERSION_NAMEset to5.1.0-SNAPSHOTfor development