in fix_android_dependencies.py [0:0]
def update_all():
"""Runs through all build configuration files and performs replacements."""
project_root = os.getcwd()
print(f"Repo root: {project_root}")
top_level_report = os.path.join(project_root, RELATIVE_PATH_TO_JSON_REPORT)
toml_path = os.path.join(project_root, RELATIVE_PATH_TO_TOML)
if os.path.exists(top_level_report):
print("Update dependencies via top-level report")
update_project(top_level_report, toml_path)
else:
print("Update dependencies via child-level report(s)")
first_level_subdirectories = get_immediate_subdirectories(project_root)
print(f"List of subdirectories: {first_level_subdirectories}")
for subdirectory in first_level_subdirectories:
print(f"subdirectory: {subdirectory}")
subdirectory_report = os.path.join(project_root, subdirectory, RELATIVE_PATH_TO_JSON_REPORT)
toml_path = os.path.join(project_root, subdirectory, RELATIVE_PATH_TO_TOML)
if os.path.exists(subdirectory_report):
print("\tUpdate dependencies in subdirectory")
update_project(subdirectory_report, toml_path)
else:
print("\tNo report in subdirectory")