Skip to content

Commit

Permalink
HLREST: Bundle the x-pack protocol project
Browse files Browse the repository at this point in the history
The `:x-pack:protocol` project is an implementation detail shared by the
xpack projects and the high level rest client and really doesn't deserve
its own maven coordinants and published javadoc. This change bundles
`:x-pack:protocol` into the high level rest client.

Relates to elastic#29827
  • Loading branch information
nik9000 committed Jul 9, 2018
1 parent 5f5157a commit 376ef5a
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion client/rest-high-level/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,32 @@ publishing {
}
}

// We bundle the x-pack:protocol project into the jar.
configurations {
bundled
}
sourceSets {
main {
compileClasspath += configurations.bundled
}
test {
compileClasspath += configurations.bundled
}
}

dependencies {
compile "org.elasticsearch:elasticsearch:${version}"
compile "org.elasticsearch.client:elasticsearch-rest-client:${version}"
compile "org.elasticsearch.plugin:parent-join-client:${version}"
compile "org.elasticsearch.plugin:aggs-matrix-stats-client:${version}"
compile "org.elasticsearch.plugin:rank-eval-client:${version}"
compile "org.elasticsearch.plugin:lang-mustache-client:${version}"
compile project(':x-pack:protocol') // TODO bundle into the jar
// Eclipse can't comprehend the bundled configuration...
if (isEclipse) {
compile project(':x-pack:protocol')
} else {
bundled project(':x-pack:protocol')
}

testCompile "org.elasticsearch.client:test:${version}"
testCompile "org.elasticsearch.test:framework:${version}"
Expand All @@ -64,3 +82,32 @@ forbiddenApisMain {
signaturesURLs += [PrecommitTasks.getResource('/forbidden/http-signatures.txt')]
signaturesURLs += [file('src/main/resources/forbidden/rest-high-level-signatures.txt').toURI().toURL()]
}

javadoc {
// Bundle javadoc from all bundled projects into this project's javadoc
configurations.bundled.dependencies.all { Dependency dep ->
Project p = dependencyToProject(dep)
if (p != null) {
evaluationDependsOn(p.path)
source += p.sourceSets.main.allJava
}
}
}
jar {
from({configurations.bundled.collect { it.isDirectory() ? it : zipTree(it) }}) {
exclude 'META-INF/*'
}
}
/*
* Use the jar for testing so we have tests of the bundled jar.
*/
test {
classpath -= compileJava.outputs.files
classpath += jar.outputs.files
dependsOn jar
}
integTestRunner {
classpath -= compileJava.outputs.files
classpath += jar.outputs.files
dependsOn jar
}

0 comments on commit 376ef5a

Please sign in to comment.