Commit graph

4 commits

Author SHA1 Message Date
Colin Cross
f3831d0e08 Support exclusions and Blueprint-style ** globs in zip2zip
Jacoco support will use zip2zip to create a jar that is a subset
of another jar, and will need exclusion filters and recursive
globs.  Switch zip2zip from filepath.Match to pathtools.Match,
and check each included file against the exclusion list.

Bug: 69629238
Test: zip2zip_test.go
Change-Id: Ibe961b0775987f52f1efa357e1201c3ebb81ca9c
2017-11-22 16:08:34 -08:00
Colin Cross
06382991e0 Make '**' implicit
Default to copying all entries in the input zip to the output zip.

Test: zip2zip_test
Change-Id: I0d70620c621bfeee2b7fe2a64b350b4866ad2877
2017-06-23 14:08:42 -07:00
Colin Cross
8936b02b58 Add jar sorting to zip2zip
Jars have a strange sorting order; the META-INF/ directory should
come first, then META-INF/MANIFEST.MF, then any other files in
META-INF/, and then any files outside META-INF.  Add a -j argument
to zip2zip that sorts using jar ordering.

Test: zip2zip_test
Change-Id: I80e2bc7e284ef74f6561c26cb6541298834db1bc
2017-06-23 14:08:32 -07:00
Dan Willemsen
82218f285c zip2zip: Support sorting globbed arguments, '**'
When '-s' is passed, any globbed arguments will have their results
sorted. When there are multiple arguments, the files will still be
inserted in argument order.

A bare '**' is now special cased to mean every file in the input zip.

This allows zip2zip to sort entire zip files efficiently by using
`zip2zip -s -i <> -o <> '**'`. This can be useful if your original zip
program used filesystem ordering which was not reproducible.

Test: m -j blueprint_tools (new tests pass)
Change-Id: Ic3512c5fe14c94c6f3e134296905121d2ff8b58a
2017-06-22 15:55:27 -07:00