From f28b69545666016cb61f6228b9d18cef76824ad7 Mon Sep 17 00:00:00 2001 From: Devin Moore Date: Thu, 12 Sep 2024 18:09:21 +0000 Subject: [PATCH] bump.py: modify the phony system_compatibility_matrix.xml module Some of the vintf build steps in Android.mk have been moved into soong with the system_compatibility_matrix.xml phony module, so we need to bump those now too. Test: build/make/tools/finalization/build-step-0-and-m.sh cf_x86_64_phone && m Bug: 331696132 Change-Id: I8d017b12aa2d2ecc097ae58c39007ce6585429e1 --- compatibility_matrices/bump.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/compatibility_matrices/bump.py b/compatibility_matrices/bump.py index 35633c14f4..4e3ceaafca 100755 --- a/compatibility_matrices/bump.py +++ b/compatibility_matrices/bump.py @@ -111,6 +111,25 @@ class Bump(object): "kernel_configs", "-a", " ".join(next_kernel_configs), android_bp ]) + # update the SYSTEM_MATRIX_DEPS variable and the phony module's + # product_variables entry. + lines = [] + with open(android_bp) as f: + for line in f: + if f" \"{self.device_module_name}\",\n" in line: + lines.append(f" \"{self.current_module_name}\",\n") + + if f" \"{self.current_module_name}\",\n" in line: + lines.append(f" \"{self.next_module_name}\",\n") + else: + lines.append(line) + + with open(android_bp, "w") as f: + f.write("".join(lines)) + + + # This Android.mk file may be deprecated soon and the functionality is + # replaced by the soong phony module system_compatibility_matrix.xml. def edit_android_mk(self): android_mk = self.interfaces_dir / "compatibility_matrices/Android.mk" lines = []