-
-
Notifications
You must be signed in to change notification settings - Fork 424
Add FindResourceInClasspath task to find resources in dependencies
#1860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/FindResourceInClasspath.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/FindResourceInClasspath.kt
Outdated
Show resolved
Hide resolved
29eb542 to
da91cb0
Compare
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/FindResourceInClasspath.kt
Show resolved
Hide resolved
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/FindResourceInClasspath.kt
Outdated
Show resolved
Hide resolved
...ctionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/FindResourceInClasspathTest.kt
Outdated
Show resolved
Hide resolved
0bd65a1 to
25deca2
Compare
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/util/Paths.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/FindResourceInClasspath.kt
Show resolved
Hide resolved
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/FindResourceInClasspath.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/FindResourceInClasspath.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/FindResourceInClasspath.kt
Show resolved
Hide resolved
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/util/Paths.kt
Outdated
Show resolved
Hide resolved
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/util/Paths.kt
Outdated
Show resolved
Hide resolved
| "/my/a/1.0/a-1.0.jar".invariantSeparatorsPathString, | ||
| "/a.properties".invariantSeparatorsPathString, | ||
| "/a2.properties".invariantSeparatorsPathString, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems you need variantSeparatorsPathString instead of invariantSeparatorsPathString.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FindResourceInClasspath task to find resources in dependencies
…ks/FindResourceInClasspath.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| classpath.forEach { file -> | ||
| logger.lifecycle("scanning {}", file) | ||
|
|
||
| archiveOperations.zipTree(file).matching(patternSet).forEach { entry -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if the files will be unzipped for once when the task is executed. If the answer is not, we can mark the task @DisableCachingByDefault.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DisableCachingByDefault SGTM. It's a debugging convenience tasks anyway, so caching might be counter productive.
I'm not sure whether some zipTree related artifacts end on disk (somewhere in build/tmp) as a byproduct of what the implementation needs. But there's no cacheable output.
aka: "which dependencies contain the path XYZ"
Refs #1848.