forked from opensearch-project/opensearch-oci-object-storage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
138 lines (118 loc) · 5.41 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
plugins {
id 'nebula.ospackage' version "8.3.0"
id 'checkstyle'
id "io.freefair.lombok" version "6.4.0"
id 'jacoco'
id 'java'
id 'java-library'
id "com.diffplug.spotless" version "6.17.0"
}
repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
allprojects {
version = '2.7.0'
}
subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'com.diffplug.spotless'
ext {
opensearch_version = System.getProperty("opensearch.version", "2.7.0-SNAPSHOT")
sdk_version = "3.10.0"
jackson_version = "2.14.2"
}
repositories {
mavenLocal()
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
// Fix dependency collision with opensearch
configurations.all {
if (it.state != Configuration.State.UNRESOLVED) return
resolutionStrategy {
force "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${jackson_version}"
force "com.fasterxml.jackson.core:jackson-annotations:${jackson_version}"
force "com.fasterxml.jackson.core:jackson-databind:${jackson_version}"
force "com.fasterxml.jackson.core:jackson-core:${jackson_version}"
force "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jackson_version}"
force "commons-codec:commons-codec:1.15"
force "org.apache.httpcomponents:httpcore:4.4.15"
force "jakarta.annotation:jakarta.annotation-api:2.1.1"
}
}
dependencies {
implementation "net.jodah:failsafe:2.4.0"
implementation "com.google.guava:guava:31.1-jre"
implementation "org.apache.commons:commons-lang3:3.9"
implementation "commons-io:commons-io:2.7"
/******************** Hacking transient dependencies for OCI SDK ********************/
// TODO: For some odd reason it seems that the OpenSearch gradle plugin overrides resolution of implementation
// configuration which is why this hack is needed so we can get the transient dependencies packaged properly
implementation("com.oracle.oci.sdk:oci-java-sdk-common-httpclient-jersey:${sdk_version}")
compileClasspath("com.oracle.oci.sdk:oci-java-sdk-common-httpclient-jersey:${sdk_version}")
testCompileClasspath("com.oracle.oci.sdk:oci-java-sdk-common-httpclient-jersey:${sdk_version}")
runtimeClasspath("com.oracle.oci.sdk:oci-java-sdk-common-httpclient-jersey:${sdk_version}")
testRuntimeClasspath("com.oracle.oci.sdk:oci-java-sdk-common-httpclient-jersey:${sdk_version}")
implementation("com.oracle.oci.sdk:oci-java-sdk-objectstorage:${sdk_version}")
compileClasspath("com.oracle.oci.sdk:oci-java-sdk-objectstorage:${sdk_version}")
testCompileClasspath("com.oracle.oci.sdk:oci-java-sdk-objectstorage:${sdk_version}")
runtimeClasspath("com.oracle.oci.sdk:oci-java-sdk-objectstorage:${sdk_version}")
testRuntimeClasspath("com.oracle.oci.sdk:oci-java-sdk-objectstorage:${sdk_version}")
runtimeClasspath("org.slf4j:slf4j-api") {
version {
strictly "1.7.33"
}
}
testRuntimeClasspath("org.slf4j:slf4j-api") {
version {
strictly "1.7.33"
}
}
/******************************* End of transient dependency hack for OCI SDK*****************************************/
implementation("com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:${jackson_version}")
implementation("com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:${jackson_version}")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${jackson_version}")
compileOnly "org.opensearch:opensearch:${opensearch_version}"
// Test dependencies
testImplementation 'org.assertj:assertj-core:3.18.1'
}
compileJava {
options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor'])
doFirst {
// TODO: do not fail build on warnings, need to fix all compiler warnings
options.compilerArgs.remove('-Werror')
// TODO: need to fix all java doc format
options.compilerArgs.remove('-Xdoclint:all')
}
}
spotless {
// optional: limit format enforcement to just the files changed by this feature branch
//ratchetFrom 'origin/main'
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
//indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
// only scan main source files
target 'src/main/**/*.java'
// Use the default importOrder configuration
importOrder()
removeUnusedImports()
// apply a specific flavor of google-java-format
googleJavaFormat('1.16.0').aosp().reflowLongStrings()
// fix formatting of type annotations
formatAnnotations()
}
}
}