Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69c43e40 authored by Anton Hansson's avatar Anton Hansson Committed by Gerrit Code Review
Browse files

Merge changes I6d1be1a9,Ie5e9310e

* changes:
  Skip mainline_sdk by default in build_test.bash
  Allow multiple --skip-products and --products arguments to multiproduct_kati
parents bad07a2f 785a31ab
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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 "Running Bazel smoke test..."
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 ' ' ',')" "$@"
+25 −8
Original line number Diff line number Diff line
@@ -50,12 +50,30 @@ var onlySoong = flag.Bool("only-soong", false, "Only run product config and Soon

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 @@ func main() {
	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 @@ func main() {
	}

	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
			}