Skip to content

Commit 110681a

Browse files
authored
Fix hadoop client api patch configuration cache compatibility (elastic#119324) (elastic#119340)
1 parent de815de commit 110681a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

plugins/repository-hdfs/hadoop-client-api/build.gradle

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.gradle.api.file.ArchiveOperations
2+
13
apply plugin: 'elasticsearch.java'
24

35
sourceSets {
@@ -27,16 +29,23 @@ def patchTask = tasks.register("patchClasses", JavaExec) {
2729
outputs.dir(outputDir)
2830
classpath = sourceSets.patcher.runtimeClasspath
2931
mainClass = 'org.elasticsearch.hdfs.patch.HdfsClassPatcher'
32+
def thejar = configurations.thejar
3033
doFirst {
31-
args(configurations.thejar.singleFile, outputDir.get().asFile)
34+
args(thejar.singleFile, outputDir.get().asFile)
3235
}
3336
}
3437

38+
39+
interface InjectedArchiveOps {
40+
@Inject ArchiveOperations getArchiveOperations()
41+
}
42+
3543
tasks.named('jar').configure {
3644
dependsOn(configurations.thejar)
37-
45+
def injected = project.objects.newInstance(InjectedArchiveOps)
46+
def thejar = configurations.thejar
3847
from(patchTask)
39-
from({ project.zipTree(configurations.thejar.singleFile) }) {
48+
from({ injected.getArchiveOperations().zipTree(thejar.singleFile) }) {
4049
eachFile {
4150
if (outputDir.get().file(it.relativePath.pathString).asFile.exists()) {
4251
it.exclude()

0 commit comments

Comments
 (0)