未验证 提交 43b844eb 编写于 作者: O openharmony_ci 提交者: Gitee

!346 bugfix: skip kernel for standard product.

Merge pull request !346 from yaoxiaoyu_903c/master
......@@ -304,6 +304,7 @@ class Build():
if self.config.os_level != "standard":
self.register_args('device_company',
self.config.device_company)
self.register_args('ohos_kernel_type', self.config.kernel)
if self.config.kernel:
self.register_args('ohos_kernel_type', self.config.kernel)
self._args_list += Product.get_features(self.config.product_json)
......@@ -145,10 +145,6 @@ class Config(metaclass=Singleton):
@property
def kernel(self):
if self._kernel is None:
raise OHOSException('Failed to get kernel. '
'Please run command "hb set" to '
'init OHOS development environment')
return self._kernel
@kernel.setter
......
......@@ -52,11 +52,8 @@ def read_json_file(input_file):
raise OHOSException(f'{input_file} not found')
with open(input_file, 'rb') as input_f:
try:
data = json.load(input_f)
return data
except json.JSONDecodeError:
raise OHOSException(f'{input_file} parsing error!')
data = json.load(input_f)
return data
def dump_json_file(dump_file, json_data):
......
......@@ -32,9 +32,7 @@ def add_options(parser):
nargs='?',
default=None,
help='Set OHOS root path')
parser.add_argument('-p',
'--product',
help='Set OHOS board and kernel')
parser.add_argument('-p', '--product', help='Set OHOS board and kernel')
def exec_command(args):
......@@ -92,7 +90,10 @@ def set_product(product_name=None, company=None):
if config.version == '2.0':
config.device_path = board_path
else:
config.device_path = Device.get_device_path(board_path, config.kernel,
kernel_version)
if config.os_level == "standard":
config.device_path = board_path
else:
config.device_path = Device.get_device_path(
board_path, config.kernel, kernel_version)
return 0
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册