mirror of
https://github.com/openharmony/build_lite.git
synced 2026-07-19 08:33:46 -04:00
delete function: patch_ohos_para Issue: https://gitee.com/openharmony/build/issues/I6478U Signed-off-by: lubinglun <lubinglun@huawei.com> Change-Id: Ib32cf3f21d0fb1b74ad2d4a4e0f9d4f53c7d4521 Change-Id: I8124b06a765bc2e82c2953713e319586f0a0257a
This commit is contained in:
@@ -131,7 +131,7 @@ def add_options(parser):
|
||||
default='default')
|
||||
parser.add_argument('--build-variant',
|
||||
help='specifies device operating mode',
|
||||
default='user')
|
||||
default='root')
|
||||
parser.add_argument('--share-ccache',
|
||||
default="",
|
||||
help='It is customized path to place ccache, which allow'
|
||||
|
||||
@@ -158,7 +158,6 @@ class Build():
|
||||
else:
|
||||
if not cmd_args.get('disable_post_build'):
|
||||
post_build = PostBuild(self.config)
|
||||
post_build.patch_ohos_para(cmd_args)
|
||||
if not cmd_args.get('disable_package_image'):
|
||||
post_build.package_image()
|
||||
if not disable_post_build_args or 'output_part_rom_status' not in disable_post_build_args:
|
||||
@@ -236,6 +235,8 @@ class Build():
|
||||
os_level = self.config.os_level
|
||||
if cmd_args.get('build_variant'):
|
||||
self.register_args('build_variant', cmd_args.get('build_variant'))
|
||||
if cmd_args.get('device_type'):
|
||||
self.register_args('device_type', cmd_args.get('device_type'))
|
||||
gn_cmd = [
|
||||
gn_path,
|
||||
'gen',
|
||||
|
||||
@@ -20,7 +20,7 @@ import os
|
||||
import subprocess
|
||||
from datetime import datetime
|
||||
from distutils.spawn import find_executable
|
||||
from hb_internal.common.utils import OHOSException, exec_command
|
||||
from hb_internal.common.utils import exec_command
|
||||
from hb_internal.common.utils import hb_warning
|
||||
|
||||
|
||||
@@ -108,39 +108,6 @@ class PostBuild:
|
||||
self.get_warning_list()
|
||||
if not disable_post_build_args or 'compute_overlap_rate' not in disable_post_build_args:
|
||||
self.compute_overlap_rate()
|
||||
|
||||
def patch_ohos_para(self, cmd_args):
|
||||
ohos_para_data = []
|
||||
ohos_para_file_path = os.path.join(self._out_path, 'packages/phone/system/etc/param/ohos.para')
|
||||
if not os.path.exists(ohos_para_file_path):
|
||||
return
|
||||
with open(ohos_para_file_path, 'r', encoding='utf-8') as ohos_para_file:
|
||||
for line in ohos_para_file:
|
||||
ohos_para_data.append(line)
|
||||
if cmd_args.get('device_type') and cmd_args.get('device_type') != 'default':
|
||||
for i, line in enumerate(ohos_para_data):
|
||||
if ohos_para_data[i].__contains__('const.build.characteristics'):
|
||||
ohos_para_data[i] = 'const.build.characteristics=' + cmd_args.get('device_type') + '\n'
|
||||
break
|
||||
if cmd_args.get('build_variant'):
|
||||
if cmd_args.get('build_variant') != 'user' and cmd_args.get('build_variant') != 'root':
|
||||
raise OHOSException('Error: --build-variant support user or root mode currently')
|
||||
for i, line in enumerate(ohos_para_data):
|
||||
if ohos_para_data[i].__contains__('const.secure'):
|
||||
if cmd_args.get('build_variant') == 'user':
|
||||
ohos_para_data[i] = 'const.secure=1\n'
|
||||
else:
|
||||
ohos_para_data[i] = 'const.secure=0\n'
|
||||
if ohos_para_data[i].__contains__('const.debuggable'):
|
||||
if cmd_args.get('build_variant') == 'user':
|
||||
ohos_para_data[i] = 'const.debuggable=0\n'
|
||||
else:
|
||||
ohos_para_data[i] = 'const.debuggable=1\n'
|
||||
data = ''
|
||||
for line in ohos_para_data:
|
||||
data += line
|
||||
with open(ohos_para_file_path, 'w', encoding='utf-8') as ohos_para_file:
|
||||
ohos_para_file.write(data)
|
||||
|
||||
def package_image(self):
|
||||
image_path = os.path.join(self._out_path, 'packages/phone/images/')
|
||||
|
||||
Reference in New Issue
Block a user