Skip to content

Commit 2379c89

Browse files
committed
Update shadow plugin for Gradle 9.0 compatibility
1 parent e81c140 commit 2379c89

File tree

4 files changed

+10
-44
lines changed

4 files changed

+10
-44
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/shadow/XmlClassRelocationTransformer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
package org.elasticsearch.gradle.internal.shadow;
1111

1212
//import com.github.jengelman.gradle.plugins.shadow.ShadowStats;
13-
import com.github.jengelman.gradle.plugins.shadow.relocation.RelocateClassContext;
13+
1414
import com.github.jengelman.gradle.plugins.shadow.relocation.RelocateClassContext;
1515
import com.github.jengelman.gradle.plugins.shadow.relocation.Relocator;
16-
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext;
1716
import com.github.jengelman.gradle.plugins.shadow.transformers.ResourceTransformer;
17+
import com.github.jengelman.gradle.plugins.shadow.transformers.TransformerContext;
1818

1919
import org.apache.commons.io.IOUtils;
2020
import org.apache.tools.zip.ZipEntry;
@@ -27,7 +27,6 @@
2727
import java.io.BufferedInputStream;
2828
import java.io.ByteArrayOutputStream;
2929
import java.io.IOException;
30-
import java.util.List;
3130
import java.util.Set;
3231

3332
import javax.xml.parsers.DocumentBuilder;
@@ -74,7 +73,6 @@ public void transform(TransformerContext context) {
7473

7574
private static String getRelocatedClass(String className, TransformerContext context) {
7675
Set<Relocator> relocators = context.getRelocators();
77-
// ShadowStats stats = context.getStats();
7876
if (className != null && className.length() > 0 && relocators != null) {
7977
for (Relocator relocator : relocators) {
8078
if (relocator.canRelocateClass(className)) {
@@ -113,7 +111,9 @@ public boolean hasTransformedResource() {
113111
@Override
114112
public void modifyOutputStream(ZipOutputStream os, boolean preserveFileTimestamps) {
115113
ZipEntry entry = new ZipEntry(resource);
116-
entry.setTime(TransformerContext.getEntryTimestamp(preserveFileTimestamps, entry.getTime()));
114+
if (preserveFileTimestamps) {
115+
entry.setTime(entry.getTime());
116+
}
117117

118118
try {
119119
// Write the content back to the XML file

gradle/build.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ maven-model = "org.apache.maven:maven-model:3.6.2"
3838
mockito-core = "org.mockito:mockito-core:1.9.5"
3939
nebula-info = "com.netflix.nebula:gradle-info-plugin:11.3.3"
4040
reflections = "org.reflections:reflections:0.9.12"
41-
shadow-plugin = "com.gradleup.shadow:shadow-gradle-plugin:9.0.0-beta12"
41+
shadow-plugin = "com.gradleup.shadow:shadow-gradle-plugin:9.0.0-beta15"
4242
snakeyaml = { group = "org.yaml", name = "snakeyaml", version = { strictly = "2.0" } }
4343
spock-core = { group = "org.spockframework", name="spock-core", version.ref="spock" }
4444
spock-junit4 = { group = "org.spockframework", name="spock-junit4", version.ref="spock" }

gradle/verification-metadata.xml

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -878,44 +878,9 @@
878878
</sha256>
879879
</artifact>
880880
</component>
881-
<component group="com.gradleup.shadow" name="shadow-gradle-plugin" version="8.3.5">
882-
<artifact name="shadow-gradle-plugin-8.3.5.jar">
883-
<sha256 value="54e08dd20a82775e3317a4725a1a5e4ec8b1b1c0f346de702a49d9ed4815b735" origin="Generated by Gradle"/>
884-
</artifact>
885-
</component>
886-
<component group="com.gradleup.shadow" name="shadow-gradle-plugin" version="9.0.0-beta1">
887-
<artifact name="shadow-gradle-plugin-9.0.0-beta1.jar">
888-
<sha256 value="43dc8ff22a743bcb0a7066a49e6daae5012a7504f831b026cefa8e9af705c65f" origin="Generated by Gradle"/>
889-
</artifact>
890-
</component>
891-
<component group="com.gradleup.shadow" name="shadow-gradle-plugin" version="9.0.0-beta10">
892-
<artifact name="shadow-gradle-plugin-9.0.0-beta10.jar">
893-
<sha256 value="ba80f3262a36bb5961d99353e0dda0175891d58dafdda6f23ef50c8c0fad3dc8" origin="Generated by Gradle"/>
894-
</artifact>
895-
</component>
896-
<component group="com.gradleup.shadow" name="shadow-gradle-plugin" version="9.0.0-beta12">
897-
<artifact name="shadow-gradle-plugin-9.0.0-beta12.jar">
898-
<sha256 value="e4c9dd1624811182a10acd8ab21c4a1443ea861fc3abb36bfa18d66b3974f050" origin="Generated by Gradle"/>
899-
</artifact>
900-
</component>
901-
<component group="com.gradleup.shadow" name="shadow-gradle-plugin" version="9.0.0-beta13">
902-
<artifact name="shadow-gradle-plugin-9.0.0-beta13.jar">
903-
<sha256 value="ad780bd6d9f70b42aa497a0fb0eb432283ead96ed973c55f2bd6396a66892c23" origin="Generated by Gradle"/>
904-
</artifact>
905-
</component>
906-
<component group="com.gradleup.shadow" name="shadow-gradle-plugin" version="9.0.0-beta5">
907-
<artifact name="shadow-gradle-plugin-9.0.0-beta5.jar">
908-
<sha256 value="d036170aa3e86f11e1c46be2e32229f084848cb53dc27c866e02bde9c7778b57" origin="Generated by Gradle"/>
909-
</artifact>
910-
</component>
911-
<component group="com.gradleup.shadow" name="shadow-gradle-plugin" version="9.0.0-beta8">
912-
<artifact name="shadow-gradle-plugin-9.0.0-beta8.jar">
913-
<sha256 value="d2fd9d70a68268267e33bfcdad23a8bc98e83255640c46e65b4c9af331221d2d" origin="Generated by Gradle"/>
914-
</artifact>
915-
</component>
916-
<component group="com.gradleup.shadow" name="shadow-gradle-plugin" version="9.0.0-beta9">
917-
<artifact name="shadow-gradle-plugin-9.0.0-beta9.jar">
918-
<sha256 value="fa3cbf876f3c0474aae790b62445406addf4817fccb3dbe01a6dbc3896834f11" origin="Generated by Gradle"/>
881+
<component group="com.gradleup.shadow" name="shadow-gradle-plugin" version="9.0.0-beta15">
882+
<artifact name="shadow-gradle-plugin-9.0.0-beta15.jar">
883+
<sha256 value="fbf17c89d13462d6caa97616c7e6428d96e424fe20c669790dd35c4c961bc053" origin="Generated by Gradle"/>
919884
</artifact>
920885
</component>
921886
<component group="com.h2database" name="h2" version="1.4.197">

x-pack/plugin/security/lib/nimbus-jose-jwt-modified/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ tasks.named('shadowJar').configure {
2020
// The original library uses this and it gets stripped by shadowJar
2121
attributes 'Automatic-Module-Name': 'com.nimbusds.jose.jwt'
2222
}
23+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
2324
}
2425

2526
['jarHell', 'thirdPartyAudit', 'forbiddenApisMain', 'splitPackagesAudit', 'licenseHeaders'].each {

0 commit comments

Comments
 (0)