Generate soong_config_module_type inline in the snapshot

Previously, this imported the soong_config_module_type definitions from
a manually curated file. That had a couple of problems:
1. It required that the file be manually updated everytime that a new
   module_type was added to an sdk snapshot controlled by a specific
   config variable.
2. Adding a new config variable required creating another file to be
   manually curated.
3. It made a snapshot that was generated for an earlier release
   dependent on an additional file from that release which was in a
   separate repository and would require a lot of extra work to update
   if necessary.

This change generates the soong_config_module_type inline in the
snapshot Android.bp file and while it makes it slightly bigger and does
duplicate some of these definitions in snapshots that use the same
config variable it makes each snapshot much more self contained and
makes it easier to add module specific config variables.

The latter is the main driver for this change as follow up changes will
add module specific variables for the optional modules.

Bug: 233965247
Test: atest mainline_modules_sdks_test
      packages/modules/common/build/mainline_modules_sdks.sh
      # Compare before and after to make sure that they are
      # consistent.
Change-Id: Ie6b6d99e1fcb17ebd8ed291a5bc7d4664fceea92
This commit is contained in:
Paul Duffin
2022-06-08 11:06:00 +00:00
parent 2ec8e5cd49
commit d29f8e0597
4 changed files with 64 additions and 45 deletions

View File

@@ -399,8 +399,7 @@ class TestSoongConfigBoilerplateInserter(unittest.TestCase):
"""Tests the transformations applied to a common mainline module.
This uses ipsec as an example of a common mainline module. This checks
that the correct Soong config module types and variables are used and
that it imports the definitions from the correct location.
that the general Soong config module types and variables are used.
"""
src = read_test_data("ipsec_Android.bp.input")
@@ -416,7 +415,7 @@ class TestSoongConfigBoilerplateInserter(unittest.TestCase):
The ART mainline module uses a different Soong config setup to the
common mainline modules. This checks that the ART specific Soong config
module types, variable and imports are used.
module types, and variables are used.
"""
src = read_test_data("art_Android.bp.input")