summaryrefslogtreecommitdiff
path: root/android/config_test.go
AgeCommit message (Collapse)Author
2025-03-18Generic configuration for generic system modules. Justin Yun
Config object includes a copy of itself for the generic configuration. The generic configuration replaces any product-specific configurations with the generic information. When a module context gets Config() object, it returns the generic configuration if the module sets use_generic_config to true. Otherwise, Config() returns the original config object as before. By adding `generic:"<value>"` annotation to the product variable, the variables will be initialized with the <value> for the generic configs. If the <value> is "unset", the variable will be unset. The generic modules can be included in the shared system image to be installed in multiple targets. Bug: 361816274 Test: m nothing --no-skip-soong-tests Change-Id: I15e4ade17ad1a8969f8e0e91d994b60545dc412f
2025-03-05More partial compile optimizations LaMont Jones
Add "disable_stub_validation" and "disable_api_lint" Bug: b/394154271 Bug: b/396345437 Test: manual Change-Id: I1dc2b52bb3bfc3275287c99dbc679290bfeece35
2025-02-18Support `use_d8` partial compile flag LaMont Jones
Make `use_d8` an opt-out flag (when SOONG_PARTIAL_COMPILE=true). Bug: b/374975543 Test: manual, TH Change-Id: Iaef4bb5243957812783c5dbc79a5bf27e1096166
2025-02-13config: make partialCompileFlags visible LaMont Jones
Other modules need to check partialCompileFlags values. Bug: b/374975543 Test: manual, TH Change-Id: Id8dcbc64506561cb9d1c26e7b53f193d306e0562
2024-12-18Remove non-constant format string in soong Justin Yun
go 1.24 does not allow non-constant format string. Replace them to use non-formated functions or constant strings. Bug: na Test: go test -run ^TestPartialCompile$ android/soong/android Change-Id: I83b2e53c2a01099fe9e8697876b0b4097ac88a7b
2024-10-30Reapply "Only use partial compile on eng builds" LaMont Jones
This reverts commit bef36af55ac6f97002eb51ed251bad3cf652ff27, and avoids reanalysis on every build for eng builds. Bug: b/365536323 Test: manual, TH Change-Id: Ie6eafa09494c3c2525434086f281b387da0e270d
2024-10-30Revert "Only use partial compile on eng builds" LaMont Jones
This reverts commit 768b00f9001e65656b4b46dac705ba375b0b0b1b. Reason for revert: b/365536323 due to envvar overrides. Change-Id: Ibcafddd9a84d5e15362efce77691b45702f2420e
2024-10-29Only use partial compile on eng builds LaMont Jones
Bug: b/365536323 Test: manual Change-Id: Ib52a7c7fc14490aa62f18408a76bec20e40c3350
2024-08-09Add PrepareForTestWithBuildFlag Colin Cross
Add a helper function that creates a test fixture preparer that sets a build flag, and use it everywhere that was setting build flags manually. Test: all soong tests Flag: EXEMPT refactor Change-Id: I68d50d68787a30d091f0827e8caa51f5c5a762ef
2024-06-18Add RELEASE_ACONFIG_EXTRA_RELEASE_CONFIGS LaMont Jones
This build flag causes us to create aconfig flag artifacts for the given extra release configs. Bug: 298444886 Test: manual Change-Id: I10148f6e7318b0477438ed1d8baafbf4dc594c90
2023-07-17Platform mapping-based product config Cole Faust
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
2021-03-17Fix writing soong.variables . Lukacs T. Berki
ConfiguredJarList had a marshaler but no unmarshaler. Bug: 182965747 Test: Presubmits. Change-Id: Id03669f4a0a3d389063a4e4b11af6d6be63dbba3
2021-02-04Detect empty apex in ConfiguredJarList Paul Duffin
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
2020-11-24Remove soong.config, FileConfigurableOptions, MegaDevice config. Jingwen Chen
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
2020-10-27Retry: Make ConfiguredJarList immutable Paul Duffin
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
2020-10-09Revert "Make lots of tests run in parallel" Colin Cross
This reverts commit 323dc60712491c71ccdc5363c42df61f0a192487. Reason for revert: Possible cause of test instability Bug: 170513220 Test: soong tests Change-Id: Iee168e9fbb4210569e6cffcc23e60d111403abb8
2020-10-06Make lots of tests run in parallel Colin Cross
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
2018-07-22Fix `go vet` issues Dan Willemsen
Test: go vet ./... Change-Id: Ifb936ccc5e2b5a2c3fcbbbcb54f680e2973ea1b3
2018-04-11Add VendorConfig for board-level Soong plugin configuration Dan Willemsen
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
2017-11-20Prohibit accidental renames of product config json fields Jeff Gaston
Can be caused by `json:"omitempty"` instead of `json:",omitempty"` Bug: 69076024 Test: m -j # which runs unit tests Change-Id: I92e3193d00a740c72d36a56748e0b0a8ad1d772e