提交 6d4eb9fc 编写于 作者: O openharmony_ci 提交者: Gitee

!328 support bundle.json in lite system

Merge pull request !328 from weichaox/bundle_json
......@@ -13,11 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import sys
import json
import os
from hb_internal.common.utils import read_json_file
def _read_lite_component_configs(file):
subsytem_name = os.path.basename(file)[:-5]
......@@ -54,8 +54,8 @@ def _save_as_ohos_build(config, ohos_build):
def parse_lite_subsystem_config(lite_components_dir, output_dir,
source_root_dir):
subsystem_infos = {}
source_root_dir, subsystem_config_file):
subsystem_infos = read_json_file(subsystem_config_file)
for root, _, files in os.walk(lite_components_dir):
for file in files:
if file[-5:] == '.json':
......@@ -74,18 +74,3 @@ def parse_lite_subsystem_config(lite_components_dir, output_dir,
source_root_dir),
}
return subsystem_infos
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--output-dir', required=True)
parser.add_argument('--source-root-dir', required=True)
parser.add_argument('--subsystem-config-file', required=True)
parser.add_argument('--lite-components-dir', required=True)
options = parser.parse_args()
parse_lite_subsystem_config(options.lite_components_dir,
options.output_dir, options.source_root_dir)
if __name__ == '__main__':
sys.exit(main())
......@@ -80,7 +80,7 @@ def _get_org_subsytem_info(subsystem_config_file, os_level, config_dirs):
'{}_system'.format(os_level))
subsystem_info = parse_lite_subsystem_config(
config_dirs.lite_components_dir, ohos_build_output_dir,
config_dirs.source_root_dir)
config_dirs.source_root_dir, subsystem_config_file)
return subsystem_info
......@@ -142,6 +142,7 @@ def _output_parts_json(all_parts, output_file):
class MyProduct():
def __init__(self, product_name, config_dirs, config_json):
self._name = product_name
self._dirs = config_dirs
......@@ -329,6 +330,7 @@ class MyProduct():
class MyDevice():
def __init__(self, device_name, config_dirs, device_info=None):
self._name = device_name
self._dirs = config_dirs
......@@ -370,6 +372,7 @@ class MyDevice():
@dataclass
class Dirs:
def __init__(self, config):
self.__post_init__(config)
......@@ -400,6 +403,7 @@ class Dirs:
@dataclass
class Outputs:
def __init__(self, output_dir):
self.__post_init__(output_dir)
......@@ -415,6 +419,7 @@ class Outputs:
class Preloader():
def __init__(self, config):
# All kinds of directories and subsystem_config_json
self._dirs = Dirs(config)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册