aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2018-03-22 12:38:05 -0700
committerColin Cross <ccross@android.com>2018-03-22 13:02:39 -0700
commit628d55d7efcb633b4c01d29fcdf9afcc6e7b5811 (patch)
tree2b7a4a7396bd11724f062e84d73ba8d19c9f28ca /cmd
parent9f66306050a592f5a6b74db2fd89260f2de2419d (diff)
downloadbuild_soong-628d55d7efcb633b4c01d29fcdf9afcc6e7b5811.tar.gz
build_soong-628d55d7efcb633b4c01d29fcdf9afcc6e7b5811.tar.bz2
build_soong-628d55d7efcb633b4c01d29fcdf9afcc6e7b5811.zip
Make zipsync list file output empty if there are no files
The make javac rule uses [ -s srcjar-list ] to decide whether or not to run javac. zipsync was putting a trailing "\n" in the list file, so the file was never empty. There was one case of a package that contained no source files (so java-source-list was empty) and had a res directory with an xml file that declared no resources (so aapt.jar was created but empty). The 1-byte srcjar-list file caused javac to run and error with: javac: no source files Test: m checkbuild Change-Id: I26b394b66bf81e4f5abbd27e4dc06bee1d9420a8
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zipsync/zipsync.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/zipsync/zipsync.go b/cmd/zipsync/zipsync.go
index 035a1455..ed8a06f5 100644
--- a/cmd/zipsync/zipsync.go
+++ b/cmd/zipsync/zipsync.go
@@ -118,7 +118,10 @@ func main() {
}
if *outputFile != "" {
- data := strings.Join(files, "\n") + "\n"
+ data := strings.Join(files, "\n")
+ if len(files) > 0 {
+ data += "\n"
+ }
must(ioutil.WriteFile(*outputFile, []byte(data), 0666))
}
}