diff options
author | Colin Cross <ccross@android.com> | 2018-09-21 15:12:39 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2018-09-28 14:01:33 -0700 |
commit | 09f11056f876a9f705a53fd6f122aa7575e0b51b (patch) | |
tree | d8940136685b56e986ca65bb15287228885b00fe /zip/cmd/main.go | |
parent | 1d98ee23a322a997d28ef5dd07412db4b9564d2a (diff) |
Add a --symlinks argument to soong_zip
Add a --symlinks argument that defaults to true to soong_zip.
Passing --symlinks=false will cause it to follow symlinks instead
of storing them in the zip file.
Relands I4deb98daa9d4ba9f94e3d7670c117fe00381d2ba with tests.
Bug: 112843624
Test: glob_test.go
Test: zip_test.go
Test: m checkbuild
Change-Id: I0eff9c1f2dba79e873fda381ff585df55d5aaaad
Diffstat (limited to 'zip/cmd/main.go')
-rw-r--r-- | zip/cmd/main.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/zip/cmd/main.go b/zip/cmd/main.go index 1125602d0..4a0849128 100644 --- a/zip/cmd/main.go +++ b/zip/cmd/main.go @@ -137,6 +137,8 @@ func main() { emulateJar := flags.Bool("jar", false, "modify the resultant .zip to emulate the output of 'jar'") writeIfChanged := flags.Bool("write_if_changed", false, "only update resultant .zip if it has changed") + symlinks := flags.Bool("symlinks", true, "store symbolic links in zip instead of following them") + parallelJobs := flags.Int("parallel", runtime.NumCPU(), "number of parallel threads to use") cpuProfile := flags.String("cpuprofile", "", "write cpu profile to file") traceFile := flags.String("trace", "", "write trace to file") @@ -197,9 +199,10 @@ func main() { NumParallelJobs: *parallelJobs, NonDeflatedFiles: nonDeflatedFiles, WriteIfChanged: *writeIfChanged, + StoreSymlinks: *symlinks, }) if err != nil { - fmt.Fprintln(os.Stderr, err.Error()) + fmt.Fprintln(os.Stderr, "error:", err.Error()) os.Exit(1) } } |