aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2017-01-20 14:10:01 -0800
committerDan Willemsen <dwillemsen@google.com>2017-02-06 14:05:07 -0800
commitc2af0bedc1701ee043f61d95d6b7b160f388a3cb (patch)
tree9fe0c18053cc2d937613b96c64e1ad7e4ed127ff /ui
parent0043c0e767499838f27e19f2b3872b49e6b54b8c (diff)
downloadbuild_soong-c2af0bedc1701ee043f61d95d6b7b160f388a3cb.tar.gz
build_soong-c2af0bedc1701ee043f61d95d6b7b160f388a3cb.tar.bz2
build_soong-c2af0bedc1701ee043f61d95d6b7b160f388a3cb.zip
Add multiproduct_kati
This is a replacement for build/tools/kati_all_products.sh using the new Soong ui/build package. It doesn't even attempt to run ninja, and it can be configured to run only the product config, or only the product config and Soong. For AOSP on my machine: -only-config 1.4s -only-soong 1m20s <none> 13m Test: multiproduct_kati Change-Id: Ie3e6e7bdf692e46a8b8eb828f437190f8003500b
Diffstat (limited to 'ui')
-rw-r--r--ui/build/config.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/build/config.go b/ui/build/config.go
index b0a7d7ad..35c5213d 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -15,6 +15,8 @@
package build
import (
+ "log"
+ "os"
"path/filepath"
"runtime"
"strconv"
@@ -40,6 +42,8 @@ type configImpl struct {
katiSuffix string
}
+const srcDirFileCheck = "build/soong/root.bp"
+
func NewConfig(ctx Context, args ...string) Config {
ret := &configImpl{
environ: OsEnvironment(),
@@ -71,6 +75,14 @@ func NewConfig(ctx Context, args ...string) Config {
ret.parallel = runtime.NumCPU() + 2
ret.keepGoing = 1
+ // Precondition: the current directory is the top of the source tree
+ if _, err := os.Stat(srcDirFileCheck); err != nil {
+ if os.IsNotExist(err) {
+ log.Fatalf("Current working directory must be the source tree. %q not found", srcDirFileCheck)
+ }
+ log.Fatalln("Error verifying tree state:", err)
+ }
+
for _, arg := range args {
arg = strings.TrimSpace(arg)
if arg == "--make-mode" {