forked from mongodb/mongo-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
99 lines (86 loc) · 4.21 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* Copyright 2008-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id 'com.github.gmazzo.buildconfig' version '3.0.3'
}
archivesBaseName = 'mongodb-driver-core'
description = 'Shared components for the Synchronous and Reactive Streams implementations of the MongoDB Java Driver.'
ext {
pomName = 'MongoDB Java Driver Core'
}
configurations {
consumableTestRuntimeOnly {
extendsFrom testRuntimeOnly
canBeConsumed = true
}
}
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 "com.github.jnr:jnr-unixsocket:$jnrUnixsocketVersion", optional
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
compileOnly "org.graalvm.sdk:nativeimage:$graalSdkVersion"
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
implementation "org.xerial.snappy:snappy-java:$snappyVersion", optional
implementation "com.github.luben:zstd-jni:$zstdVersion", optional
implementation "org.mongodb:mongodb-crypt:$mongoCryptVersion", optional
testImplementation project(':bson').sourceSets.test.output
testRuntimeOnly "io.netty:netty-tcnative-boringssl-static"
classifiers.forEach {
testRuntimeOnly "io.netty:netty-tcnative-boringssl-static::$it"
}
}
buildConfig {
className('MongoDriverVersion')
packageName('com.mongodb.internal.build')
useJavaOutput()
buildConfigField('String', 'NAME', '"mongo-java-driver"')
buildConfigField('String', 'VERSION', "\"${gitVersion}\"")
}
afterEvaluate {
jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.core'
jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-core'
jar.manifest.attributes['Import-Package'] = [
'!sun.misc.*', // Used by DirectBufferDeallocator only for java 8
'!sun.nio.ch.*', // Used by DirectBufferDeallocator only for java 8
'!javax.annotation.*', // Brought in by com.google.code.findbugs:annotations
'io.netty.*;resolution:=optional',
'com.amazonaws.*;resolution:=optional',
'software.amazon.awssdk.*;resolution:=optional',
'org.xerial.snappy.*;resolution:=optional',
'com.github.luben.zstd.*;resolution:=optional',
'org.slf4j.*;resolution:=optional',
'jnr.unixsocket.*;resolution:=optional',
'com.mongodb.crypt.capi.*;resolution:=optional',
'jdk.net.*;resolution:=optional', // Used by SocketStreamHelper & depends on JDK version
'org.bson.codecs.record.*;resolution:=optional', // Depends on JDK version
'org.bson.codecs.kotlin.*;resolution:=optional',
'org.bson.codecs.kotlinx.*;resolution:=optional',
'*' // import all that is not excluded or modified before
].join(',')
}