aboutsummaryrefslogtreecommitdiffstats
path: root/jar
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-09-29 13:57:10 -0700
committerColin Cross <ccross@android.com>2017-09-29 21:52:58 +0000
commit2825cb3f8dd84777428597fa466e2ecef434f676 (patch)
tree2e7c6da1cba557fd86761431e47f0075908c0063 /jar
parent86a63ff366f386f9ff29e5092a724faad95b05dd (diff)
downloadbuild_soong-2825cb3f8dd84777428597fa466e2ecef434f676.tar.gz
build_soong-2825cb3f8dd84777428597fa466e2ecef434f676.tar.bz2
build_soong-2825cb3f8dd84777428597fa466e2ecef434f676.zip
Correctly set date and mode fields for MANIFEST.MF
The file header returned by jar.ManifestFileContents had unset date and mode fields. The unset date field resulted in the "Last Mod Time" field in the zip file being set to 0, which OpenJDK 9's jar implementation treats as an error: java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0 Bug: 67095392 Test: zipdetails out/host/linux-x86/framework/tradefed.jar Change-Id: I0a818d57420f5e5de57e8ff57791951c1b538443
Diffstat (limited to 'jar')
-rw-r--r--jar/jar.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/jar/jar.go b/jar/jar.go
index f17bc98d..08fa1abd 100644
--- a/jar/jar.go
+++ b/jar/jar.go
@@ -94,6 +94,8 @@ func ManifestFileContents(src string) (*zip.FileHeader, []byte, error) {
Method: zip.Store,
UncompressedSize64: uint64(len(b)),
}
+ fh.SetMode(0700)
+ fh.SetModTime(DefaultTime)
return fh, b, nil
}