Closed acourtneybrown closed 9 months ago
I was thinking of removing this constraint to
zap
, but wanted to see if there were any objections before going too far down that path.
I kind of like the idea of removing the *.class
only constraint rather than adding a new vocabulary that we now need to remember to support. @johnynek wdyt?
I agree that reusing zap is ideal and removing non-class files from a jar is a real use case.
I initially played around with updating zap
to allow for other files, but realized that the way that it handled the pattern
implicitly assumes that it's going to be operating on Java packages (eg: org.apache.kafka.**
) instead of file paths (eg: org/apache/kafka/**/*.proto
). That's when I took the route in #49 to separate out then handling of zap
ing Java packages versus zap
ing general file paths within the input jarfile.
👋 Hi Eugene, Oscar.
Thanks Adam for your PR. I've prepared PR #53 that generalizes zap
.
Since rule
does match resources (based only on their path, not their filename) changing zap
to mirror this behavior seems appropriate.
Thanks for the contribution @patrick-premont! https://github.com/eed3si9n/jarjar-abrams/pull/53 is merged.
👋 Hey, we're trying to use
jarjar
via https://github.com/bazeltools/bazel_jar_jar while migrating a build to Bazel from Gradle. The Gradle shadow plugin that we're trying to replace allows for the removal of any file type/extension as part of the jar shading process. It appears that theZapProcessor
only allowszap
ing.class
files.https://github.com/eed3si9n/jarjar-abrams/blob/9d0eb03caef24f1f04229b77cb2a492625804d80/jarjar/src/main/java/com/eed3si9n/jarjar/ZapProcessor.java#L31-L36
I was thinking of removing this constraint to
zap
, but wanted to see if there were any objections before going too far down that path.Alternatively, are there other suggestions for how to handle this use-case? We're currently seeing
.proto
files & native libraries added to the shaded jar, but would like them excluded.