-
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
Add "zeroEntryTimestamps()" option #246
Conversation
RIP in peace, codehaus.
8d16c02
to
5be8e57
Compare
See javadoc on the method for details on why and how. This is basically the half-assed deterministic build from GradleUp#229, which is to say still extremely helpful when dealing with rsync.
5be8e57
to
ed69bd2
Compare
@blendmaster thanks for the submissions. I'm still finding time in my schedule to invest into some updates for shadow. As for this, I'm considering making it a higher level feature that allows a user to register arbitrary actions against each So I'm envisioning something like adding the following method to the
these would be passed down to the ShadowCopy Action and then applied to each ZipEntry. If you want to take a crack at implementing it that way, that would be cool, otherwise when I find time, i'll probably incorporate your changes that way. |
It seems reasonable to offer more general hooks into the final shadow zip file creation. However, I'm having trouble thinking of what anybody would do with just the ZipEntry besides zero the timestamps. Did you have anything particular in mind? If you could somehow affect both the ZipEntry and the actual contents of the entry, it might be more useful. Something like zipEntryActions << { entry, orig ->
if (entry.name ~= "*.java") {
// prefix text with copyright
def written = false
return new FilterOutputStream(orig) {
def write(bytes) {
if (!written) {
orig.write("my copyright notice\n")
written = true
}
orig.write(bytes)
}
} else {
return orig
}
} In any case, I can reimplement this PR on |
yeah, it might end up being something like that or even extending the the shortcut method is fine. Thanks. |
Looking at this again, my implementation doesn't quite work with transformed (through One implementation path I originally went down was to proxy the entire ZipOutputStream with something like javassist, allowing interception of all Given #247 and this PR, it does seem like a general way for munging the ZipOutputStream is appropriate. Let me know if you have any additional thoughts. I'll think of something to implement in the meantime. |
Closing this in favor of #333 |
See javadoc on the method for details on why and how. This
is basically the half-assed deterministic build from #229,
which is to say still extremely helpful when dealing with rsync.
Also update docs.gradle since doclet resolution freezes the build until the http request times out.