Merge changes I6d1be1a9,Ie5e9310e
* changes:
Skip mainline_sdk by default in build_test.bash
Allow multiple --skip-products and --products arguments to multiproduct_kati
diff --git a/build_test.bash b/build_test.bash
index accca0f..3230f2d 100755
--- a/build_test.bash
+++ b/build_test.bash
@@ -23,6 +23,11 @@
# evolve as we find interesting things to test or track performance for.
#
+# Products that are broken or otherwise don't work with multiproduct_kati
+SKIPPED_PRODUCTS=(
+ mainline_sdk
+)
+
# To track how long we took to startup. %N isn't supported on Darwin, but
# that's detected in the Go code, which skips calculating the startup time.
export TRACE_BEGIN_SOONG=$(date +%s%N)
@@ -50,4 +55,4 @@
echo
echo "Running Soong test..."
soong_build_go multiproduct_kati android/soong/cmd/multiproduct_kati
-exec "$(getoutdir)/multiproduct_kati" "$@"
+exec "$(getoutdir)/multiproduct_kati" --skip-products "$(echo "${SKIPPED_PRODUCTS[@]-}" | tr ' ' ',')" "$@"
diff --git a/cmd/multiproduct_kati/main.go b/cmd/multiproduct_kati/main.go
index c079e83..7dd50f6 100644
--- a/cmd/multiproduct_kati/main.go
+++ b/cmd/multiproduct_kati/main.go
@@ -50,12 +50,30 @@
var buildVariant = flag.String("variant", "eng", "build variant to use")
-var skipProducts = flag.String("skip-products", "", "comma-separated list of products to skip (known failures, etc)")
-var includeProducts = flag.String("products", "", "comma-separated list of products to build")
-
var shardCount = flag.Int("shard-count", 1, "split the products into multiple shards (to spread the build onto multiple machines, etc)")
var shard = flag.Int("shard", 1, "1-indexed shard to execute")
+var skipProducts multipleStringArg
+var includeProducts multipleStringArg
+
+func init() {
+ flag.Var(&skipProducts, "skip-products", "comma-separated list of products to skip (known failures, etc)")
+ flag.Var(&includeProducts, "products", "comma-separated list of products to build")
+}
+
+// multipleStringArg is a flag.Value that takes comma separated lists and converts them to a
+// []string. The argument can be passed multiple times to append more values.
+type multipleStringArg []string
+
+func (m *multipleStringArg) String() string {
+ return strings.Join(*m, `, `)
+}
+
+func (m *multipleStringArg) Set(s string) error {
+ *m = append(*m, strings.Split(s, ",")...)
+ return nil
+}
+
const errorLeadingLines = 20
const errorTrailingLines = 20
@@ -250,9 +268,9 @@
var productsList []string
allProducts := strings.Fields(vars["all_named_products"])
- if *includeProducts != "" {
- missingProducts := []string{}
- for _, product := range strings.Split(*includeProducts, ",") {
+ if len(includeProducts) > 0 {
+ var missingProducts []string
+ for _, product := range includeProducts {
if inList(product, allProducts) {
productsList = append(productsList, product)
} else {
@@ -267,9 +285,8 @@
}
finalProductsList := make([]string, 0, len(productsList))
- skipList := strings.Split(*skipProducts, ",")
skipProduct := func(p string) bool {
- for _, s := range skipList {
+ for _, s := range skipProducts {
if p == s {
return true
}