mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
Fix hadoop client api patch configuration cache compatibility (#119324)
This commit is contained in:
parent
12e86b1cd0
commit
dee3c6e44f
1 changed files with 12 additions and 3 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import org.gradle.api.file.ArchiveOperations
|
||||||
|
|
||||||
apply plugin: 'elasticsearch.java'
|
apply plugin: 'elasticsearch.java'
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
@ -27,16 +29,23 @@ def patchTask = tasks.register("patchClasses", JavaExec) {
|
||||||
outputs.dir(outputDir)
|
outputs.dir(outputDir)
|
||||||
classpath = sourceSets.patcher.runtimeClasspath
|
classpath = sourceSets.patcher.runtimeClasspath
|
||||||
mainClass = 'org.elasticsearch.hdfs.patch.HdfsClassPatcher'
|
mainClass = 'org.elasticsearch.hdfs.patch.HdfsClassPatcher'
|
||||||
|
def thejar = configurations.thejar
|
||||||
doFirst {
|
doFirst {
|
||||||
args(configurations.thejar.singleFile, outputDir.get().asFile)
|
args(thejar.singleFile, outputDir.get().asFile)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface InjectedArchiveOps {
|
||||||
|
@Inject ArchiveOperations getArchiveOperations()
|
||||||
|
}
|
||||||
|
|
||||||
tasks.named('jar').configure {
|
tasks.named('jar').configure {
|
||||||
dependsOn(configurations.thejar)
|
dependsOn(configurations.thejar)
|
||||||
|
def injected = project.objects.newInstance(InjectedArchiveOps)
|
||||||
|
def thejar = configurations.thejar
|
||||||
from(patchTask)
|
from(patchTask)
|
||||||
from({ project.zipTree(configurations.thejar.singleFile) }) {
|
from({ injected.getArchiveOperations().zipTree(thejar.singleFile) }) {
|
||||||
eachFile {
|
eachFile {
|
||||||
if (outputDir.get().file(it.relativePath.pathString).asFile.exists()) {
|
if (outputDir.get().file(it.relativePath.pathString).asFile.exists()) {
|
||||||
it.exclude()
|
it.exclude()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue