Improve testing of mainline_modules_sdks.py
Adds a test for a com.google name module and makes the structure of the
test snapshot created by FakeSnapshotBuilder.create_snapshot_file()
match the names used in an actual sdk snapshot.
Bug: 218685706
Test: atest --host mainline_modules_sdks_test
pyformat -s 4 --force_quote_type double -i build/mainline_modules_sdks*.py
/usr/bin/pylint --rcfile $ANDROID_BUILD_TOP/tools/repohooks/tools/pylintrc build/mainline_modules_sdks*.py
Change-Id: Ia11cbb2da717218ba0b2da9a2238856dc8cebf8f
This commit is contained in:
@@ -736,6 +736,18 @@ def create_producer():
|
||||
)
|
||||
|
||||
|
||||
def aosp_to_google(module):
|
||||
"""Transform an AOSP module into a Google module"""
|
||||
new_apex = aosp_to_google_name(module.apex)
|
||||
# Create a copy of the AOSP module with the internal specific APEX name.
|
||||
return dataclasses.replace(module, apex=new_apex)
|
||||
|
||||
|
||||
def aosp_to_google_name(name):
|
||||
"""Transform an AOSP module name into a Google module name"""
|
||||
return name.replace("com.android.", "com.google.android.")
|
||||
|
||||
|
||||
def filter_modules(modules):
|
||||
target_build_apps = os.environ.get("TARGET_BUILD_APPS")
|
||||
if target_build_apps:
|
||||
|
||||
Reference in New Issue
Block a user