Skip to content

Commit

Permalink
Build: Make bson-kotlin and bson-kotlinx optional (#1148)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rozza authored Jun 23, 2023
1 parent 307ec82 commit 63af01b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions driver-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
1 change: 1 addition & 0 deletions driver-kotlin-coroutine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 1 addition & 2 deletions driver-kotlin-sync/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand All @@ -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() }
Expand Down

0 comments on commit 63af01b

Please sign in to comment.