@@ -11,12 +11,14 @@ import org.opensearch.gradle.test.RestIntegTestTask
11
11
import java.util.concurrent.Callable
12
12
13
13
apply plugin : ' java'
14
+ apply plugin : ' java-test-fixtures'
14
15
apply plugin : ' idea'
15
16
apply plugin : ' opensearch.opensearchplugin'
16
17
apply plugin : ' opensearch.pluginzip'
17
18
apply plugin : ' jacoco'
18
19
apply plugin : " com.diffplug.spotless"
19
20
apply plugin : ' io.freefair.lombok'
21
+ apply from : ' gradle/formatting.gradle'
20
22
21
23
def pluginName = ' opensearch-neural-search'
22
24
def pluginDescription = ' A plugin that adds dense neural retrieval into the OpenSearch ecosytem'
@@ -123,6 +125,25 @@ allprojects {
123
125
version = " ${ opensearch_build} "
124
126
targetCompatibility = JavaVersion . VERSION_11
125
127
sourceCompatibility = JavaVersion . VERSION_11
128
+
129
+ apply from : rootProject. file(' repositories.gradle' ). absoluteFile
130
+ plugins. withId(' java' ) {
131
+ sourceCompatibility = targetCompatibility = " 11"
132
+ }
133
+
134
+ afterEvaluate {
135
+ project. dependencyLicenses. enabled = false
136
+ project. thirdPartyAudit. enabled = false
137
+ project. loggerUsageCheck. enabled = false
138
+ project. forbiddenApis. ignoreFailures = false
139
+ project. forbiddenPatterns {
140
+ setEnabled(false )
141
+ }
142
+ project. testingConventions. enabled = false
143
+ project. validateNebulaPom. enabled = false
144
+ project. licenseFile = rootProject. file(' LICENSE.txt' )
145
+ project. noticeFile = rootProject. file(' NOTICE.txt' )
146
+ }
126
147
}
127
148
128
149
repositories {
@@ -144,6 +165,7 @@ dependencies {
144
165
zipArchive group : ' org.opensearch.plugin' , name :' opensearch-ml-plugin' , version : " ${ opensearch_build} "
145
166
compileOnly fileTree(dir : knnJarDirectory, include : ' *.jar' )
146
167
api group : ' org.opensearch' , name :' opensearch-ml-client' , version : " ${ opensearch_build} "
168
+ testFixturesImplementation " org.opensearch.test:framework:${ opensearch_version} "
147
169
implementation group : ' org.apache.commons' , name : ' commons-lang3' , version : ' 3.14.0'
148
170
// ml-common excluded reflection for runtime so we need to add it by ourselves.
149
171
// https://github.com/opensearch-project/ml-commons/commit/464bfe34c66d7a729a00dd457f03587ea4e504d9
@@ -154,6 +176,10 @@ dependencies {
154
176
runtimeOnly group : ' org.apache.commons' , name : ' commons-text' , version : ' 1.10.0'
155
177
runtimeOnly group : ' com.google.code.gson' , name : ' gson' , version : ' 2.10.1'
156
178
runtimeOnly group : ' org.json' , name : ' json' , version : ' 20231013'
179
+ testFixturesImplementation " org.opensearch:common-utils:${ version} "
180
+ testFixturesImplementation group : ' org.apache.commons' , name : ' commons-lang3' , version : ' 3.14.0'
181
+ testFixturesCompileOnly group : ' com.google.guava' , name : ' guava' , version :' 32.0.1-jre'
182
+ testFixturesCompileOnly fileTree(dir : knnJarDirectory, include : ' *.jar' )
157
183
}
158
184
159
185
// In order to add the jar to the classpath, we need to unzip the
@@ -173,6 +199,9 @@ compileJava {
173
199
compileTestJava {
174
200
options. compilerArgs. addAll([" -processor" , ' lombok.launch.AnnotationProcessorHider$AnnotationProcessor' ])
175
201
}
202
+ compileTestFixturesJava {
203
+ options. compilerArgs. addAll([" -processor" , ' lombok.launch.AnnotationProcessorHider$AnnotationProcessor' ])
204
+ }
176
205
177
206
def opensearch_tmp_dir = rootProject. file(' build/private/opensearch_tmp' ). absoluteFile
178
207
opensearch_tmp_dir. mkdirs()
@@ -284,16 +313,6 @@ run {
284
313
useCluster testClusters. integTest
285
314
}
286
315
287
- spotless {
288
- java {
289
- removeUnusedImports()
290
- importOrder ' java' , ' javax' , ' org' , ' com'
291
- eclipse(). configFile rootProject. file(' formatterConfig.xml' )
292
- trimTrailingWhitespace()
293
- endWithNewline()
294
- }
295
- }
296
-
297
316
jacocoTestReport {
298
317
dependsOn integTest, test
299
318
reports {
@@ -302,6 +321,7 @@ jacocoTestReport {
302
321
}
303
322
}
304
323
324
+ check. dependsOn spotlessCheck
305
325
check. dependsOn jacocoTestCoverageVerification
306
326
jacocoTestCoverageVerification. dependsOn jacocoTestReport
307
327
0 commit comments