Commit graph

20 commits

Author SHA1 Message Date
Cole Faust
aeecb75be2 Add test for parse error
This used to error out prior to the other cl in this topic.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6d95eb00c75836a5a0c60e07bfd4b306388591ed
2024-05-22 17:01:59 -07:00
Cole Faust
c15b0234e9 Merge "Support soong config value variables on Configurable properties" into main 2024-05-22 23:58:50 +00:00
Cole Faust
5f29706843 Support soong config value variables on Configurable properties
Configurable properties were previously not having their %s's
substituted with the actual value.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: Id317e58a1fd878db5452d5d0a5df588021bcdcdb
2024-05-22 14:34:47 -07:00
Cole Faust
5e79b167b8 Merge "Add tests for unhandled select condition errors" into main 2024-05-22 18:51:10 +00:00
Cole Faust
4ab1563fe5 Merge "Update select tests for optionals" into main 2024-05-22 00:02:41 +00:00
Cole Faust
749eeaa94c Update select tests for optionals
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I314719c9e287638acbc1ef82651d14fee6e1a55a
2024-05-21 14:19:05 -07:00
Cole Faust
b9519094d9 Add test for selects with variables
I thought this might need extra parsing code to handle, but it appears
to work fine.

Bug: 323382414
Test: Presubmits
Change-Id: I4e8bf44a222427c34b2709a41aa5497984154d9d
2024-05-21 11:20:15 -07:00
Cole Faust
b81dc0efd0 Add tests for unhandled select condition errors
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: Ic36545c2730216c514c1530ded35829966e974f0
2024-05-09 15:51:52 -07:00
Cole Faust
60f6bb2cd1 Add tests for error when assigning select to nonconfigurable property
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I2403aa846238e5c0ea11d7a1b74d3915b3c7b739
2024-04-30 13:58:55 -07:00
Cole Faust
693494682f Add test for configurable defaults applied to multiple modules
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I510472a81ae682e5a55171ec4a9aec420d577307
2024-04-26 12:37:57 -07:00
Cole Faust
fc57d40bf1 Change the syntax for arch selecting and add os selecting
This changes the syntax from select(variant("arch"), {...}) to
select(arch(), {...}) to make it shorter and to make it clear that
we can restrict what variants you can select on.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: Iafe05b5f455895313a563ed6292f4016b58180b0
2024-04-11 12:09:44 -07:00
Cole Faust
fdbf5d476b Update the ConfigurableEvaluator for typed selects
See the blueprint cl for more information.

Also added tests for both multivariable and typed selects.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I00c1a3c56d34affb88f4b4d911c318b28ffe7695
2024-04-11 11:40:02 -07:00
Cole Faust
b78ce43ae3 Rename Evaluate() to Get() and add GetDefault()
Part of the design of property structs is that they were easy to access.
In keeping with that spirit, use a shorter and easier to spell name
for the getter, and add GetDefault() so that you don't need to pass
the result of Get() to one of the
proptools.StringDefault/BoolDefault/etc functions.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I0b8df151de59f2cd9463425c6666cbfda6bf47f2
2024-04-04 15:09:18 -07:00
Cole Faust
02dd6e5640 Add tests for android:replace_instead_of_append
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: Ideb739b3f1a6a5854453db7d51bdee73a3979fd4
2024-04-04 15:09:04 -07:00
Cole Faust
683316a2b0 Rename default select branch to 'default' keyword
Previously I was using an underscore to denote the default branch
because I was thinking that I would allow variable bindings in the
select branches, and 'default' could be mistaken for the name of a
variable. But I think it's better to just introduce alternate syntax,
like `default @ my_var: "foo" + my_var,` to do the variable bindings,
so that we can have a clearer name for the default case.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I8cbded97a029c06782fb5313d8c0e67f22951482
2024-04-04 11:24:24 -07:00
Cole Faust
12c8ed4601 Add tests for "unset" select statements
See the blueprint cl for more information.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I3a0302f370e8e498556b219cbda70bdb0255f6ef
2024-04-04 10:41:43 -07:00
Cole Faust
74ef465ebc Add tests for new boolean addition behavior
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I746015a0c96a91ce7aa796e4ef06f62e3da79592
2024-03-28 12:14:49 -07:00
Cole Faust
0aa21cc8e2 Add the ability to select on arch
Bug: 323382414
Test: go test
Change-Id: I0d4cf391a1a625c5160456db1f4f7fa424c2141e
2024-03-25 17:18:08 -07:00
Cole Faust
bdd8aeeb58 Make select statements work on path properties
Fixes: 329711542
Test: go test
Change-Id: I71f489c26c535174e226e4a9ab449cc2b4bee83a
2024-03-14 15:24:09 -07:00
Cole Faust
5a231bd819 Select statements
See the blueprint cl for more information.

Things still to do:
 - Support selecting on product variables and
   variants
 - Test/Support property struct reflection tags
   like arch_variant, path, and variant_prepend
 - Test that selects combine well with existing
   configurability mechanisms like arch:, target:,
   multilib:, python's version:, etc.

Bug: 323382414
Test: go tests
Change-Id: If5d1ea1ad0c4ebabffaea91d62e1a1c6f926a793
2024-03-06 16:03:01 -08:00