aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2017-03-29 19:26:09 -0700
committerSteven Moreland <smoreland@google.com>2017-03-29 22:38:42 -0700
commit552432e827e92fa721d433e7f7033474c3d56727 (patch)
tree208b450c80a00214ad8388d69df0afb7d55dd25e
parente7ee3c7bc233e6f87830ac6b795f3777382d476b (diff)
downloadbuild_soong-552432e827e92fa721d433e7f7033474c3d56727.tar.gz
build_soong-552432e827e92fa721d433e7f7033474c3d56727.tar.bz2
build_soong-552432e827e92fa721d433e7f7033474c3d56727.zip
multiproduct_kati: better directory names.
Naming directories according to current date. This makes them easier to parse when using the tool multiple time. Also considered: millis := time.Now().UnixNano() / 1000000 name := fmt.Sprintf("multiproduct-%d", millis) Also considered putting separators in the number, but it makes for too long of a directory name. Test: multiproduct_kati Change-Id: I10ac6754094653abf5bf11b04efc3c44905d3c8d
-rw-r--r--cmd/multiproduct_kati/main.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd/multiproduct_kati/main.go b/cmd/multiproduct_kati/main.go
index d52c1692..3aa5a876 100644
--- a/cmd/multiproduct_kati/main.go
+++ b/cmd/multiproduct_kati/main.go
@@ -19,12 +19,12 @@ import (
"context"
"flag"
"fmt"
- "io/ioutil"
"os"
"path/filepath"
"runtime"
"strings"
"sync"
+ "time"
"android/soong/ui/build"
"android/soong/ui/logger"
@@ -84,9 +84,11 @@ func main() {
config := build.NewConfig(buildCtx)
if *outDir == "" {
- var err error
- *outDir, err = ioutil.TempDir(config.OutDir(), "multiproduct")
- if err != nil {
+ name := "multiproduct-" + time.Now().Format("20060102150405")
+
+ *outDir = filepath.Join(config.OutDir(), name)
+
+ if err := os.MkdirAll(*outDir, 0777); err != nil {
log.Fatalf("Failed to create tempdir: %v", err)
}