• Home
  • Raw
  • Download

Lines Matching refs:self

34     def __init__(self):  argument
36 self.source_root_dir = ""
37 self.gn_root_out_dir = ""
38 self.os_level = ""
39 self.target_cpu = ""
40 self.target_os = ""
41 self.config_output_relpath = ""
42 self.config_output_dir = ""
43 self.target_arch = ""
44 self.subsystem_config_file = ""
45 self.subsystem_config_overlay_file = ""
46 self.platforms_config_file = ""
47 self.exclusion_modules_config_file = ""
48 self.example_subsystem_file = ""
49 self.build_example = ""
50 self.scalable_build = ""
51 self.build_platform_name = ""
52 self.build_xts = ""
53 self.ignore_api_check = ""
54 self.load_test_config = ""
55 self.subsystem_configs = ""
56 self._subsystem_info = ""
57 self.skip_partlist_check = ""
59 def __post_init__(self): argument
60 self.source_root_dir = self.config.root_path + '/'
61 self.gn_root_out_dir = self.config.out_path if not self.config.out_path.startswith(
62 '/') else os.path.relpath(self.config.out_path, self.config.root_path)
63 self.os_level = self.config.os_level if self.config.os_level else "standard"
64 self.target_cpu = self.config.target_cpu if self.config.target_cpu else "arm"
65 self.target_os = self.config.target_os if self.config.target_os else "ohos"
66 self.config_output_relpath = os.path.join(
67 self.gn_root_out_dir, 'build_configs')
68 self.config_output_dir = os.path.join(
69 self.source_root_dir, self.config_output_relpath)
70 self.target_arch = '{}_{}'.format(self.target_os, self.target_cpu)
71 self.subsystem_config_file = os.path.join(
72 self.config.root_path, 'out/preloader', self.config.product, 'subsystem_config.json')
73 self.platforms_config_file = os.path.join(
74 self.config.root_path, 'out/preloader', self.config.product, 'platforms.build')
75 self.exclusion_modules_config_file = os.path.join(
76 self.config.root_path, 'out/preloader', self.config.product, 'exclusion_modules.json')
77 self.example_subsystem_file = os.path.join(
78 self.config.root_path, 'build', 'subsystem_config_example.json')
81self.config.root_path, 'out/preloader', self.config.product, 'compile_standard_whitelist.json')
86 self._check_args()
88 self.build_example = self.args_dict.get('build_example')
89 if not self.build_example:
90 self.example_subsystem_file = ""
91 self.scalable_build = self.args_dict.get('scalable_build')
92 self.build_platform_name = self.args_dict.get('build_platform_name')
93 self.build_xts = self.args_dict.get('build_xts')
94 self.ignore_api_check = self.args_dict.get('ignore_api_check')
95 self.load_test_config = self.args_dict.get('load_test_config')
96 self.skip_partlist_check = self.args_dict.get('skip_partlist_check')
98 self._subsystem_info = subsystem_info.get_subsystem_info(
99 self.subsystem_config_file,
100 self.example_subsystem_file,
101 self.source_root_dir,
102 self.config_output_relpath,
103 self.os_level)
104 overrided_components = self._override_components()
106 self._platforms_info = platforms_loader.get_platforms_info(
107 self.platforms_config_file,
108 self.source_root_dir,
109 self.gn_root_out_dir,
110 self.target_arch,
111 self.config_output_relpath,
112 self.scalable_build)
113 self.variant_toolchains = self._platforms_info.get(
115 self._all_platforms = self.variant_toolchains.keys()
116 self.build_platforms = self._get_build_platforms()
117 self.parts_config_info = load_ohos_build.get_parts_info(
118 self.source_root_dir,
119 self.config_output_relpath,
120 self._subsystem_info,
121 self.variant_toolchains,
122 self.target_arch,
123 self.ignore_api_check,
124 self.exclusion_modules_config_file,
125 self.load_test_config,
128 self.skip_partlist_check,
129 self.build_xts)
130 self.parts_targets = self.parts_config_info.get('parts_targets')
131 self.phony_targets = self.parts_config_info.get('phony_target')
132 self.parts_info = self.parts_config_info.get('parts_info')
133 self.target_platform_parts = self._get_platforms_all_parts()
134 self.target_platform_stubs = self._get_platforms_all_stubs()
135 self.required_parts_targets_list = self._get_required_build_parts_list()
136 self.required_phony_targets = self._get_required_phony_targets()
137 self.required_parts_targets = self._get_required_build_targets()
148 def _check_args(self): argument
151 if not read_json_file(self.subsystem_config_file):
152 self.subsystem_config_file = os.path.join(
153 self.source_root_dir, 'build/subsystem_config.json')
154 if not read_json_file(self.subsystem_config_file):
160 if not self.gn_root_out_dir:
162 if not os.path.realpath(self.gn_root_out_dir).startswith(self.source_root_dir):
166 if not read_json_file(self.platforms_config_file):
172 if not read_json_file(self.example_subsystem_file):
177 def _check_product_part_feature(self): argument
179 product_preloader_dir = os.path.dirname(self.platforms_config_file)
185 part = self.parts_info.get(key)
200 def _check_parts_config_info(self): argument
202 if not ('parts_info' in self.parts_config_info
203 and 'subsystem_parts' in self.parts_config_info
204 and 'parts_variants' in self.parts_config_info
205 and 'parts_kits_info' in self.parts_config_info
206 and 'parts_inner_kits_info' in self.parts_config_info
207 and 'parts_targets' in self.parts_config_info):
221 def _generate_syscap_files(self): argument
222 pre_syscap_info_path = os.path.dirname(self.platforms_config_file)
223 system_path = os.path.join(self.source_root_dir, os.path.join(
224 os.path.dirname(self.platforms_config_file), "system/"))
227 syscap_info_list = self.parts_config_info.get('syscap_info')
233 if syscap['component'] not in self.required_parts_targets_list:
250 if syscap['component'] not in self.required_parts_targets_list:
305 "generate syscap info file to '{}'".format(syscap_info_json), mode=self.config.log_mode)
313 syscap_info_with_part_name_file), mode=self.config.log_mode)
321 target_syscap_for_init_file), mode=self.config.log_mode)
329 def _generate_infos_for_testfwk(self): argument
330 infos_for_testfwk_file = os.path.join(self.config_output_dir,
332 parts_info = self.parts_config_info.get('parts_info')
338 for _platform, _parts in self.target_platform_parts.items():
339 result = self._output_infos_by_platform(_parts, parts_info_dict)
344 infos_for_testfwk_file), mode=self.config.log_mode)
352 def _generate_target_platform_parts(self): argument
353 target_platform_parts_file = os.path.join(self.config_output_dir,
356 self.target_platform_parts,
359 target_platform_parts_file), mode=self.config.log_mode)
367 def _generate_part_different_info(self): argument
368 parts_different_info = self._get_parts_by_platform()
369 parts_different_info_file = os.path.join(self.config_output_dir,
375 parts_different_info_file), mode=self.config.log_mode)
383 def _generate_platforms_list(self): argument
384 platforms_list_gni_file = os.path.join(self.config_output_dir,
386 _platforms = set(self.build_platforms)
389 if 'phone' not in self.build_platforms:
394 platforms_list_gni_file), mode=self.config.log_mode)
402 def _generate_auto_install_part(self): argument
403 parts_path_info = self.parts_config_info.get("parts_path_info")
410 self.config_output_dir, "auto_install_parts.json")
413 auto_install_list_file), mode=self.config.log_mode)
421 def _generate_src_flag(self): argument
422 parts_src_flag_file = os.path.join(self.config_output_dir,
425 self._get_parts_src_list(),
429 self.config_output_dir), mode=self.config.log_mode)
437 def _generate_required_parts_targets_list(self): argument
438 build_targets_list_file = os.path.join(self.config_output_dir,
441 list(self.required_parts_targets.values()))
443 build_targets_list_file), mode=self.config.log_mode)
451 def _generate_required_parts_targets(self): argument
452 build_targets_info_file = os.path.join(self.config_output_dir,
454 write_json_file(build_targets_info_file, self.required_parts_targets)
456 build_targets_info_file), mode=self.config.log_mode)
464 def _generate_platforms_part_by_src(self): argument
465 platforms_parts_by_src = self._get_platforms_parts()
466 platforms_parts_by_src_file = os.path.join(self.source_root_dir,
467 self.config_output_relpath,
473 platforms_parts_by_src_file), mode=self.config.log_mode)
485 def _generate_target_gn(self): argument
486 generate_targets_gn.gen_targets_gn(self.required_parts_targets,
487 self.config_output_dir)
495 def _generate_phony_targets_build_file(self): argument
496 generate_targets_gn.gen_phony_targets(self.required_phony_targets,
497 self.config_output_dir)
506 def _generate_stub_targets(self): argument
508 self.parts_config_info.get('parts_kits_info'),
509 self.target_platform_stubs,
510 self.config_output_dir)
518 def _generate_system_capabilities(self): argument
519 for platform in self.build_platforms:
520 platform_parts = self.target_platform_parts.get(platform)
524 all_parts_variants = self.parts_info.get(origin)
533 self.config_output_dir, "{0}_system_capabilities.json".format(platform))
539 self.config_output_dir, platform), mode=self.config.log_mode)
549 def _generate_subsystem_configs(self): argument
554 self.config_output_dir), mode=self.config.log_mode)
557 self.config_output_dir), mode=self.config.log_mode)
560 self.config_output_dir), mode=self.config.log_mode)
564 def _get_build_platforms(self) -> list: argument
566 if self.build_platform_name == 'all':
567 build_platforms = self._all_platforms
568 elif self.build_platform_name in self._all_platforms:
569 build_platforms = [self.build_platform_name]
573 ', '.join(self._all_platforms)), "2010")
576 def _get_parts_by_platform(self) -> dict: argument
578 if 'phone' in self.target_platform_parts:
579 phone_parts_list = self.target_platform_parts.get('phone').keys()
582 for _platform, _parts_info in self.target_platform_parts.items():
599 def _get_platforms_all_parts(self) -> dict: argument
600 _dist_parts_variants = self._load_component_dist()
602 all_parts = self._platforms_info.get('all_parts')
603 parts_variants = self.parts_config_info.get('parts_variants')
605 if _platform not in self.build_platforms:
609 real_name, original_name = self._get_real_part_name(
613 real_name, original_name = self._get_real_part_name(
621 def _get_platforms_all_stubs(self) -> dict: argument
622 _dist_parts_variants = self._load_component_dist()
624 all_stubs = self._platforms_info.get('all_stubs')
625 parts_variants = self.parts_config_info.get('parts_variants')
627 if _platform not in self.build_platforms:
632 real_name, original_name = self._get_real_part_name(
638 real_name, original_name = self._get_real_part_name(
644 self.source_root_dir,
646 .format(self.target_os, self.target_cpu, real_name))
657 def _get_platforms_parts(self) -> dict: argument
659 src_parts_targets = self.parts_targets
661 for _platform, _all_parts in self.target_platform_parts.items():
676 def _get_parts_src_list(self) -> list: argument
678 for _list in self.parts_info.values():
683 for _name in self.required_parts_targets.keys():
690 def _get_required_build_targets(self) -> dict: argument
692 for _p_name, _info in self.parts_targets.items():
693 if _p_name not in self.required_parts_targets_list:
698 def _get_required_phony_targets(self) -> dict: argument
700 for _p_name, _info in self.phony_targets.items():
701 if _p_name not in self.required_parts_targets_list:
706 def _get_required_build_parts_list(self) -> list: argument
708 for _parts_list in self.target_platform_parts.values():
714 def _load_component_dist(self) -> dict: argument
717 self.target_os, self.target_cpu)
720 self.source_root_dir, _dir, _file_name)
739 …def _get_real_part_name(self, original_part_name: str, current_platform: str, parts_variants: dict… argument
754 def _output_infos_by_platform(self, part_name_infos: dict, parts_info_dict: dict): argument
776 def _execute_loader_args_display(self): argument
780 self.platforms_config_file))
782 self.subsystem_config_file))
784 self.example_subsystem_file))
786 self.exclusion_modules_config_file))
787 args.append('source_root_dir="{}"'.format(self.source_root_dir))
788 args.append('gn_root_out_dir="{}"'.format(self.gn_root_out_dir))
789 args.append('build_platform_name={}'.format(self.build_platform_name))
790 args.append('build_xts={}'.format(self.build_xts))
791 args.append('load_test_config={}'.format(self.load_test_config))
792 args.append('target_os={}'.format(self.target_os))
793 args.append('target_cpu={}'.format(self.target_cpu))
794 args.append('os_level={}'.format(self.os_level))
795 args.append('ignore_api_check={}'.format(self.ignore_api_check))
796 args.append('scalable_build={}'.format(self.scalable_build))
797 args.append('skip_partlist_check={}'.format(self.skip_partlist_check))
798 LogUtil.write_log(self.config.log_path,
801 def _override_components(self): argument
808 parts_file = self.platforms_config_file.replace(
819 for subsystem_name, build_config_info in self._subsystem_info.items():
831 if (not build_file.startswith(self.source_root_dir + 'device/')) \
832 and (not build_file.startswith(self.source_root_dir + 'vendor/')):
847 …if self._override_one_component(self._subsystem_info, component, build_file, all_parts, overrided_…
853 parts_file = self.platforms_config_file.replace(
855 self._output_parts_config_json(all_parts, parts_file)
861 …def _override_one_component(self, subsystem_info: dict, component: dict, build_file: str, all_part… argument
916 def _output_parts_config_json(self, all_parts: dict, output_file: dict): argument