Merge "Split gen_bp_files, make Android.bp idempotent."

This commit is contained in:
Bill Peckham
2020-10-07 13:30:24 +00:00
committed by Gerrit Code Review

View File

@@ -208,7 +208,7 @@ def gen_bp_module(variation, name, version, target_arch, arch_props, bp_dir):
return bp return bp
def gen_bp_files(install_dir, snapshot_version): def build_props(install_dir):
# props[target_arch]["static"|"shared"|"binary"|"header"][name][arch] : json # props[target_arch]["static"|"shared"|"binary"|"header"][name][arch] : json
props = dict() props = dict()
@@ -264,11 +264,17 @@ def gen_bp_files(install_dir, snapshot_version):
else: else:
variation_dict[module_name][arch].update(prop) variation_dict[module_name][arch].update(prop)
for target_arch in props: return props
def gen_bp_files(install_dir, snapshot_version):
props = build_props(install_dir)
for target_arch in sorted(props):
androidbp = '' androidbp = ''
bp_dir = os.path.join(install_dir, target_arch) bp_dir = os.path.join(install_dir, target_arch)
for variation in props[target_arch]: for variation in sorted(props[target_arch]):
for name in props[target_arch][variation]: for name in sorted(props[target_arch][variation]):
androidbp += gen_bp_module(variation, name, snapshot_version, androidbp += gen_bp_module(variation, name, snapshot_version,
target_arch, target_arch,
props[target_arch][variation][name], props[target_arch][variation][name],