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

!653 闭源子系统适配路径统一

Merge pull request !653 from lwx1153805/lsn_build_lite_0118
...@@ -21,6 +21,7 @@ import re ...@@ -21,6 +21,7 @@ import re
import json import json
from hb_internal.common.utils import hb_info from hb_internal.common.utils import hb_info
from hb_internal.common.config import Config
budle_json_files = [] budle_json_files = []
standard_part_roms = [] standard_part_roms = []
...@@ -192,7 +193,8 @@ def read_subsystem_config(root_path): ...@@ -192,7 +193,8 @@ def read_subsystem_config(root_path):
for path_k, path_v in part_info_valule.items(): for path_k, path_v in part_info_valule.items():
if path_k == "path": if path_k == "path":
part_json_paths.append(path_v) part_json_paths.append(path_v)
part_json_overlay_path = os.path.join(root_path, 'build/subsystem_config_overlay.json') conf = Config()
part_json_overlay_path = conf.product_path
if os.path.isfile(part_json_overlay_path): if os.path.isfile(part_json_overlay_path):
with open(part_json_overlay_path, 'r') as file: with open(part_json_overlay_path, 'r') as file:
file_json = json.load(file) file_json = json.load(file)
......
...@@ -58,7 +58,7 @@ class Config(metaclass=Singleton): ...@@ -58,7 +58,7 @@ class Config(metaclass=Singleton):
None) None)
self._subsystem_config_json = config_content.get( self._subsystem_config_json = config_content.get(
'subsystem_config_json', None) 'subsystem_config_json', None)
self._subsystem_config_overlay_json = 'build/subsystem_config_overlay.json' self._subsystem_config_overlay_json = self._product_path + '/subsystem_config_overlay.json'
self.fs_attr = set() self.fs_attr = set()
self.platform = platform.system() self.platform = platform.system()
......
...@@ -22,6 +22,7 @@ from datetime import datetime ...@@ -22,6 +22,7 @@ from datetime import datetime
from distutils.spawn import find_executable from distutils.spawn import find_executable
from hb_internal.common.utils import exec_command from hb_internal.common.utils import exec_command
from hb_internal.common.utils import hb_warning from hb_internal.common.utils import hb_warning
from hb_internal.common.config import Config
class PreBuild: class PreBuild:
...@@ -202,8 +203,8 @@ class PostBuild: ...@@ -202,8 +203,8 @@ class PostBuild:
exec_command(cmd, log_path=self._log_path) exec_command(cmd, log_path=self._log_path)
def compute_overlap_rate(self): def compute_overlap_rate(self):
subsystem_config_overlay_path = os.path.join(self._root_path, conf = Config()
'build/subsystem_config_overlay.json') subsystem_config_overlay_path = conf.product_path + '/subsystem_config_overlay.json'
if os.path.isfile(subsystem_config_overlay_path): if os.path.isfile(subsystem_config_overlay_path):
cmd = [ cmd = [
'python3', 'python3',
...@@ -212,7 +213,7 @@ class PostBuild: ...@@ -212,7 +213,7 @@ class PostBuild:
"--subsystem-config-file", "--subsystem-config-file",
"{}/build/subsystem_config.json".format(self._root_path), "{}/build/subsystem_config.json".format(self._root_path),
"--subsystem-config-overlay-file", "--subsystem-config-overlay-file",
"{}/build/subsystem_config_overlay.json".format(self._root_path), "{}/subsystem_config_overlay.json".format(conf.product_path),
"--root-source-dir", self._root_path "--root-source-dir", self._root_path
] ]
else: else:
......
...@@ -51,8 +51,7 @@ class Product(): ...@@ -51,8 +51,7 @@ class Product():
else: else:
product_path = p_config_path product_path = p_config_path
if product_name is not None: if product_name is not None:
subsystem_config_overlay_path = os.path.join(config.root_path, subsystem_config_overlay_path = config.product_path + '/subsystem_config_overlay.json'
'build/subsystem_config_overlay.json')
if os.path.isfile(subsystem_config_overlay_path): if os.path.isfile(subsystem_config_overlay_path):
yield { yield {
'company': company, 'company': company,
......
...@@ -499,8 +499,7 @@ class Dirs: ...@@ -499,8 +499,7 @@ class Dirs:
self.subsystem_config_json = os.path.join(config.root_path, self.subsystem_config_json = os.path.join(config.root_path,
config.subsystem_config_json) config.subsystem_config_json)
self.subsystem_config_overlay_json = os.path.join(config.root_path, self.subsystem_config_overlay_json = config.product_path + '/subsystem_config_overlay.json'
config.subsystem_config_overlay_json)
self.lite_components_dir = os.path.join(config.root_path, self.lite_components_dir = os.path.join(config.root_path,
'build/lite/components') 'build/lite/components')
...@@ -657,7 +656,7 @@ def main(argv): ...@@ -657,7 +656,7 @@ def main(argv):
required=True) required=True)
parser.add_argument('--subsystem-config-overlay-file', parser.add_argument('--subsystem-config-overlay-file',
dest='subsystem_config_overlay_json', dest='subsystem_config_overlay_json',
required=True) required=False)
args = parser.parse_args(argv) args = parser.parse_args(argv)
preloader = Preloader(args) preloader = Preloader(args)
......
...@@ -103,14 +103,13 @@ def set_product(product_name=None, company=None): ...@@ -103,14 +103,13 @@ def set_product(product_name=None, company=None):
else: else:
config.subsystem_config_json = 'build/subsystem_config.json' config.subsystem_config_json = 'build/subsystem_config.json'
subsystem_config_overlay_path = os.path.join(config.root_path, subsystem_config_overlay_path = config.product_path + '/subsystem_config_overlay.json'
'build/subsystem_config_overlay.json')
if os.path.isfile(subsystem_config_overlay_path): if os.path.isfile(subsystem_config_overlay_path):
if product_info.get('subsystem_config_overlay_json'): if product_info.get('subsystem_config_overlay_json'):
config.subsystem_config_overlay_json = product_info.get( config.subsystem_config_overlay_json = product_info.get(
'subsystem_config_overlay_json') 'subsystem_config_overlay_json')
else: else:
config.subsystem_config_overlay_json = 'build/subsystem_config_overlay.json' config.subsystem_config_overlay_json = subsystem_config_overlay_path
if config.version == '2.0': if config.version == '2.0':
config.device_path = board_path config.device_path = board_path
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册