Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
jdkRelease = "17"
jdkRelease = "24"
minGradle = "9.0.0"
kotlin = "2.3.20-RC2"
moshi = "1.15.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,45 @@ class RelocationTest : BasePluginTest() {
}
}

@Test
fun relocateAnnotationStringConstants() {
writeClass {
"""
package my;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation {
String value();
}
@MyAnnotation("foo.Bar")
public class Main {
public static void main(String[] args) {
MyAnnotation ann = Main.class.getAnnotation(MyAnnotation.class);
System.out.println(ann.value());
}
}
"""
.trimIndent()
}
projectScript.appendText(
"""
$shadowJarTask {
manifest {
attributes '$mainClassAttributeKey': 'my.Main'
}
relocate('foo', 'shadow.foo')
}
"""
.trimIndent()
)

runWithSuccess(shadowJarPath)
val result = runProcess("java", "-jar", outputShadowedJar.use { it.toString() })

assertThat(result).contains("shadow.foo.Bar")
}

@Issue("https://github.com/GradleUp/shadow/issues/1403")
@Test
fun relocateMultiClassSignatureStringConstants() {
Expand Down
Loading