Skip to content

Commit 63af01b

Browse files
authored
Build: Make bson-kotlin and bson-kotlinx optional (#1148)
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
1 parent 307ec82 commit 63af01b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

driver-core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def classifiers = ["linux-x86_64", "linux-aarch_64", "osx-x86_64", "osx-aarch_64
3737
dependencies {
3838
api project(path: ':bson', configuration: 'default')
3939
implementation project(path: ':bson-record-codec', configuration: 'default')
40-
implementation project(path: ':bson-kotlin', configuration: 'default')
41-
implementation project(path: ':bson-kotlinx', configuration: 'default')
40+
implementation project(path: ':bson-kotlin', configuration: 'default'), optional
41+
implementation project(path: ':bson-kotlinx', configuration: 'default'), optional
4242

4343
implementation "com.github.jnr:jnr-unixsocket:$jnrUnixsocketVersion", optional
4444
api platform("io.netty:netty-bom:$nettyVersion")

driver-kotlin-coroutine/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ dependencies {
6565

6666
api(project(path = ":bson", configuration = "default"))
6767
api(project(path = ":driver-reactive-streams", configuration = "default"))
68+
implementation(project(path = ":bson-kotlin", configuration = "default"))
6869

6970
testImplementation("org.jetbrains.kotlin:kotlin-reflect")
7071
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")

driver-kotlin-sync/build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
1919
plugins {
2020
id("org.jetbrains.kotlin.jvm")
2121
`java-library`
22-
kotlin("plugin.serialization")
2322

2423
// Test based plugins
2524
id("com.diffplug.spotless")
@@ -62,6 +61,7 @@ dependencies {
6261

6362
api(project(path = ":bson", configuration = "default"))
6463
api(project(path = ":driver-sync", configuration = "default"))
64+
implementation(project(path = ":bson-kotlin", configuration = "default"))
6565

6666
testImplementation("org.jetbrains.kotlin:kotlin-reflect")
6767
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
@@ -73,7 +73,6 @@ dependencies {
7373
integrationTestImplementation("org.jetbrains.kotlin:kotlin-test-junit")
7474
integrationTestImplementation(project(path = ":driver-sync"))
7575
integrationTestImplementation(project(path = ":driver-core"))
76-
integrationTestImplementation(project(path = ":bson-kotlinx"))
7776
}
7877

7978
kotlin { explicitApi() }

0 commit comments

Comments
 (0)