This allows us to set product variables as build settings instead
of loading them from a target's provider, which further allows us
to read product config variables in transitions.
Bug: 287539062
Bug: 269577299
Test: Presubmits
Change-Id: I8497703f706162572ceb3486240e1eb02a37f5f6
Previously, ConfiguredJarList would accept an empty apex name,
e.g. ":jar" which makes no sense as every apex has to have a non-empty
name. This change makes an empty apex invalid.
In order to improve the test coverage of the TestConfiguredJarList test
this change also changes the implementation of
CreateTestConfiguredJarList([]string) to marshal the supplied strings
into a json list and then unmarshal into a ConfiguredJarList which more
closely matches how it is used at runtime.
Bug: 178361284
Test: m nothing
Change-Id: I7dfec6b4cc1923aa99746e976da0393922ef0791
No current use cases for soong.config and user-editable local
configuration options for Soong, so let's remove it to reduce the API
surface.
The MegaDevice configuration is used for building every module, for
every cpu variant, for every architecture, but it apparently isn't
used for a while now.
Test: m nothing
Test: TH
Fixes: 174188200
Change-Id: I2550e70ff6f9c8b57e9a7cc517d6a119a032a27a
By making the Append and RemoveList methods return a new list instead
of modifying the existing list it makes the ConfiguredJarList usages
easier to reason about and safer to use, especially considering that
they are primarily used in global configuration.
Added some tests for Append/RemoveList to ensure that they work and
do not modify the original or result in newly created lists sharing
storage with the original which would lead to corruption.
Bug: 171756871
Bug: 171479578
Test: m nothing
EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m nothing
Change-Id: I541c4686ecdd45c6a0c8b1c93fedf0fcd5952e2b
This reverts commit 323dc60712.
Reason for revert: Possible cause of test instability
Bug: 170513220
Test: soong tests
Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
Putting t.Parallel() in each test makes them run in parallel.
Additional t.Parallel() could be added to each subtest, although
that requires making a local copy of the loop variable for
table driven tests.
Test: m checkbuild
Change-Id: I5d9869ead441093f4d7c5757f2447385333a95a4
This allows Soong (Go) plugins to get custom configurations set in the
current product's BoardConfig.mk.
I'll have some more comprehensive documentation later, but the general
concept is that you'd have one namespace per plugin, defined in the
BoardConfig.mk (though they would work in the product.mk files too):
SOONG_CONFIG_NAMESPACES += myPlugin
Within that namespace you can set key-value pairs:
SOONG_CONFIG_myPlugin := key1 key2 ...
...
SOONG_CONFIG_myPlugin_key1 := value
...
SOONG_CONFIG_myPlugin_key2 := true
Then in your plugin, you can ask for your namespace:
vars := ctx.Config().VendorConfig("myPlugin")
And then use them:
str := vars.String("key1")
if vars.Bool("key2") { ... }
if vars.IsSet("key3") { ... }
Warning: It's not a good idea to fail on missing inputs, since an
android tree may contain plugins from multiple owners, and we may
configure your modules (but not build/install them) even if they're not
meant for the currently configured product.
Bug: 76168832
Test: define some variables, use them
Test: m blueprint_tools
Change-Id: I4c38f5a4344022c6f332de279d9bbef24502e741
Can be caused by `json:"omitempty"` instead of `json:",omitempty"`
Bug: 69076024
Test: m -j # which runs unit tests
Change-Id: I92e3193d00a740c72d36a56748e0b0a8ad1d772e