Make multiproduct_kati call soong_ui.bash .
This serves to not link parts of soong_ui (and eventually soong_build)
into a separate, weird binary. This is in turn good because they contain
any number of global variables and no one really thought about what
happens when two instances are executing at the same time in the same
address space.
This comes with a slight performance hit: 5 aosp_* projects build 152
seconds instead of 146. I suppose this is a price worth paying for a
clean design?
Test: presubmits.
Change-Id: I5623dcab2290f0fc392dd2ede597b9794a3d2a4e
diff --git a/ui/build/config.go b/ui/build/config.go
index 918a956..9768a44 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -49,6 +49,7 @@
skipConfig bool
skipKati bool
skipKatiNinja bool
+ skipSoong bool
skipNinja bool
skipSoongTests bool
@@ -582,6 +583,8 @@
arg := strings.TrimSpace(args[i])
if arg == "showcommands" {
c.verbose = true
+ } else if arg == "--empty-ninja-file" {
+ c.emptyNinjaFile = true
} else if arg == "--skip-ninja" {
c.skipNinja = true
} else if arg == "--skip-make" {
@@ -596,6 +599,10 @@
} else if arg == "--soong-only" {
c.skipKati = true
c.skipKatiNinja = true
+ } else if arg == "--config-only" {
+ c.skipKati = true
+ c.skipKatiNinja = true
+ c.skipSoong = true
} else if arg == "--skip-config" {
c.skipConfig = true
} else if arg == "--skip-soong-tests" {
@@ -690,54 +697,6 @@
}
}
-// Lunch configures the environment for a specific product similarly to the
-// `lunch` bash function.
-func (c *configImpl) Lunch(ctx Context, product, variant string) {
- if variant != "eng" && variant != "userdebug" && variant != "user" {
- ctx.Fatalf("Invalid variant %q. Must be one of 'user', 'userdebug' or 'eng'", variant)
- }
-
- c.environ.Set("TARGET_PRODUCT", product)
- c.environ.Set("TARGET_BUILD_VARIANT", variant)
- c.environ.Set("TARGET_BUILD_TYPE", "release")
- c.environ.Unset("TARGET_BUILD_APPS")
- c.environ.Unset("TARGET_BUILD_UNBUNDLED")
-}
-
-// Tapas configures the environment to build one or more unbundled apps,
-// similarly to the `tapas` bash function.
-func (c *configImpl) Tapas(ctx Context, apps []string, arch, variant string) {
- if len(apps) == 0 {
- apps = []string{"all"}
- }
- if variant == "" {
- variant = "eng"
- }
-
- if variant != "eng" && variant != "userdebug" && variant != "user" {
- ctx.Fatalf("Invalid variant %q. Must be one of 'user', 'userdebug' or 'eng'", variant)
- }
-
- var product string
- switch arch {
- case "arm", "":
- product = "aosp_arm"
- case "arm64":
- product = "aosm_arm64"
- case "x86":
- product = "aosp_x86"
- case "x86_64":
- product = "aosp_x86_64"
- default:
- ctx.Fatalf("Invalid architecture: %q", arch)
- }
-
- c.environ.Set("TARGET_PRODUCT", product)
- c.environ.Set("TARGET_BUILD_VARIANT", variant)
- c.environ.Set("TARGET_BUILD_TYPE", "release")
- c.environ.Set("TARGET_BUILD_APPS", strings.Join(apps, " "))
-}
-
func (c *configImpl) Environment() *Environment {
return c.environ
}
@@ -817,6 +776,10 @@
return c.skipKatiNinja
}
+func (c *configImpl) SkipSoong() bool {
+ return c.skipSoong
+}
+
func (c *configImpl) SkipNinja() bool {
return c.skipNinja
}