summaryrefslogtreecommitdiff
path: root/android/override_module.go
AgeCommit message (Collapse)Author
2025-03-14Move requiredDeps to OverridableDepsMutator Inseob Kim
Required properties can be overridden too. This adds requiredDeps in OverridablePropertiesDepsMutator for modules like override_apex. Bug: 398089235 Test: m nothing --no-skip-soong-tests Test: boot cuttlefish, TH Change-Id: I996543764b86136b8f8ae4427f5f977c7ac6553b
2024-10-10Remove MutatorHandle.Parallel() Colin Cross
All mutators are parallel by default, remove the explicit Parallel() calls. Bug: 372540665 Test: all soong tests pass Flag: EXEMPT refactor Change-Id: I41e3a71bd13c75b7fceae91b1c4cfe678ab62df2
2024-10-07Annotate mutators that use methods that prevent mutator coalescing Colin Cross
Mutator coalescing reduces the overhead of visiting every module for every mutator by calling a series of mutator methods on a a single module in a row. This is only valid for well-behaved mutators. Add methods on MutatorHandle that allow annotating mutators that are not well behaved, and use that to prevent coalescing mutators. Bug: 372076859 Test: all soong tests pass with race detector on Flag: EXEMPT refactor Change-Id: Id9b005f05227e5558cac6d488030a7398af13fb8
2024-05-29Override modules should always override source modules Spandan Das
Since overrides are implemented as variants of the source module, the override module should not be replaced with prebuilts of the source module even when the prebuilt is preferred. Test: go test ./apex Change-Id: I26e97f700276e7beaf6d1bd61b164f11d57a5e09
2024-05-15Reapply "Convert overrides to a TransitionMutator" Colin Cross
Replace the performOverrideMutator with a TransitionMutator. This relands I358f260f1bcd894d7803036ce77ba666c0429355, which was reverted due to a subtle behavior change when converting AliasVariation into an IncomingTransition. AliasVariation is temporary, losing its effect after the next call to CreateVariations that doesn't also call AliasVariation. dexpreopt_bootjar.go was checking if a variant existed after the apex mutator had run and obsoleted the alias created by the perform_override mutator. When the alias was replaced by IncomingTransition it wasn't obsoleted and dexpreopt_bootjar.go found extra dependencies. The extra dependencies were picked up by the core licensing code walking dependencies, and caused a significant increase to the size of system/etc/NOTICE.xml.gz. ag/27324277 removed flags that triggered the extra dependencies, which prevents the system/etc/NOTICE.xml.gz increase for now. b/340911730 tracks avoiding the unnecessary dependencies if the flags are re-enabled. Bug: 319288033 Flag: NONE Test: all soong tests pass Test: no change to build.ninja Change-Id: I46171ba69f24482414a20d63a131941a162f025c
2024-05-09Merge "Revert "Convert overrides to a TransitionMutator"" into main Colin Cross
2024-05-09Revert "Convert overrides to a TransitionMutator" Colin Cross
This reverts commit 49be24b833934d2675395c09594bb2d39b828944. Reason for revert: b/338643193 Bug: 319288033 Bug: 338643193 Change-Id: I7106e779e52ffc943bdcf7ee3b7c7b65fe34122e
2024-05-07Merge "Make the enabled property configurable" into main Cole Faust
2024-05-02Make the enabled property configurable Cole Faust
This allows using select statements with it. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191 Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
2024-05-02Convert overrides to a TransitionMutator Colin Cross
Replace the performOverrideMutator with a TransitionMutator. Bug: 319288033 Flag: NONE Test: all soong tests pass Test: no change to build.ninja Change-Id: I358f260f1bcd894d7803036ce77ba666c0429355
2023-12-08Remove infrastructure to run bp2build Colin Cross
Bug: 315353489 Test: m blueprint_tests Change-Id: Idcf6377d389b94c39e4e6ff4b8efa8a9f9e78b17
2023-08-14Make ShouldConvertWithBp2build avail in loadhooks Liz Kammer
Test: Soong go tests Change-Id: I65af040152107ce50b1a97efcee9364f28bad08b
2023-05-04Prebuilt replacing source should not change partition Jooyung Han
This reveals unintended mistake (setting a wrong target partition) at build-time instead of runtime, which is much harder to debug. Bug: 280368661 Test: m nothing (soong test) Change-Id: Ic5e5e97ba918e24f7a59aceb405c2b105e28cccc
2023-05-02Correct allowlisting for override modules Liz Kammer
Prevoiusly, we were partially correcting for override modules in bp2build/mixed builds in some but not all places. Now we always check for override modules and ensure that Bazel_module properties are propagated properly for override modules. Bug: 279609939 Test: go test soong tests Change-Id: I5445aa71f4c8013315415a2ca9ab9c6b3be6bce0
2023-04-25override_apex can be replaced with apex_set Jooyung Han
Bug: 279247159 Test: m nothing Change-Id: Ic4f8b2b1ee936afe2bf26de7d6cae19d93ecc831
2022-12-20mixed builds: Make apex's GetBazelLabel return the label of the ↵ Jingwen Chen
override_apex, if applicable. And add test1_com.android.tzdata to prod allowlist. Fixes: 261054570 Bug: 261054570 Test: mkcompare Change-Id: I314a4e44ade958ba9a91f71430d76175d734579e
2021-09-02Allows prebuilts in override_apex. Daniel Norman
Bug: 197787336 Test: Create an override_apex that uses a different `prebuilts` than its base. Observe built contents. Test: apex_test.go Change-Id: I7666ed6cfe3f2fa5dd81e5f8c1961477dabbbd3c
2021-05-06Remove registerOverrideMutator Colin Cross
registerOverrideMutator is no longer necessary, the new dependency is returned in overrideModuleDepsMutator and can be immediately acted upon. Test: TestOverrideAndroidApp Change-Id: I82237bad88ccb1d9564e17512c948e770581823f
2021-04-28Add GetEmbeddedPrebuilt and IsModulePrebuilt Paul Duffin
Dedups the many repetitions of the code to obtain a *Prebuilt from a module. Bug: 177892522 Test: m nothing Change-Id: I1ededbe9ee79e89ea6dd8882dfee4be0bf0b51b7
2021-03-09Run "prebuilt_postdeps" mutator again Jooyung Han
Because OverridablePropertiesDepsMutator is run after prebuilt_postdeps, prebuilt's replacement doesn't affect to those deps added by overridable properties. By running prebuilt_postdeps again after OverridablePropertiesDepsMutator, replacing source with prebuilts is applied to those deps. Bug: 152155285 Bug: 181953909 Bug: 181974714 Test: m nothing Change-Id: I24acc02785c9580c2beca096042f1173eb28ba9a
2020-12-17Call ctx.InstallFile for uninstallable cc modules Colin Cross
SkipInstall is actually primarily used to prevent making a module visible to Make, rename it and add new SkipInstall that actually skips installation without affecting Make. Call c.SkipInstall() for uninstallable cc modules to allow calling c.installer.install, which will collect PackagingSpecs for uninstallable cc modules, allowing them to be used by genrules. Bug: 124313442 Test: m checkbuild Change-Id: I8038ed5c6f05c989ac21ec06c4552fb3136b9a7a
2020-08-19Capture list of unused methods when shrinking in R8 Colin Cross
Use the -printusage flag in R8 to output a list of the unused methods. Some of the files can be large (2MB for DocumentsUI, 87MB for all of AOSP), so immediately zip them and remove the originals. The zipped files will be merged and disted. Bug: 151857441 Test: m TARGET_BUILD_APPS=DocumentsUI dist Change-Id: I780e84e80eba7fe4d4fa15fec0f461890afd900b
2020-07-01Fix out/soong/Android-<>.mk reproducibility Dan Willemsen
When there were multiple modules overriding a single module, sometimes we would create the list in different orders, which would trigger some of the later mutators to write the Android-<>.mk out in different orders. Bug: 160207422 Test: diff out/soong/Android-<>.mk between multiple runs on internal master Change-Id: I321db706dd34aa20a0b1556fd282d54b826a4a97
2020-06-25Check `base` property before using it Jooyung Han
OverrideModule's `base` property should point a valid module(OverridableModule). It should be checked before using it. Bug: 159503211 Test: add `override_apex` without `base` m emits error, not panic. Change-Id: I1d7c9395cc9a7461e317dd4b6ddbec3a9e68e9bf (cherry picked from commit 3851b0c1fe8e8ffd3d30b4b8a5289f39a2c98270)
2020-06-23Change how override_modules work with prebuilts. Jaewoong Jung
If an override module is overridden by a prebuilt, only skip its installation instead of completely ignoring it, so that other modules rely on it can still get configured and built properly. Fixes: 159694118 Test: m checkbuild Merged-In: I96d24f1440ff8a8aa8b1253fc22fd532b5588339 Change-Id: I96d24f1440ff8a8aa8b1253fc22fd532b5588339
2020-06-11Make override modules compatible with prebuilts. Jaewoong Jung
Prebuilt's prefer flag doesn't work against override modules because override modules are sort of virtual modules that delegate all the work to their base modules. Therefore, even if a prebuilt module suppresses installation of its src-counterpart override module, the actual build actions are still performed in the base module. This change fixes it by filtering out override modules that are being replaced by prebuilts. Test: prebuilt_test.go Bug: 152155285 Change-Id: I859b35c0629b2b6258dd1ec5e020ba2c77ff9612
2020-01-10Rename OverridableModuleBase.properties. Jaewoong Jung
The generic name causes confusion, even to the IDE. Test: TreeHugger Change-Id: I0cb4959ab41b4732e7ee7a5d1d818ef771674023
2019-12-19Make apex.overrides overridable by override_apex. Jaewoong Jung
Test: apex_test.go Change-Id: Id47e5e5bec45ec1ada68f9d2d806585c5141a2f9
2019-12-05Overridden APEX doesn't contribute to the file contexts Jiyong Park
This change fixes the problem that when an apex module is overridden by another override_apex, the <apex_name>-file_contexts are duplicated when creating the system-level file-contexts. Fixing this by not emitting the file_context info for the overridden apex. In doing so, OverridableModule interface was extended to have GetOverriddenBy() method which can be used to test whether a module is an overridden one or not. Bug: 144338929 Test: m (apex_test amended) Test: add "override_apex {name:"com.googlge.android.tzdata", Change-Id: I5e9401c32899bb9987c90cba4185f571dc1a87f0 base:"com.android.tzdata"}" and the build is successful
2019-11-19Add override_apex module type Jiyong Park
override_apex module type is used to override existing apex module with certain properties overridden. Currently, only the 'apps' property is overridable. Bug: 144338929 Test: m Change-Id: Ic050b062093cda29ce78126cc92dd6097647f7db
2019-11-15Add override_android_test. Jaewoong Jung
This change also adds instrumentation_target_package to android_test, so that the target package name in a test manifest can be easily overridden. Fixes: 134624457 Test: app_test.go Change-Id: Ib8dd703da0038ac76210c92d79e133e37c718122
2019-06-19OverridableModuleBase shouldn't embed ModuleBase. Jaewoong Jung
Individual module structs normally embed ModuleBase themselves. This caused duplicate embedding, and so made common properties like notice inaccessible. Bug: 135460391 Test: app_test.go, TreeHugger Change-Id: I5683b194e3de909d480c083a931cc7e871de1d74
2019-05-15Fix override_android_app dependency issues. Jaewoong Jung
This change fixes an issue where an android_test could not depened on an override_android_app or an android_app overridden by one by moving all override processing to post-deps and forwarding incoming dependencies on override_android_apps to base android_app modules Fixes: 132447700 Test: app_test.go Change-Id: I4ac593be661f541f5ea9823ef97373bee4b186f9
2019-03-27Fix an override_module bug. Jaewoong Jung
proptools.PrependProperties doesn't replace a pointer when both the src and the dst have one. This prevented override_module from overriding simple value pointer properties when the base module has existing values. It turns out this was why the name property needed to be overwritten manually. Bug: 122957760 Test: app_test.go Change-Id: I3302287c31a560422548c22fade95261ddbe606a
2019-03-21Add override_android_app module type. Jaewoong Jung
This is a new implementation of overriding module types that makes use of local variants. With this, product owners can use PRODUCT_PACKAGES to decide which override module to include in their products. Bug: 122957760 Bug: 123640028 Test: app_test.go Change-Id: Ie65e97f615d006b6e9475193b6017ea9d97e8e97
2019-02-28Revert "Add override_module." Jaewoong Jung
This reverts commit aa65e17016152d0d73cd10ab3987bc3bd5c2ef91. Reason for revert: Not compatible with PRODUCT_PACKAGES, and so has very limited use. Change-Id: Ib141d3984a6f12bb50989e66037494c466b066f1
2019-02-27Add override_module. Jaewoong Jung
This new module type replaces the inherit-package function in make by allowing developers to override the name, the certificate, and the manifest package name of an android_app module. Bug: 122957760 Fixes: 123640028 Test: app_test.go + BrowserGoogle Change-Id: Iefe447e7078b25039233221361ef95c83a29973a