From 4c679d2546c576697a7f3bead0bcc8a68641f266 Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Thu, 22 Jun 2023 17:23:16 +0100 Subject: [PATCH] Build: Make bson-kotlin and bson-kotlinx optional Reduce the dependency tree for driver-core by making the kotlin dependencies optional. Kotlin-coroutine and Kotlin-sync now take a hard dependency on bson-kotlin. So they will work out the box. Users will now have to opt into bson-kotlinx support. JAVA-5036 --- driver-core/build.gradle | 4 ++-- driver-kotlin-coroutine/build.gradle.kts | 1 + driver-kotlin-sync/build.gradle.kts | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/driver-core/build.gradle b/driver-core/build.gradle index ae92ccb0821..d474c2ff970 100644 --- a/driver-core/build.gradle +++ b/driver-core/build.gradle @@ -37,8 +37,8 @@ def classifiers = ["linux-x86_64", "linux-aarch_64", "osx-x86_64", "osx-aarch_64 dependencies { api project(path: ':bson', configuration: 'default') implementation project(path: ':bson-record-codec', configuration: 'default') - implementation project(path: ':bson-kotlin', configuration: 'default') - implementation project(path: ':bson-kotlinx', configuration: 'default') + implementation project(path: ':bson-kotlin', configuration: 'default'), optional + implementation project(path: ':bson-kotlinx', configuration: 'default'), optional implementation "com.github.jnr:jnr-unixsocket:$jnrUnixsocketVersion", optional api platform("io.netty:netty-bom:$nettyVersion") diff --git a/driver-kotlin-coroutine/build.gradle.kts b/driver-kotlin-coroutine/build.gradle.kts index 8df4185aa0e..0b4f1ee53ef 100644 --- a/driver-kotlin-coroutine/build.gradle.kts +++ b/driver-kotlin-coroutine/build.gradle.kts @@ -65,6 +65,7 @@ dependencies { api(project(path = ":bson", configuration = "default")) api(project(path = ":driver-reactive-streams", configuration = "default")) + implementation(project(path = ":bson-kotlin", configuration = "default")) testImplementation("org.jetbrains.kotlin:kotlin-reflect") testImplementation("org.jetbrains.kotlin:kotlin-test-junit") diff --git a/driver-kotlin-sync/build.gradle.kts b/driver-kotlin-sync/build.gradle.kts index c29d8c5e42e..223fa711a78 100644 --- a/driver-kotlin-sync/build.gradle.kts +++ b/driver-kotlin-sync/build.gradle.kts @@ -19,7 +19,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("org.jetbrains.kotlin.jvm") `java-library` - kotlin("plugin.serialization") // Test based plugins id("com.diffplug.spotless") @@ -62,6 +61,7 @@ dependencies { api(project(path = ":bson", configuration = "default")) api(project(path = ":driver-sync", configuration = "default")) + implementation(project(path = ":bson-kotlin", configuration = "default")) testImplementation("org.jetbrains.kotlin:kotlin-reflect") testImplementation("org.jetbrains.kotlin:kotlin-test-junit") @@ -73,7 +73,6 @@ dependencies { integrationTestImplementation("org.jetbrains.kotlin:kotlin-test-junit") integrationTestImplementation(project(path = ":driver-sync")) integrationTestImplementation(project(path = ":driver-core")) - integrationTestImplementation(project(path = ":bson-kotlinx")) } kotlin { explicitApi() }