From aba751a7b8497dbed8a729313acd11413f588c85 Mon Sep 17 00:00:00 2001 From: Jim Borden Date: Sat, 11 Apr 2026 11:41:56 +0900 Subject: [PATCH 1/5] Migrate to centralized version catalog Also update outdated files # Conflicts: # core_version.txt --- build.gradle => build.gradle.kts | 26 +++++--------- ce | 2 +- common | 2 +- core_version.txt | 2 +- gradle/libs.versions.toml | 43 ++++++++++++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle => settings.gradle.kts | 26 +++++++------- 7 files changed, 69 insertions(+), 34 deletions(-) rename build.gradle => build.gradle.kts (52%) create mode 100644 gradle/libs.versions.toml rename settings.gradle => settings.gradle.kts (55%) diff --git a/build.gradle b/build.gradle.kts similarity index 52% rename from build.gradle rename to build.gradle.kts index 4bade2cf..3dd8e574 100644 --- a/build.gradle +++ b/build.gradle.kts @@ -1,5 +1,5 @@ // -// Copyright (c) 2018 Couchbase, Inc. All rights reserved. +// Copyright (c) 2026 Couchbase, Inc. All rights reserved. // // Licensed under the Couchbase License Agreement (the "License"); // you may not use this file except in compliance with the License. @@ -12,22 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // -buildscript { - ext { - KOTLIN_VERSION = '1.9.24' - JACOCO_VERSION = '0.8.10' - } - repositories { - google() - mavenCentral() - } +// Plugin versions and dependency versions are centralized in gradle/libs.versions.toml. +// Plugin resolution is configured via pluginManagement in settings.gradle.kts. - // Kotlin has to be here or its plugin throws a fit - // Android has to be here or gradle thows a fit. - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN_VERSION}" - classpath 'com.android.tools.build:gradle:8.4.0' - } +tasks.register("devPublish") { + dependsOn( + ":ce:android:ce_android:devPublish", + ":ce:android-ktx:ce_android-ktx:devPublish", + ":ce:java:ce_java:devPublish" + ) } - diff --git a/ce b/ce index c677cda4..48bdbb56 160000 --- a/ce +++ b/ce @@ -1 +1 @@ -Subproject commit c677cda4bb7c28bdb7eefe205125a7caa95fa688 +Subproject commit 48bdbb56a3fe3db71f92deba1f167a53f0b76703 diff --git a/common b/common index b7bcaf74..e5073332 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit b7bcaf74dd4f4752ba75e05f5adaaf6988931df6 +Subproject commit e507333244feb93d7196b621b046aaf5b4195b8b diff --git a/core_version.txt b/core_version.txt index a0d3ecb8..ef241730 100644 --- a/core_version.txt +++ b/core_version.txt @@ -1 +1 @@ -4.1.0-24 +4.1.0-64 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..ec8801f0 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,43 @@ +# This file will leave here and in the EE root, please keep them in sync + +[versions] +compileSdk = "36" +minSdk = "24" +buildTools = "36.0.0" +ndk = "27.2.12479018" +cmake = "3.30.5" +kotlin = "2.3.20" +agp = "9.1.0" +spotbugsPlugin = "6.4.8" +okhttp = "4.12.0" +checkstyle = "8.42" +sevntu = "1.44.1" +pmd = "6.55.0" +spotbugs = "4.9.8" +androidxAnnotation = "1.10.0" +junit = "4.13.2" +androidxTest = "1.7.0" +dokka = "1.9.20" +coroutines = "1.8.0" +work = "2.8.1" + +[libraries] +okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } +kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +spotbugs-annotations = { module = "com.github.spotbugs:spotbugs-annotations", version.ref = "spotbugs" } +androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidxAnnotation" } +junit = { module = "junit:junit", version.ref = "junit" } +androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidxTest" } +androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTest" } +androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTest" } +sevntu = { module = "com.github.sevntu-checkstyle:sevntu-checks", version.ref = "sevntu" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } +androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "work" } +androidx-work-testing = { module = "androidx.work:work-testing", version.ref = "work" } + +[plugins] +android-library = { id = "com.android.library", version.ref = "agp" } +spotbugs = { id = "com.github.spotbugs-base", version.ref = "spotbugsPlugin" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 17655d0e..2f2958b9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle.kts similarity index 55% rename from settings.gradle rename to settings.gradle.kts index 6e845439..9a0f19b4 100644 --- a/settings.gradle +++ b/settings.gradle.kts @@ -1,5 +1,13 @@ +pluginManagement { + repositories { + google() + gradlePluginPortal() + mavenCentral() + } +} + // This project contains two distinct applications: -// 1) the CBL-Android-EE source and the code to build, unit-test and publish it to maven +// 1) the CBL-Android-CE source and the code to build, unit-test and publish it to maven // 2) an independent application that runs automated tests on the application build in #1 // // The two apps are mutually exclusive: the test app is built and run only by CI machines @@ -12,18 +20,10 @@ // for the test projects in sync // -// normal source development -def module = "lib" - -// use the test application, instead, if testing -if (hasProperty("automatedTests") && automatedTests.toBoolean()) { module = 'test' } +val module = if (providers.gradleProperty("automatedTests").map { it.toBoolean() }.getOrElse(false)) "test" else "lib" -include "ce:android:lib", "ee:android:lib", "ce:android-ktx:${module}", "ee:android-ktx:${module}", "ce:java:${module}", "ee:java:${module}" +include("ce:android:lib", "ce:android-ktx:$module", "ce:java:$module") -project(":ee:android:lib").name = "ee_android" project(":ce:android:lib").name = "ce_android" -project(":ee:android-ktx:${module}").name = "ee_android-ktx" -project(":ce:android-ktx:${module}").name = "ce_android-ktx" -project(":ee:java:${module}").name = "ee_java" -project(":ce:java:${module}").name = "ce_java" - +project(":ce:android-ktx:$module").name = "ce_android-ktx" +project(":ce:java:$module").name = "ce_java" \ No newline at end of file From 53d1aa886fb42f3de25088e540f41d9cb5a483ea Mon Sep 17 00:00:00 2001 From: Jim Borden Date: Sat, 11 Apr 2026 11:49:53 +0900 Subject: [PATCH 2/5] Add PR validation --- .github/workflows/ci-check.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/ci-check.yml diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml new file mode 100644 index 00000000..4ac82941 --- /dev/null +++ b/.github/workflows/ci-check.yml @@ -0,0 +1,21 @@ +name: CI Check + +on: + pull_request: + branches: + - master + - '**/release/**' + +jobs: + ci-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + - name: Run ciCheck + run: ./gradlew ciCheck + working-directory: android From 4e2ea11c2b9adbc7f57b7bc033d327bebe25a511 Mon Sep 17 00:00:00 2001 From: Jim Borden Date: Sat, 11 Apr 2026 11:50:48 +0900 Subject: [PATCH 3/5] Fix PR validation --- .github/workflows/ci-check.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index 4ac82941..4b1e6869 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -18,4 +18,3 @@ jobs: distribution: 'temurin' - name: Run ciCheck run: ./gradlew ciCheck - working-directory: android From ecddb4d4041dae5510813dd3c32ce9691586ede6 Mon Sep 17 00:00:00 2001 From: Jim Borden Date: Sat, 11 Apr 2026 11:53:42 +0900 Subject: [PATCH 4/5] PR validation recursive checkout --- .github/workflows/ci-check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml index 4b1e6869..926cfb48 100644 --- a/.github/workflows/ci-check.yml +++ b/.github/workflows/ci-check.yml @@ -11,6 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: recursive - name: Set up JDK uses: actions/setup-java@v4 with: From 91a8ed5ef16ee7377a2aa753d5fbef9657af73d1 Mon Sep 17 00:00:00 2001 From: Jim Borden Date: Sat, 11 Apr 2026 12:00:54 +0900 Subject: [PATCH 5/5] Give up on PR validation, needs VPN access --- .github/workflows/ci-check.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .github/workflows/ci-check.yml diff --git a/.github/workflows/ci-check.yml b/.github/workflows/ci-check.yml deleted file mode 100644 index 926cfb48..00000000 --- a/.github/workflows/ci-check.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: CI Check - -on: - pull_request: - branches: - - master - - '**/release/**' - -jobs: - ci-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - name: Run ciCheck - run: ./gradlew ciCheck