Lines Matching refs:self
27 def __init__(self, output_dir): argument
28 self.__post_init__(output_dir)
30 def __post_init__(self, output_dir): argument
32 self.build_prop = os.path.join(output_dir, 'build.prop')
33 self.build_config_json = os.path.join(output_dir, 'build_config.json')
34 self.parts_json = os.path.join(output_dir, 'parts.json')
35 self.parts_config_json = os.path.join(output_dir, 'parts_config.json')
36 self.build_gnargs_prop = os.path.join(output_dir, 'build_gnargs.prop')
37 self.features_json = os.path.join(output_dir, 'features.json')
38 self.syscap_json = os.path.join(output_dir, 'syscap.json')
39 self.exclusion_modules_json = os.path.join(output_dir,
41 self.subsystem_config_json = os.path.join(output_dir,
43 self.subsystem_config_overlay_json = os.path.join(output_dir,
45 self.platforms_build = os.path.join(output_dir, 'platforms.build')
46 self.systemcapability_json = os.path.join(
48 … self.compile_standard_whitelist_json = os.path.join(output_dir, 'compile_standard_whitelist.json')
49 self.compile_env_allowlist_json = os.path.join(output_dir, 'compile_env_allowlist.json')
54 def __init__(self, config): argument
55 self.__post_init__(config)
57 def __post_init__(self, config): argument
58 self.source_root_dir = config.root_path
59 self.built_in_product_dir = config.built_in_product_path
60 self.productdefine_dir = os.path.join(
61 self.source_root_dir, 'productdefine/common')
62 self.built_in_base_dir = os.path.join(self.productdefine_dir, 'base')
65 self.vendor_dir = config.vendor_path
67 self.device_dir = os.path.join(config.root_path, 'device')
69 self.subsystem_config_json = os.path.join(
71 self.subsystem_config_overlay_json = os.path.join(config.product_path,
73 self.lite_components_dir = os.path.join(
76 self.preloader_output_dir = os.path.join(
82 def __init__(self, config_dirs: Dirs, ohos_config: Config): argument
83 self._ohos_config = None
84 self._dirs = None
85 self._name = ""
86 self._config = {}
87 self._build_vars = {}
88 self._parts = {}
89 self._syscap_info = {}
90 self._device_name = ""
91 self._device_info = {}
92 self._config_file = ""
93 self._version = ''
94 self.__post_init__(config_dirs, ohos_config)
96 def __post_init__(self, config_dirs: Dirs, config: Config): argument
97 self._ohos_config = config
98 self._dirs = config_dirs
99 self._name = config.product
100 self._config_file = config.product_json
101 self._config = self._get_full_product_config()
102 self._version = self._config.get('version', '3.0')
103 self._do_parse()
106 def _do_parse(self): argument
107 self._update_syscap_info()
108 self._update_device()
109 self._update_parts()
110 self._update_build_vars()
111 self._remove_excluded_components()
116 def _update_syscap_info(self): argument
117 product_name = self._config.get('product_name')
120 os_level = self._config.get('type')
123 api_version = self._config.get('api_version')
126 manufacturer_id = self._config.get('manufacturer_id')
129 self._syscap_info = {'product': product_name, 'api_version': api_version,
133 def _update_device(self): argument
134 if self._version == "2.0":
135 device_name = self._config.get('product_device')
137 self._device_name = device_name
138 self._device_info = self._get_device_info_v2(
139 device_name, self._dirs.built_in_device_dir)
141 device_name = self._config.get('board')
143 self._device_name = device_name
144 self._device_info = self._get_device_info_v3(self._config)
145 if self._ohos_config.target_cpu:
146 self._device_info["target_cpu"] = self._ohos_config.target_cpu
147 if self._ohos_config.target_os:
148 self._device_info["target_os"] = self._ohos_config.target_os
149 if self._ohos_config.compile_config:
150 self._device_info[self._ohos_config["compile_config"]] = True
153 def _update_parts(self): argument
154 if self._version == "1.0":
156 self._parts = _parts
159 if self._version == "2.0":
160 os_level = self._config.get("type", "standard")
162 os_level = self._config.get("type", "mini")
164 based_on_mininum_system = self._config.get(
167 self._parts = self._get_base_parts(
168 self._dirs.built_in_base_dir, os_level)
170 inherit = self._config.get('inherit')
172 self._parts.update(
173 self._get_inherit_parts(inherit, self._dirs.source_root_dir))
176 sys_info_path = self._config.get('system_component')
178 sys_parts = self._get_sys_relate_parts(
179 sys_info_path, self._parts, self._dirs.source_root_dir)
180 self._parts.update(sys_parts)
182 if self._version == "2.0":
183 current_product_parts = self._config.get("parts")
187 all_parts.update(get_vendor_parts_list(self._config))
188 all_parts.update(self._get_product_specific_parts())
190 device_name = self._config.get('board')
192 all_parts.update(self._get_device_specific_parts())
193 self._parts.update(all_parts)
196 def _update_build_vars(self): argument
197 config = self._config
199 if self._version == "1.0":
202 if self._version == "2.0":
216 elif os.path.dirname(self._config_file) != self._dirs.built_in_product_dir:
218 self._config_file, self._dirs.vendor_dir)
226 self._dirs.source_root_dir, config.get('ext_root_proc_conf_path'))
231 self._dirs.source_root_dir, config.get('ext_critical_proc_conf_path'))
236 self._dirs.source_root_dir, config.get('ext_sanitizer_check_list_path'))
240 self._dirs.source_root_dir, "out/products_ext", "global_ext_var_file.gni")
255 self._dirs.source_root_dir, config.get('chipprod_config_path'))
260 self._dirs.source_root_dir, config.get('ext_sdk_config_file'))
265 self._dirs.source_root_dir, config.get('ext_ndk_config_file'))
270 self._dirs.source_root_dir, config.get('ext_sign_hap_py_path'))
274 build_vars.update(self._device_info)
279 self._device_info.get('target_os'), self._device_info.get('target_cpu'))
281 self._build_vars = build_vars
284 def _remove_excluded_components(self): argument
286 for part, val in self._parts.items():
290 del self._parts[item]
295 def _get_device_info_v2(self, device_name, config_dir) -> dict: argument
305 def _get_device_info_v3(self, config) -> dict: argument
329 device_build_path = os.path.join(self._dirs.device_dir,
333 device_build_path = os.path.join(self._dirs.device_dir,
340 def _get_device_specific_parts(self) -> dict: argument
342 if self._device_info and self._device_info.get('device_build_path'):
343 subsystem_name = 'device_{}'.format(self._device_name)
348 def _get_device_specific_subsystem(self) -> dict: argument
350 subsystem_name = 'device_{}'.format(self._device_name)
351 if self._device_info and self._device_info.get('device_build_path'):
354 'path': self._device_info.get('device_build_path')
358 def _get_base_parts(self, base_config_dir, os_level) -> dict: argument
366 def _get_inherit_parts(self, inherit, source_root_dir) -> dict: argument
378 def _get_sys_relate_parts(self, system_component_info, _parts, source_root_dir) -> dict: argument
390 def _get_product_specific_parts(self) -> dict: argument
391 part_name = 'product_{}'.format(self._name)
397 def _get_product_specific_subsystem(self) -> dict: argument
399 subsystem_name = 'product_{}'.format(self._name)
400 product_build_path = self._config.get('product_build_path')
408 def _get_full_product_config(self) -> dict: argument
409 config = IoUtil.read_json_file(self._config_file)
411 if os.path.dirname(self._config_file) != self._dirs.built_in_product_dir \
412 and not hasattr(self._config, 'product_build_path'):
414 os.path.dirname(self._config_file), self._dirs.source_root_dir)