diff --git a/build.gradle b/build.gradle index 26734755984..66d04b15ab3 100644 --- a/build.gradle +++ b/build.gradle @@ -173,12 +173,17 @@ configure(scalaProjects) { } configure(javaMainProjects) { - apply plugin: 'nebula.optional-base' apply plugin: 'java-library' + java { + registerFeature('slf4Dependency') { + usingSourceSet(sourceSets.main) + } + } + dependencies { compileOnly 'com.google.code.findbugs:jsr305:1.3.9' - api 'org.slf4j:slf4j-api:1.7.6', optional + slf4DependencyApi 'org.slf4j:slf4j-api:1.7.6' testImplementation 'com.google.code.findbugs:jsr305:1.3.9' // https://issues.apache.org/jira/browse/GROOVY-10194 diff --git a/driver-core/build.gradle b/driver-core/build.gradle index a44f65bbc1b..5b33ad03066 100644 --- a/driver-core/build.gradle +++ b/driver-core/build.gradle @@ -33,30 +33,84 @@ configurations { } } +task listConfigurations { + doLast { + configurations.each { config -> + println config.name + } + } +} + +java { + registerFeature('bsonKotlin') { + usingSourceSet(sourceSets.main) + } + registerFeature('bsonKotlinx') { + usingSourceSet(sourceSets.main) + } + registerFeature('mongodbCrypt') { + usingSourceSet(sourceSets.main) + } + registerFeature('jnrUnixsocket') { + usingSourceSet(sourceSets.main) + } + registerFeature('nettyBuffer') { + usingSourceSet(sourceSets.main) + } + registerFeature('nettyTransport') { + usingSourceSet(sourceSets.main) + } + registerFeature('nettyHandler') { + usingSourceSet(sourceSets.main) + } + registerFeature('awssdkAuth') { + usingSourceSet(sourceSets.main) + } + registerFeature('awssdkSts') { + usingSourceSet(sourceSets.main) + } + registerFeature('awsJavaSdkCore') { + usingSourceSet(sourceSets.main) + } + registerFeature('awsJavaSdkSts') { + usingSourceSet(sourceSets.main) + } + registerFeature('snappyJava') { + usingSourceSet(sourceSets.main) + } + registerFeature('zstdJni') { + usingSourceSet(sourceSets.main) + } + +} + def classifiers = ["linux-x86_64", "linux-aarch_64", "osx-x86_64", "osx-aarch_64", "windows-x86_64"] dependencies { api project(path: ':bson', configuration: 'default') implementation project(path: ':bson-record-codec', configuration: 'default') - implementation project(path: ':bson-kotlin', configuration: 'default'), optional - implementation project(path: ':bson-kotlinx', configuration: 'default'), optional - implementation project(path: ':mongodb-crypt', configuration: 'default'), optional - implementation "com.github.jnr:jnr-unixsocket:$jnrUnixsocketVersion", optional + bsonKotlinImplementation project(path: ':bson-kotlin', configuration: 'default') + bsonKotlinxImplementation project(path: ':bson-kotlinx', configuration: 'default') + + mongodbCryptApi project(path: ':mongodb-crypt', configuration: 'default') + jnrUnixsocketImplementation "com.github.jnr:jnr-unixsocket:$jnrUnixsocketVersion" + api platform("io.netty:netty-bom:$nettyVersion") - api "io.netty:netty-buffer", optional - api "io.netty:netty-transport", optional - api "io.netty:netty-handler", optional + nettyBufferImplementation "io.netty:netty-buffer" + nettyTransportImplementation "io.netty:netty-transport" + nettyHandlerImplementation "io.netty:netty-handler" + compileOnly "org.graalvm.sdk:graal-sdk:$graalSdkVersion" // Optionally depend on both AWS SDK v2 and v1. The driver will use v2 is present, v1 if present, or built-in functionality if // neither are present - implementation "software.amazon.awssdk:auth:$awsSdkV2Version", optional - implementation "software.amazon.awssdk:sts:$awsSdkV2Version", optional - implementation "com.amazonaws:aws-java-sdk-core:$awsSdkV1Version", optional - implementation "com.amazonaws:aws-java-sdk-sts:$awsSdkV1Version", optional + awssdkAuthImplementation "software.amazon.awssdk:auth:$awsSdkV2Version" + awssdkStsImplementation "software.amazon.awssdk:sts:$awsSdkV2Version" + awsJavaSdkCoreImplementation "com.amazonaws:aws-java-sdk-core:$awsSdkV1Version" + awsJavaSdkStsImplementation "com.amazonaws:aws-java-sdk-sts:$awsSdkV1Version" - implementation "org.xerial.snappy:snappy-java:$snappyVersion", optional - implementation "com.github.luben:zstd-jni:$zstdVersion", optional + snappyJavaImplementation "org.xerial.snappy:snappy-java:$snappyVersion" + zstdJniImplementation "com.github.luben:zstd-jni:$zstdVersion" testImplementation project(':bson').sourceSets.test.output testImplementation('org.junit.jupiter:junit-jupiter-api') diff --git a/driver-lambda/build.gradle b/driver-lambda/build.gradle index d7b9928e8f7..8b7d02eebe2 100644 --- a/driver-lambda/build.gradle +++ b/driver-lambda/build.gradle @@ -19,7 +19,7 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0' + classpath 'com.gradleup.shadow:shadow-gradle-plugin:8.3.5' } } @@ -28,7 +28,7 @@ plugins { } apply plugin: 'application' -apply plugin: 'com.github.johnrengelman.shadow' +apply plugin: 'com.gradleup.shadow' apply plugin: 'java' compileJava { diff --git a/driver-sync/build.gradle b/driver-sync/build.gradle index 1c2f3ac6c59..e20f70020ad 100644 --- a/driver-sync/build.gradle +++ b/driver-sync/build.gradle @@ -23,10 +23,100 @@ ext { dependencies { api project(path: ':bson', configuration: 'default') api project(path: ':driver-core', configuration: 'default') + implementation("org.jetbrains:annotations:13.0") // previously brought transitively by driver-core (via bson-kotlin) + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-jnr-unixsocket") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-bson-kotlin") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-bson-kotlinx") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-mongodb-crypt") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapability("org.mongodb:driver-core-netty-buffer") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-netty-transport") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-netty-handler") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-awssdk-auth") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-awssdk-sts") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-aws-java-sdk-core") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-aws-java-sdk-sts") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-snappy-java") + } + } + + api(project(path: ':driver-core')) { + capabilities { + requireCapabilities("org.mongodb:driver-core-zstd-jni") + } + } + + + + + + + +// includeLibraryWithCapabilities(":driver-core", [ +// "org.mongodb:driver-core-jnr-unixsocket", +// "org.mongodb:driver-core-bson-kotlin"] +// ) testImplementation project(':bson').sourceSets.test.output testImplementation project(':driver-core').sourceSets.test.output - testRuntimeOnly project(path: ':driver-core', configuration: 'consumableTestRuntimeOnly') +// testRuntimeOnly project(path: ':driver-core', configuration: 'consumableTestRuntimeOnly') testImplementation('com.amazonaws:aws-lambda-java-core:1.2.1') } diff --git a/driver-workload-executor/build.gradle b/driver-workload-executor/build.gradle index 7c48e444dc2..416f459cbb0 100644 --- a/driver-workload-executor/build.gradle +++ b/driver-workload-executor/build.gradle @@ -19,12 +19,12 @@ buildscript { maven { url "https://plugins.gradle.org/m2/" } } dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0' + classpath 'com.gradleup.shadow:shadow-gradle-plugin:8.3.5' } } apply plugin: 'application' -apply plugin: 'com.github.johnrengelman.shadow' +apply plugin: 'com.gradleup.shadow' mainClassName = "com.mongodb.workload.WorkloadExecutor" diff --git a/gradle/publish.gradle b/gradle/publish.gradle index 9add25f9261..c5d1855c980 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -86,12 +86,12 @@ configure(javaProjects) { project -> task sourcesJar(type: Jar) { from project.sourceSets.main.allJava - classifier = 'sources' + getArchiveClassifier().set('sources') } task javadocJar(type: Jar) { from javadoc - classifier = 'javadoc' + getArchiveClassifier().set('javadoc') } publishing { @@ -132,12 +132,12 @@ configure(scalaProjects) { project -> task sourcesJar(type: Jar) { from project.sourceSets.main.allScala - classifier = 'sources' + getArchiveClassifier().set('sources') } task scaladocJar(type: Jar) { from scaladoc - classifier = 'javadoc' + getArchiveClassifier().set('javadoc') } publishing { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e750102e092..d6e308a6378 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-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists