Skip to content

Fix relocation patterns not included in task fingerprint#1933

Merged
Goooler merged 6 commits intomainfrom
copilot/fix-issue-1932
Feb 27, 2026
Merged

Fix relocation patterns not included in task fingerprint#1933
Goooler merged 6 commits intomainfrom
copilot/fix-issue-1932

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 27, 2026

ShadowJar would incorrectly remain up-to-date or pull from build cache when only the relocation pattern changed, because SimpleRelocator's pattern fields were private and lacked @Input annotations — making them invisible to Gradle's input fingerprinting via @Nested.

Changes

  • SimpleRelocator: Expose rawString, pathPattern, and shadedPathPattern as @Input-annotated internal properties. These three fields together cover both normal and raw-string relocation modes:
    • rawString=false: pathPattern/shadedPathPattern are the normalized (slash-form) source/dest patterns
    • rawString=true: pathPattern/shadedPathPattern hold the raw regex patterns directly
  • api/shadow.api: Updated API dump with new getRawString(), getPathPattern(), getShadedPathPattern() getters
  • CachingTest: Added relocatorPatternChanged regression test verifying the task reruns when the shaded destination changes
// Before: changing 'foo' → 'bar' left task UP-TO-DATE
tasks.withType<ShadowJar>().configureEach {
    relocate("kotlin", "foo")  // change to "bar" — no rerun
}

// After: pattern change correctly invalidates the task

  • CHANGELOG's "Unreleased" section has been updated, if applicable.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx4g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)
  • scans-in.gradle.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx4g -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…pleRelocator

Co-authored-by: Goooler <10363352+Goooler@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue #1932 Fix relocation pattern not included in ShadowJar task fingerprint Feb 27, 2026
@Goooler Goooler force-pushed the copilot/fix-issue-1932 branch from a95fa6c to 08e00e3 Compare February 27, 2026 10:51
@Goooler Goooler linked an issue Feb 27, 2026 that may be closed by this pull request
@Goooler Goooler changed the title Fix relocation pattern not included in ShadowJar task fingerprint Fix relocation patterns not included in task fingerprint Feb 27, 2026
@Goooler Goooler marked this pull request as ready for review February 27, 2026 10:54
@Goooler Goooler requested a review from Copilot February 27, 2026 10:59

This comment was marked as outdated.

…ocation/SimpleRelocator.kt

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

This comment was marked as outdated.

@Goooler Goooler merged commit db1a2d8 into main Feb 27, 2026
12 checks passed
@Goooler Goooler deleted the copilot/fix-issue-1932 branch February 27, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relocation pattern is not a part of the ShadowJar fingerprint

3 participants