Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rjernst committed Dec 23, 2024
1 parent edfc07d commit 7a11008
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
tasks.register('buildDependencyArtifacts') {
group = 'ide'
description = 'Builds artifacts needed as dependency for IDE modules'
dependsOn([':plugins:repository-hdfs:hadoop-client-api:shadowJar',
dependsOn([':plugins:repository-hdfs:hadoop-client-api:jar',
':x-pack:plugin:esql:compute:ann:jar',
':x-pack:plugin:esql:compute:gen:jar',
':server:generateModulesList',
Expand Down
19 changes: 12 additions & 7 deletions plugins/repository-hdfs/hadoop-client-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,27 @@ dependencies {

def outputDir = layout.buildDirectory.dir("patched-classes")

def patchTask = tasks.register("patchClasses", JavaExec)
patchTask.configure {
dependsOn configurations.thejar, sourceSets.patcher.getCompileJavaTaskName()
def patchTask = tasks.register("patchClasses", JavaExec) {
inputs.files(configurations.thejar).withPathSensitivity(PathSensitivity.RELATIVE)
inputs.files(sourceSets.patcher.output).withPathSensitivity(PathSensitivity.RELATIVE)
outputs.dir(outputDir)
classpath = sourceSets.patcher.runtimeClasspath
mainClass = 'org.elasticsearch.hdfs.patch.HdfsClassPatcher'
doFirst {
args configurations.thejar.singleFile, outputDir.get().getAsFile().toString()
args(configurations.thejar.singleFile, outputDir.get().asFile)
}
}

tasks.named('jar').configure {
dependsOn(patchTask)
dependsOn(configurations.thejar)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

from(outputDir) // patch directory first so any files patched are excluded as duplicates
from(project.zipTree(configurations.thejar.singleFile))
from(outputDir)
from({ project.zipTree(configurations.thejar.singleFile) }) {
eachFile {
if (outputDir.get().file(it.relativePath.pathString).asFile.exists()) {
it.exclude()
}
}
}
}

0 comments on commit 7a11008

Please sign in to comment.