platform_build_blueprint/parser
Cole Faust 021cc8f5b8 Add support for unset select branches
Currently, with the arch/os mutator, you can override a property
using the default value for just a few arch types, for example:

cc_defaults {
    name: "my_defaults",
    target: {
        windows: {
            enabled: true,
        }
    }
}

cc_binary {
    name: "foo",
    enabled: false,
    defaults: ["my_defaults"],
}

You could make a select statment that acts like the above if it were
all in one module, but currently with select statements you can't make
a defaults module that can be generically applied to any other module
and have the same behavior as the above.

After this cl, the defaults module could look like:

cc_defaults {
    name: "my_defaults",
    enabled: select(variant("arch"), {
        "windows": true,
        _: unset,
    }),
}

Which would have the same behavior. Unset may also be useful for
setting the property under some configurations, but wanting to leave
the implementation-specific default value in others.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I3ea3277ea8b9a0ac5e613b4378945388b9df036a
2024-04-02 16:35:33 -07:00
..
ast.go Add support for unset select branches 2024-04-02 16:35:33 -07:00
modify.go Add multiple property and replace functionality to bpmodify. 2022-08-08 17:58:11 +00:00
modify_test.go Add Patch and PatchList for making textual changes 2018-04-10 16:50:39 -07:00
parser.go Add support for unset select branches 2024-04-02 16:35:33 -07:00
parser_test.go Fix panic in parser when first token is invalid 2022-10-21 14:38:52 -07:00
printer.go Add support for unset select branches 2024-04-02 16:35:33 -07:00
printer_test.go Add support for unset select branches 2024-04-02 16:35:33 -07:00
sort.go bpfmt: Preserve line of comment when sorting arrays 2023-05-17 13:36:13 -07:00
sort_test.go Fix numericStringLess and add tests 2021-03-08 17:59:55 -08:00