Fix `dist` if $DIST_DIR/logs doesn't exist

Bug: 35886901
Test: rm -rf out; m -j dist
Change-Id: I1008d9eef884d60766e35a543e72df5df01d61de
This commit is contained in:
Dan Willemsen 2017-03-01 17:38:41 -08:00
parent 469a18aae2
commit abc56d4fc7
1 changed files with 4 additions and 3 deletions

View File

@ -72,9 +72,10 @@ func main() {
build.SetupOutDir(buildCtx, config)
if config.Dist() {
os.MkdirAll(config.DistDir(), 0777)
log.SetOutput(filepath.Join(config.DistDir(), "logs", "soong.log"))
trace.SetOutput(filepath.Join(config.DistDir(), "logs", "build.trace"))
logsDir := filepath.Join(config.DistDir(), "logs")
os.MkdirAll(logsDir, 0777)
log.SetOutput(filepath.Join(logsDir, "soong.log"))
trace.SetOutput(filepath.Join(logsDir, "build.trace"))
} else {
log.SetOutput(filepath.Join(config.OutDir(), "soong.log"))
trace.SetOutput(filepath.Join(config.OutDir(), "build.trace"))