Skip to content

Commit 0889e3c

Browse files
committed
Painless: Add spi jar that will be published for extending whitelists (elastic#28302)
In order to build a plugin that extends the painless whitelist, the spi classes must be available to the plugin at compile time. This commit moves the spi classes into a separate jar which will be published. Any plugin authors whiching to extend painless through spi would then add a compileOnly dependency on this jar.
1 parent 2c2781b commit 0889e3c

File tree

7 files changed

+43
-2
lines changed

7 files changed

+43
-2
lines changed

distribution/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ ext.restTestExpansions = [
8383
// we create the buildModules task above so the distribution subprojects can
8484
// depend on it, but we don't actually configure it until here so we can do a single
8585
// loop over modules to also setup cross task dependencies and increment our modules counter
86-
project.rootProject.subprojects.findAll { it.path.startsWith(':modules:') }.each { Project module ->
86+
project.rootProject.subprojects.findAll { it.parent.path == ':modules' }.each { Project module ->
8787
buildFullNotice {
8888
def defaultLicensesDir = new File(module.projectDir, 'licenses')
8989
if (defaultLicensesDir.exists()) {

modules/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
subprojects {
20+
configure(subprojects.findAll { it.parent.path == project.path }) {
2121
group = 'org.elasticsearch.plugin' // for modules which publish client jars
2222
apply plugin: 'elasticsearch.esplugin'
2323

modules/lang-painless/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ integTestCluster {
3131
dependencies {
3232
compile 'org.antlr:antlr4-runtime:4.5.3'
3333
compile 'org.ow2.asm:asm-debug-all:5.1'
34+
compile project('spi')
3435
}
3536

3637
dependencyLicenses {
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Licensed to Elasticsearch under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
apply plugin: 'elasticsearch.build'
21+
apply plugin: 'nebula.maven-base-publish'
22+
apply plugin: 'nebula.maven-scm'
23+
24+
group = 'org.elasticsearch.plugin'
25+
archivesBaseName = 'elasticsearch-scripting-painless-spi'
26+
27+
publishing {
28+
publications {
29+
nebula {
30+
artifactId = archivesBaseName
31+
}
32+
}
33+
}
34+
35+
dependencies {
36+
compile "org.elasticsearch:elasticsearch:${version}"
37+
}
38+
39+
// no tests...yet?
40+
test.enabled = false

0 commit comments

Comments
 (0)