Reset compressed size when combining JAR/ZIP archives.

Summary:
From https://github.com/facebook/buck/pull/16.

zlib does not always deflate a resource to the same compressed size as
the original input.  The input resource may have been compressed using
a different version of libz, or different compression settings.

Before adding each entry to the ZIP, clone the entry and reinitialize
the compressed field to -1 as is done by the more commonly used
`ZipEntry(String)` constructor.

This fixes a rare case where including a JAR in a `java_binary()` may
throw an error such as:

  invalid entry compressed size (expected 4271 but got 4275 bytes)

Test Plan: Sandcastle builds.
1 file changed
tree: d4aaf22ca7c4092867ffc4db6eccf2604b33f4d9
  1. .idea/
  2. bin/
  3. config/
  4. docs/
  5. lib/
  6. plugin/
  7. pmd/
  8. scripts/
  9. src/
  10. test/
  11. testdata/
  12. third-party/
  13. .buckconfig
  14. .classpath
  15. .gitignore
  16. .project
  17. buck.iml
  18. build.xml
  19. DEFS
  20. LICENSE
  21. README.md
README.md

Buck

Buck is an Android build tool. To see what Buck can do for you, check out the documentation at http://facebook.github.io/buck/.

Installation

To build Buck, run the following:

git clone git@github.com:facebook/buck.git
cd buck
ant
./bin/buck --help

License

Apache License 2.0