aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2018-09-27 15:06:19 -0700
committerColin Cross <ccross@android.com>2018-09-28 13:56:06 -0700
commit05518bc13b3cd31e6cb7158a41aa124b224c3bc4 (patch)
tree65dbf6c09827df7f23d973ef6419fea543580d52 /cmd
parentb051ab5cb54f8802807680a8fb24092b445a3ddb (diff)
downloadbuild_soong-05518bc13b3cd31e6cb7158a41aa124b224c3bc4.tar.gz
build_soong-05518bc13b3cd31e6cb7158a41aa124b224c3bc4.tar.bz2
build_soong-05518bc13b3cd31e6cb7158a41aa124b224c3bc4.zip
soong_zip: Add tests
Add test that cover basic command line usage of soong_zip. -D is not covered yet as the implementation will be replaced with one that is also more easily testable in the next patch. Bug: 116751500 Test: zip_test.go Change-Id: I5a1bcee74ebc9cb3cf332c36f89bc12c0e807ad2
Diffstat (limited to 'cmd')
-rw-r--r--cmd/merge_zips/merge_zips.go7
-rw-r--r--cmd/multiproduct_kati/main.go4
2 files changed, 8 insertions, 3 deletions
diff --git a/cmd/merge_zips/merge_zips.go b/cmd/merge_zips/merge_zips.go
index 95ff70b0..f383de90 100644
--- a/cmd/merge_zips/merge_zips.go
+++ b/cmd/merge_zips/merge_zips.go
@@ -250,7 +250,12 @@ func mergeZips(readers []namedZipReader, writer *zip.Writer, manifest, entrypoin
addMapping(jar.MetaDir, dirSource)
}
- fh, buf, err := jar.ManifestFileContents(manifest)
+ contents, err := ioutil.ReadFile(manifest)
+ if err != nil {
+ return err
+ }
+
+ fh, buf, err := jar.ManifestFileContents(contents)
if err != nil {
return err
}
diff --git a/cmd/multiproduct_kati/main.go b/cmd/multiproduct_kati/main.go
index 374868c1..4933f374 100644
--- a/cmd/multiproduct_kati/main.go
+++ b/cmd/multiproduct_kati/main.go
@@ -328,7 +328,7 @@ func main() {
NumParallelJobs: runtime.NumCPU(),
CompressionLevel: 5,
}
- if err := zip.Run(args); err != nil {
+ if err := zip.Zip(args); err != nil {
log.Fatalf("Error zipping logs: %v", err)
}
}
@@ -409,7 +409,7 @@ func buildProduct(mpctx *mpContext, product string) {
NumParallelJobs: runtime.NumCPU(),
CompressionLevel: 5,
}
- if err := zip.Run(args); err != nil {
+ if err := zip.Zip(args); err != nil {
log.Fatalf("Error zipping artifacts: %v", err)
}
}