Use module specific soong variable when last_optional_release is set.

The original idea of using module specific soong variable was for the modules when they start off as optional module (before transition to mandatory). However, practically at build time, it can remain optional. For now, we will keep self.last_optional_release as the condition and the module can have their specific variable (for enabling/disabling prebuilts) by setting last_optional_release.

Bug: 301183608
Test: atest mainline_modules_sdks_test --host
      packages/modules/common/build/mainline_modules_sdks.sh
Change-Id: I8af5d3dd8733d244c2ade1d9b5118308b3c00622
This commit is contained in:
Alyssa Ketpreechasawat
2023-09-28 02:46:56 +00:00
parent bc25b72229
commit 25a6a5df1b
3 changed files with 140 additions and 2 deletions

View File

@@ -607,6 +607,21 @@ class TestAndroidBpTransformations(unittest.TestCase):
self.apply_transformations(src, transformations, mm.Tiramisu, expected)
def test_optional_mainline_module_latest(self):
"""Tests the transformations applied to an optional mainline sdk LATEST.
This uses wifi as an example of a optional mainline sdk. This checks
that the use_source_config_var property is inserted.
"""
src = read_test_data("wifi_Android.bp.input")
expected = read_test_data("wifi_latest_Android.bp.expected")
module = MAINLINE_MODULES_BY_APEX["com.android.wifi"]
transformations = module.transformations(mm.LATEST, mm.Sdk)
self.apply_transformations(src, transformations, mm.LATEST, expected)
def test_art(self):
"""Tests the transformations applied to a the ART mainline module.