Always include static dependencies
Always make support libraries into fat jars that include all
static dependencies, which also requires always extracting
AndroidManifest.xml.
Bug: 78300023
Test: ./update_prebuilts.py -s 4737625 && ./update_prebuilts.py -x 4730458 && ./update_prebuilts.py -t 4616833 && m checkbuild
Change-Id: Iaed8fd3f1bc3abea4861f27183053a621ed72022
diff --git a/update_prebuilts/update_prebuilts.py b/update_prebuilts/update_prebuilts.py
index fb732c7..5d2e34f 100755
--- a/update_prebuilts/update_prebuilts.py
+++ b/update_prebuilts/update_prebuilts.py
@@ -408,7 +408,7 @@
return maven_lib_info
-def transform_maven_repos(maven_repo_dirs, transformed_dir, extract_res=True, include_static_deps=False):
+def transform_maven_repos(maven_repo_dirs, transformed_dir, extract_res=True, include_static_deps=True):
cwd = os.getcwd()
# Use a temporary working directory.
@@ -469,17 +469,17 @@
artifact_file = os.path.join(new_dir, artifact_info.file)
- if extract_res:
- target_dir = os.path.join(working_dir, make_dir_name)
- if not os.path.exists(target_dir):
- os.makedirs(target_dir)
+ if maven_lib_type == "aar":
+ if extract_res:
+ target_dir = os.path.join(working_dir, make_dir_name)
+ if not os.path.exists(target_dir):
+ os.makedirs(target_dir)
- if maven_lib_type == "aar":
process_aar(artifact_file, target_dir)
- with zipfile.ZipFile(artifact_file) as zip:
- manifests_dir = os.path.join(working_dir, "manifests")
- zip.extract("AndroidManifest.xml", os.path.join(manifests_dir, make_lib_name))
+ with zipfile.ZipFile(artifact_file) as zip:
+ manifests_dir = os.path.join(working_dir, "manifests")
+ zip.extract("AndroidManifest.xml", os.path.join(manifests_dir, make_lib_name))
print(maven_lib_vers, ":", maven_lib_name, "->", make_lib_name)
@@ -556,7 +556,7 @@
return False
# Transform the repo archive into a Makefile-compatible format.
- return transform_maven_repos([repo_dir], support_dir, extract_res=True, include_static_deps=True)
+ return transform_maven_repos([repo_dir], support_dir, extract_res=True)
def update_androidx(target, target_toolkit, build_id, local_file):
@@ -603,7 +603,7 @@
return False
# Transform the repo archive into a Makefile-compatible format.
- return transform_maven_repos([repo_dir], os.path.join(extras_dir, 'app-toolkit'), extract_res=True, include_static_deps=True)
+ return transform_maven_repos([repo_dir], os.path.join(extras_dir, 'app-toolkit'), extract_res=True)
def update_constraint(target, build_id):