Add bpfmt step to bump.py
When we create next year's kernel configs with bump.py, we copy and modify the previous Android.bp file. Make sure it's properly formatted with bpfmt so the CL can uploaded without manual changes. Test before and after `rm out/host/linux-x86/bin/bpfmt` Test: python tools/bump.py w x Bug: 326134954 Change-Id: Ia1a631bcae915aeeb5218d1048270d64c3e9e2de
This commit is contained in:
parent
7de932a4b9
commit
77bdbfd261
1 changed files with 5 additions and 0 deletions
|
@ -54,6 +54,11 @@ class Bump(object):
|
|||
year = datetime.datetime.now().year
|
||||
check_call("sed -i'' -E 's/Copyright \\(C\\) [0-9]{{4,}}/Copyright (C) {}/g' {}".format(year, abs_path), shell=True)
|
||||
replace_configs_module_name(self.current_release, self.new_release, abs_path)
|
||||
if os.path.basename(abs_path) == "Android.bp":
|
||||
if shutil.which("bpfmt") is not None:
|
||||
check_call("bpfmt -w {}".format(abs_path), shell=True)
|
||||
else:
|
||||
print("bpfmt is not available so {} is not being formatted. Try `m bpfmt` first".format(abs_path))
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
|
|
Loading…
Reference in a new issue