-
Notifications
You must be signed in to change notification settings - Fork 396
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
Zip entry actions #333
base: main
Are you sure you want to change the base?
Zip entry actions #333
Conversation
This is motivated by wanting to zero timestamps on entries for byte-stable shadow jars, but generalized in case other uses are created.
@@ -100,6 +103,11 @@ public ShadowJar dependencies(Action<DependencyFilter> c) { | |||
return this; | |||
} | |||
|
|||
public ShadowJar entryAction(Action<ZipEntry> action) { |
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.
We're gonna need to make our own 1st class citizen for ZipEntry
. We can't expose the apache classes as part of the public API for shadow because those classes are relocated during packaging.
But overall this PR looks good. I'll likely merge it this way and then figure out the stuff above.
This work will go into a 2.1.0 build since it's adding new public API. |
A more general implementation of #246 , motivated by the same desire to have shadow jars that play nice with
rsync
. This implementation pushes a list ofAction<ZipEntry>
into theZipOutputStream
code so that all processedZipEntry
s can be run against them.Arbitrary actions can be written in the build.gradle:
And the motivating action has a sugared form:
I'm a coworker of the requester for #246 , and lifted some of his comments and test code.