Skip to content

Commit ccf7c75

Browse files
authored
Migrate to centralized version catalog (#28)
Also update outdated files
1 parent e9409cb commit ccf7c75

7 files changed

Lines changed: 69 additions & 34 deletions

File tree

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright (c) 2018 Couchbase, Inc. All rights reserved.
2+
// Copyright (c) 2026 Couchbase, Inc. All rights reserved.
33
//
44
// Licensed under the Couchbase License Agreement (the "License");
55
// you may not use this file except in compliance with the License.
@@ -12,22 +12,14 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414
//
15-
buildscript {
16-
ext {
17-
KOTLIN_VERSION = '1.9.24'
18-
JACOCO_VERSION = '0.8.10'
19-
}
2015

21-
repositories {
22-
google()
23-
mavenCentral()
24-
}
16+
// Plugin versions and dependency versions are centralized in gradle/libs.versions.toml.
17+
// Plugin resolution is configured via pluginManagement in settings.gradle.kts.
2518

26-
// Kotlin has to be here or its plugin throws a fit
27-
// Android has to be here or gradle thows a fit.
28-
dependencies {
29-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN_VERSION}"
30-
classpath 'com.android.tools.build:gradle:8.4.0'
31-
}
19+
tasks.register("devPublish") {
20+
dependsOn(
21+
":ce:android:ce_android:devPublish",
22+
":ce:android-ktx:ce_android-ktx:devPublish",
23+
":ce:java:ce_java:devPublish"
24+
)
3225
}
33-

common

Submodule common updated 29 files

core_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.1.0-24
1+
4.1.0-64

gradle/libs.versions.toml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This file will leave here and in the EE root, please keep them in sync
2+
3+
[versions]
4+
compileSdk = "36"
5+
minSdk = "24"
6+
buildTools = "36.0.0"
7+
ndk = "27.2.12479018"
8+
cmake = "3.30.5"
9+
kotlin = "2.3.20"
10+
agp = "9.1.0"
11+
spotbugsPlugin = "6.4.8"
12+
okhttp = "4.12.0"
13+
checkstyle = "8.42"
14+
sevntu = "1.44.1"
15+
pmd = "6.55.0"
16+
spotbugs = "4.9.8"
17+
androidxAnnotation = "1.10.0"
18+
junit = "4.13.2"
19+
androidxTest = "1.7.0"
20+
dokka = "1.9.20"
21+
coroutines = "1.8.0"
22+
work = "2.8.1"
23+
24+
[libraries]
25+
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
26+
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
27+
spotbugs-annotations = { module = "com.github.spotbugs:spotbugs-annotations", version.ref = "spotbugs" }
28+
androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "androidxAnnotation" }
29+
junit = { module = "junit:junit", version.ref = "junit" }
30+
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidxTest" }
31+
androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTest" }
32+
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidxTest" }
33+
sevntu = { module = "com.github.sevntu-checkstyle:sevntu-checks", version.ref = "sevntu" }
34+
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
35+
androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "work" }
36+
androidx-work-testing = { module = "androidx.work:work-testing", version.ref = "work" }
37+
38+
[plugins]
39+
android-library = { id = "com.android.library", version.ref = "agp" }
40+
spotbugs = { id = "com.github.spotbugs-base", version.ref = "spotbugsPlugin" }
41+
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
42+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
43+
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
pluginManagement {
2+
repositories {
3+
google()
4+
gradlePluginPortal()
5+
mavenCentral()
6+
}
7+
}
8+
19
// This project contains two distinct applications:
2-
// 1) the CBL-Android-EE source and the code to build, unit-test and publish it to maven
10+
// 1) the CBL-Android-CE source and the code to build, unit-test and publish it to maven
311
// 2) an independent application that runs automated tests on the application build in #1
412
//
513
// The two apps are mutually exclusive: the test app is built and run only by CI machines
@@ -12,18 +20,10 @@
1220
// for the test projects in sync
1321
//
1422

15-
// normal source development
16-
def module = "lib"
17-
18-
// use the test application, instead, if testing
19-
if (hasProperty("automatedTests") && automatedTests.toBoolean()) { module = 'test' }
23+
val module = if (providers.gradleProperty("automatedTests").map { it.toBoolean() }.getOrElse(false)) "test" else "lib"
2024

21-
include "ce:android:lib", "ee:android:lib", "ce:android-ktx:${module}", "ee:android-ktx:${module}", "ce:java:${module}", "ee:java:${module}"
25+
include("ce:android:lib", "ce:android-ktx:$module", "ce:java:$module")
2226

23-
project(":ee:android:lib").name = "ee_android"
2427
project(":ce:android:lib").name = "ce_android"
25-
project(":ee:android-ktx:${module}").name = "ee_android-ktx"
26-
project(":ce:android-ktx:${module}").name = "ce_android-ktx"
27-
project(":ee:java:${module}").name = "ee_java"
28-
project(":ce:java:${module}").name = "ce_java"
29-
28+
project(":ce:android-ktx:$module").name = "ce_android-ktx"
29+
project(":ce:java:$module").name = "ce_java"

0 commit comments

Comments
 (0)