platform_build_blueprint/proptools
Cole Faust 6437d4e737 Select statements
Select statements are a new blueprint feature inspired by bazel's select
statements. They are essentially alternative syntax for soong config
variables that require less boilerplate. In addition, they support
making decisions based on a module's variant, which will eliminate
the need for manual property struct manipulation, such as the arch
mutator's arch: and target: properties.

In order to support decisions based on the variant, select statements
cannot be evaluated as soon as they're parsed. Instead, they must be
stored in the property struct unevaluated. This means that individual
properties need to change their type from say, string, to
Configurable[string]. Currently, only configurable strings, bools, and
string slices are supported, but more types can be added later.
The module implementation must call my_property.Evaluate(ctx) in order
to get the final, resolved value of the select statement.

Bug: 323382414
Test: go tests
Change-Id: I62f8721d7f0ac3d1df4a06d7eaa260a5aa7fcba3
2024-03-06 15:00:39 -08:00
..
clone.go Select statements 2024-03-06 15:00:39 -08:00
clone_test.go Fix TestCloneProperties for go 1.21 2023-11-08 22:07:58 -08:00
configurable.go Select statements 2024-03-06 15:00:39 -08:00
escape.go Optimize NinjaEscapeList to avoid allocating an output slice 2023-11-01 15:15:16 -07:00
escape_test.go Fix TestExternalShellEscaping and TestExternalShellEscapeIncludingSpaces on darwin 2023-12-15 16:30:59 -08:00
extend.go Select statements 2024-03-06 15:00:39 -08:00
extend_test.go Select statements 2024-03-06 15:00:39 -08:00
filter.go Always shard structs if they would exceed maxNameSize even if unfiltered 2021-03-26 09:59:19 +00:00
filter_test.go Always shard structs if they would exceed maxNameSize even if unfiltered 2021-03-26 09:59:19 +00:00
hash_provider.go Use WriteString in hashProviderInternal 2024-02-02 15:57:26 -08:00
hash_provider_test.go Enforce that providers are not changed 2024-01-30 15:18:24 -08:00
proptools.go Select statements 2024-03-06 15:00:39 -08:00
proptools_test.go Select statements 2024-03-06 15:00:39 -08:00
tag.go Select statements 2024-03-06 15:00:39 -08:00
tag_test.go propertyIndexesWithTag can handle slice of struct 2021-02-24 01:02:59 +09:00
typeequal.go Support nil pointers to structs in properties 2016-08-05 17:19:36 -07:00
typeequal_test.go Support nil pointers to structs in properties 2016-08-05 17:19:36 -07:00
unpack.go Select statements 2024-03-06 15:00:39 -08:00
unpack_test.go Select statements 2024-03-06 15:00:39 -08:00