提交 7f93dfff 编写于 作者: L lubinglun

Add disable post build option

Issue: https://gitee.com/openharmony/build/issues/I5MT9XSigned-off-by: Nlubinglun <lubinglun@huawei.com>
上级 29aad33a
......@@ -113,6 +113,11 @@ def add_options(parser):
default=False,
help='it will skip package image process'
'you can enable it if you do not need package image')
parser.add_argument('--disable-post-build',
action='store_true',
default=False,
help='it will skip post build process, '
'you can enable it if you do not need post build')
parser.add_argument('--device-type',
help='specifies device type',
default='default')
......@@ -204,6 +209,8 @@ def exec_command(args):
cmd_args['fast_rebuild'] = args.fast_rebuild
if args.disable_package_image:
cmd_args['disable_package_image'] = args.disable_package_image
if args.disable_post_build:
cmd_args['disable_post_build'] = args.disable_post_build
if hasattr(args, 'device_type') and args.device_type:
cmd_args['device_type'] = args.device_type
if hasattr(args, 'build_variant') and args.build_variant:
......
......@@ -152,15 +152,17 @@ class Build():
except Exception:
raise
else:
post_build = PostBuild(self.config)
post_build.patch_ohos_para(cmd_args)
if not cmd_args.get('disable_package_image'):
post_build.package_image()
output_part_rom_status(self.config.root_path)
finally:
if 'post_build' not in locals():
if not cmd_args.get('disable_post_build'):
post_build = PostBuild(self.config)
post_build.clean(self.start_time)
post_build.patch_ohos_para(cmd_args)
if not cmd_args.get('disable_package_image'):
post_build.package_image()
output_part_rom_status(self.config.root_path)
finally:
if not cmd_args.get('disable_post_build'):
if 'post_build' not in locals():
post_build = PostBuild(self.config)
post_build.clean(self.start_time)
hb_info(f'{os.path.basename(self.config.out_path)} build success')
hb_info(f'cost time: {self.build_time}')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册