mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -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'
|
||||
|
||||
sourceSets {
|
||||
|
@ -27,16 +29,23 @@ def patchTask = tasks.register("patchClasses", JavaExec) {
|
|||
outputs.dir(outputDir)
|
||||
classpath = sourceSets.patcher.runtimeClasspath
|
||||
mainClass = 'org.elasticsearch.hdfs.patch.HdfsClassPatcher'
|
||||
def thejar = configurations.thejar
|
||||
doFirst {
|
||||
args(configurations.thejar.singleFile, outputDir.get().asFile)
|
||||
args(thejar.singleFile, outputDir.get().asFile)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface InjectedArchiveOps {
|
||||
@Inject ArchiveOperations getArchiveOperations()
|
||||
}
|
||||
|
||||
tasks.named('jar').configure {
|
||||
dependsOn(configurations.thejar)
|
||||
|
||||
def injected = project.objects.newInstance(InjectedArchiveOps)
|
||||
def thejar = configurations.thejar
|
||||
from(patchTask)
|
||||
from({ project.zipTree(configurations.thejar.singleFile) }) {
|
||||
from({ injected.getArchiveOperations().zipTree(thejar.singleFile) }) {
|
||||
eachFile {
|
||||
if (outputDir.get().file(it.relativePath.pathString).asFile.exists()) {
|
||||
it.exclude()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue