Add last finalized version to metadata file.
This CL builds the .latest.version target which contains the last finalized version. This version is read and populated inside the metadata file. The CL also verifies whether all the java sdk libraries under a module, which has been finalized atleast once, have the same extension version. Bug: 242316893 Test: atest --host mainline_modules_sdks_test --no-bazel-mode Change-Id: I94acf448b25d76c45a4bfd3d54fc276e2f01c7cc
This commit is contained in:
@@ -130,7 +130,11 @@ class FakeSnapshotBuilder(mm.SnapshotBuilder):
|
||||
|
||||
for target_path in target_paths:
|
||||
os.makedirs(os.path.split(target_path)[0])
|
||||
self.write_data_to_file(target_path, "")
|
||||
if ".latest.extension_version" in target_path:
|
||||
self.write_data_to_file(
|
||||
target_path, str(self.get_module_extension_version()))
|
||||
else:
|
||||
self.write_data_to_file(target_path, "")
|
||||
|
||||
return target_dict
|
||||
|
||||
@@ -343,6 +347,11 @@ class TestProduceDist(unittest.TestCase):
|
||||
5,
|
||||
msg="The module extension version does not match the expected value."
|
||||
)
|
||||
self.assertEqual(
|
||||
json_data["last_finalized_version"],
|
||||
5,
|
||||
msg="The last finalized version does not match the expected value."
|
||||
)
|
||||
|
||||
def create_build_number_file(self):
|
||||
soong_dir = os.path.join(self.tmp_out_dir, "soong")
|
||||
|
||||
Reference in New Issue
Block a user