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

Commit 0c869edc authored by Cole Faust's avatar Cole Faust
Browse files

Make release_config.bzl match internal

To avoid merge conflicts. These are buildifier errors that will be
fixed in a followup cl.

Test: presubmits
Change-Id: I22c91c796aee16ef16f05471c2ff5221fa41d7b3
parent c3838259
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -41,16 +41,17 @@ def flag(name, partitions, default):
            if len(partitions) > 1:
                fail("\"all\" can't be combined with other partitions: " + str(partitions))
        elif partition not in _flag_partitions:
            fail("Invalid partition: " + partition + ", allowed partitions: " +
                 str(_flag_partitions))
            fail("Invalid partition: " + partition + ", allowed partitions: "
                    + str(_flag_partitions))
    if type(default) not in _valid_types:
        fail("Invalid type of default for flag \"" + name + "\" (" + type(default) + ")")
    return {
        "name": name,
        "partitions": partitions,
        "default": default,
        "default": default
    }


def value(name, value):
    "Define the flag value for a particular configuration."
    return {
@@ -58,6 +59,7 @@ def value(name, value):
        "value": value,
    }


def _format_value(val):
    "Format the starlark type correctly for make"
    if type(val) == "NoneType":
@@ -67,9 +69,9 @@ def _format_value(val):
    else:
        return val


def release_config(all_flags, all_values):
    "Return the make variables that should be set for this release config."

    # Validate flags
    flag_names = []
    for flag in all_flags:
@@ -119,3 +121,4 @@ def release_config(all_flags, all_values):
        result["_ALL_RELEASE_FLAGS." + flag["name"] + ".SET_IN"] = set_in

    return result