1
1
import org.elasticsearch.gradle.internal.info.BuildParams
2
+ import org.elasticsearch.gradle.internal.test.TestUtil
2
3
3
4
/*
4
5
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -29,6 +30,7 @@ tasks.named("javadoc").configure { enabled = false }
29
30
configurations {
30
31
expression
31
32
painless
33
+ nativeLib
32
34
}
33
35
34
36
dependencies {
@@ -45,6 +47,7 @@ dependencies {
45
47
implementation project(path : ' :libs:elasticsearch-simdvec' )
46
48
expression(project(path : ' :modules:lang-expression' , configuration : ' zip' ))
47
49
painless(project(path : ' :modules:lang-painless' , configuration : ' zip' ))
50
+ nativeLib(project(' :libs:elasticsearch-native' ))
48
51
api " org.openjdk.jmh:jmh-core:$versions . jmh "
49
52
annotationProcessor " org.openjdk.jmh:jmh-generator-annprocess:$versions . jmh "
50
53
// Dependencies of JMH
@@ -76,17 +79,8 @@ tasks.register("copyPainless", Copy) {
76
79
tasks. named(" run" ). configure {
77
80
executable = " ${ BuildParams.runtimeJavaHome} /bin/java"
78
81
args << " -Dplugins.dir=${ buildDir} /plugins" << " -Dtests.index=${ buildDir} /index"
79
- dependsOn " copyExpression" , " copyPainless"
80
- systemProperty ' es.nativelibs.path' , file(" ../libs/native/libraries/build/platform/${ platformName()} -${ os.arch} " )
81
- }
82
-
83
- String platformName () {
84
- String name = System . getProperty(" os.name" );
85
- if (name. startsWith(" Mac" )) {
86
- return " darwin" ;
87
- } else {
88
- return name. toLowerCase(Locale . ROOT );
89
- }
82
+ dependsOn " copyExpression" , " copyPainless" , configurations. nativeLib
83
+ systemProperty ' es.nativelibs.path' , TestUtil . getTestLibraryPath(file(" ../libs/native/libraries/build/platform/" ). toString())
90
84
}
91
85
92
86
spotless {
0 commit comments