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