shadow icon indicating copy to clipboard operation
shadow copied to clipboard

Zip entry actions

Open johkelly opened this issue 8 years ago • 1 comments

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 of Action<ZipEntry> into the ZipOutputStream code so that all processed ZipEntrys can be run against them.

Arbitrary actions can be written in the build.gradle:

shadowJar{
    modifyZipEntries { ze ->
        println ze.hashCode()
        ze.setName("mutatedName")
        // ...
    }
}

And the motivating action has a sugared form:

shadowJar{
    zeroZipEntryTimestamps()
}

I'm a coworker of the requester for #246 , and lifted some of his comments and test code.

johkelly avatar Oct 25 '17 21:10 johkelly

This work will go into a 2.1.0 build since it's adding new public API.

johnrengelman avatar Nov 04 '17 18:11 johnrengelman

I believe this is outdated, and we shouldn't apply actions for Zip entries.

Goooler avatar Aug 06 '25 10:08 Goooler