Skip to content

Commit 128f954

Browse files
remove hard-coded version from azure-core patcher
1 parent 681d095 commit 128f954

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/dependencies/patches/azurecore/AzureCoreClassPatcher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@
2222

2323
import java.io.File;
2424
import java.util.List;
25+
import java.util.regex.Pattern;
2526

2627
import static org.elasticsearch.gradle.internal.dependencies.patches.PatcherInfo.classPatcher;
2728

2829
public abstract class AzureCoreClassPatcher implements TransformAction<TransformParameters.None> {
2930

30-
private static final String JAR_FILE_TO_PATCH = "azure-core-1.55.3.jar";
31+
private static final String JAR_FILE_TO_PATCH = "azure-core-[\\d.]*\\.jar";
3132

3233
private static final List<PatcherInfo> CLASS_PATCHERS = List.of(
3334
classPatcher(
@@ -45,8 +46,7 @@ public abstract class AzureCoreClassPatcher implements TransformAction<Transform
4546
public void transform(@NotNull TransformOutputs outputs) {
4647
File inputFile = getInputArtifact().get().getAsFile();
4748

48-
// TODO could use a regex here so it matches regardless of JAR version
49-
if (inputFile.getName().equals(JAR_FILE_TO_PATCH)) {
49+
if (Pattern.matches(JAR_FILE_TO_PATCH, inputFile.getName())) {
5050
System.out.println("Patching " + inputFile.getName());
5151
File outputFile = outputs.file(inputFile.getName().replace(".jar", "-patched.jar"));
5252
Utils.patchJar(inputFile, outputFile, CLASS_PATCHERS, false);

plugins/microsoft-graph-authz/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ tasks.named("javadoc").configure { enabled = false }
9595

9696
tasks.named("dependencyLicenses").configure {
9797
mapping from: "microsoft-graph-core", to: "microsoft-graph"
98-
mapping from: "azure-identity", to: "azure"
98+
mapping from: /azure-*/, to: "azure"
9999
}

0 commit comments

Comments
 (0)