• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/config/python.gni")
15import("//build/ohos/sa_profile/sa_profile.gni")
16
17import("//build/ohos.gni")
18import("//build/ohos/build_var.gni")
19import("//build/ohos_var.gni")
20
21import("//build/ohos/hisysevent/hisysevent.gni")
22
23# import target_platform_list
24import("${build_configs_path}/platforms_list.gni")
25yml_file = rebase_path(product_path) + "/fs.yml"
26is_exist_yml_file = exec_script(rebase_path("//build/ohos/file_exists.py"),
27                                [
28                                  "--filename",
29                                  yml_file,
30                                  "--type",
31                                  "file",
32                                ],
33                                "string")
34
35group("make_packages") {
36  deps = []
37  foreach(_platform, target_platform_list) {
38    if (is_standard_system && !skip_gen_module_info) {
39      # Lite system uses different packaging scheme, which is called in hb.
40      # So skip install_modules for lite system since it's the packaging
41      # action of standard system.
42
43      deps += [ ":${_platform}_install_modules" ]
44    }
45    if (!skip_gen_module_info) {
46      deps += [ ":gen_required_modules_${_platform}" ]
47    }
48    deps += [ ":${_platform}_parts_list" ]
49    if (!is_standard_system) {
50      deps += [ ":merge_system_notice_file_${_platform}" ]
51    }
52  }
53  if (make_osp) {
54    deps += [ ":open_source_package" ]
55  }
56}
57
58action("packer") {
59  script = rebase_path("//build/ohos/packages/fs_process.py")
60  if (is_exist_yml_file == "True") {
61    inputs = [ yml_file ]
62  }
63  outputs = [ "${root_build_dir}/result.txt" ]
64  deps = [ ":make_packages" ]
65  args = [
66    "--product",
67    product_name,
68    "--root-path",
69    rebase_path("//"),
70    "--out-path",
71    rebase_path(root_build_dir),
72    "--log-path",
73    rebase_path("${root_build_dir}/build.log"),
74    "--product-path",
75    rebase_path(product_path),
76  ]
77}
78
79all_parts_host_info_file = "${root_build_dir}/all_parts_host.json"
80all_host_symlink_file = "${root_build_dir}/all_host_symlink.json"
81
82action("generate_host_symlink") {
83  script = "//build/ohos/packages/generate_host_symlink.py"
84  inputs = [ all_parts_host_info_file ]
85  outputs = [ all_host_symlink_file ]
86  deps = [ "//build/ohos/common:generate_host_info" ]
87  args = [
88    "--all-parts-host-info-file",
89    rebase_path(all_parts_host_info_file),
90    "--output-file",
91    rebase_path(all_host_symlink_file),
92    "--root-build-dir",
93    rebase_path(root_build_dir),
94  ]
95}
96
97all_parts_info_file = "${root_build_dir}/all_parts_info.json"
98all_platforms_parts =
99    "${root_build_dir}/build_configs/target_platforms_parts.json"
100
101foreach(_platform, target_platform_list) {
102  current_platform = _platform
103  current_platform_dir = "${product_output_dir}/$current_platform"
104
105  _system_install_info_file =
106      "${current_platform_dir}/system_install_parts.json"
107
108  action_with_pydeps("${current_platform}_parts_list") {
109    script = "//build/ohos/packages/parts_install_info.py"
110    deps = [ "//build/ohos/common:merge_all_parts" ]
111    inputs = [ all_parts_info_file ]
112    outputs = [ _system_install_info_file ]
113    depfile = "$target_gen_dir/$target_name.d"
114    args = [
115      "--depfile",
116      rebase_path(depfile, root_build_dir),
117      "--all-parts-info-file",
118      rebase_path(all_parts_info_file, root_build_dir),
119      "--platforms-parts-file",
120      rebase_path(all_platforms_parts, root_build_dir),
121      "--system-install-info-file",
122      rebase_path(_system_install_info_file, root_build_dir),
123      "--current-platform",
124      current_platform,
125      "--root-code-dir",
126      rebase_path("//"),
127      "--root-build-dir",
128      root_build_dir,
129    ]
130  }
131
132  post_process_modules_list = []
133
134  # sa profile install
135  sa_install_modules_info_file =
136      "${current_platform_dir}/sa_profile/sa_install_info.json"
137  _merged_sa_profile_zipfile =
138      "${current_platform_dir}/sa_profile/merged_sa_profile.zip"
139  _merged_sa_profile_dir = "${current_platform_dir}/sa_profile/merged_sa"
140  ohos_sa_install_info("${current_platform}_sa_profile_install_info") {
141    deps = [ ":${current_platform}_parts_list" ]
142    _outputs = get_target_outputs(":${current_platform}_parts_list")
143    system_install_info_file = _outputs[0]
144    sa_install_info_file = sa_install_modules_info_file
145    merged_sa_profile_zipfile = _merged_sa_profile_zipfile
146    merged_sa_profile_dir = _merged_sa_profile_dir
147  }
148
149  # all post process moudles info
150  post_process_modules_list += [ sa_install_modules_info_file ]
151
152  hisysevent_install_info_file =
153      "${current_platform_dir}/hisysevent/hisysevent_install_info.json"
154  ohos_hisysevent_install_info("${current_platform}_hisysevent_install_info") {
155    deps = [ ":${current_platform}_parts_list" ]
156    _outputs = get_target_outputs(":${current_platform}_parts_list")
157    system_install_info_file = _outputs[0]
158  }
159  post_process_modules_list += [ hisysevent_install_info_file ]
160
161  _notice_root_dir = "${current_platform_dir}/NOTICE_FILES"
162  _collected_notice_zipfile = "${current_platform_dir}/system_notice_files.zip"
163
164  action_with_pydeps("collect_notice_files__${_platform}") {
165    deps = [ ":${_platform}_parts_list" ]
166    script = "//build/ohos/notice/collect_system_notice_files.py"
167    depfile = "$target_gen_dir/$target_name.d"
168    sources = [ _system_install_info_file ]
169    outputs = [ _collected_notice_zipfile ]
170    args = [
171      "--install-info-file",
172      rebase_path(_system_install_info_file, root_build_dir),
173      "--output-file",
174      rebase_path(_collected_notice_zipfile, root_build_dir),
175      "--depfile",
176      rebase_path(depfile, root_build_dir),
177      "--notice-root-dir",
178      rebase_path(_notice_root_dir, root_build_dir),
179    ]
180  }
181
182  _merged_notice_txt = "${current_platform_dir}/NOTICE.txt"
183  _notice_module_info_file = "${current_platform_dir}/NOTICE_module_info.json"
184  action_with_pydeps("merge_system_notice_file_${current_platform}") {
185    deps = [ ":collect_notice_files__${current_platform}" ]
186    script = "//build/ohos/notice/merge_notice_files.py"
187    depfile = "$target_gen_dir/$target_name.d"
188
189    _merged_notice_gz = "${current_platform_dir}/NOTICE.xml.gz"
190    inputs = [ _collected_notice_zipfile ]
191    outputs = [
192      _merged_notice_txt,
193      _merged_notice_gz,
194      _notice_module_info_file,
195    ]
196    args = [ "--image-name" ]
197
198    if (is_lite_system) {
199      args += [ "lite" ]
200    } else {
201      args += [ "system" ]
202    }
203
204    args += [ "--notice-root-dir" ]
205
206    if (is_lite_system) {
207      _lite_notice_root_dir = "${root_build_dir}/NOTICE_FILES"
208      args += [ rebase_path(_lite_notice_root_dir, root_build_dir) ]
209    } else {
210      args += [ rebase_path(_notice_root_dir, root_build_dir) ]
211    }
212
213    args += [
214      "--output-notice-txt",
215      rebase_path(_merged_notice_txt, root_out_dir),
216      "--output-notice-gz",
217      rebase_path(_merged_notice_gz, root_out_dir),
218      "--notice-title",
219      "Notices for files contained in the system filesystem image in this directory:",
220      "--static-library-notice-dir",
221    ]
222
223    if (is_lite_system) {
224      args += [ rebase_path(lite_libraries_notice_dir, root_build_dir) ]
225    } else {
226      args += [ rebase_path(static_libraries_notice_dir, root_build_dir) ]
227    }
228
229    args += [
230      "--target-cpu",
231      target_cpu,
232      "--depfile",
233      rebase_path(depfile, root_build_dir),
234      "--collected-notice-zipfile",
235      rebase_path(_collected_notice_zipfile, root_build_dir),
236      "--notice-module-info",
237      rebase_path(_notice_module_info_file, root_build_dir),
238      "--notice-install-dir",
239    ]
240    if (is_system_component) {
241      args += [ "system/etc" ]
242    } else {
243      args += [ "vendor/etc" ]
244    }
245    if (is_lite_system) {
246      args += [
247        "--lite-product",
248        "true",
249      ]
250    }
251  }
252  post_process_modules_list += [ _notice_module_info_file ]
253
254  action("verify_notice_file_${current_platform}") {
255    deps = [ ":merge_system_notice_file_${current_platform}" ]
256    script = "//build/lite/run_shell_cmd.py"
257    _verify_result = "${current_platform_dir}/notice_verify_result.out"
258
259    inputs = [ _merged_notice_txt ]
260    outputs = [ _verify_result ]
261
262    args = [
263      "/bin/bash",
264      rebase_path("//build/core/build_scripts/verify_notice.sh",
265                  root_build_dir),
266      rebase_path(_merged_notice_txt, root_build_dir),
267      rebase_path(_verify_result, root_build_dir),
268      rebase_path(current_platform_dir, root_build_dir),
269    ]
270  }
271
272  system_install_modules = "${current_platform_dir}/system_install_modules.json"
273  system_module_info_list = "${current_platform_dir}/system_module_info.json"
274  system_modules_list = "${current_platform_dir}/system_modules_list.txt"
275  _system_image_zipfile = "${current_platform_dir}/system.zip"
276  _host_toolchain = "$host_toolchain"
277
278  action_with_pydeps("${_platform}_install_modules") {
279    script = "//build/ohos/packages/modules_install.py"
280    public_deps = [ ":${current_platform}_parts_list" ]
281    depfile = "$target_gen_dir/$target_name.d"
282    deps = [
283      ":${current_platform}_hisysevent_install_info",
284      ":${current_platform}_sa_profile_install_info",
285      ":generate_host_symlink",
286      ":merge_system_notice_file_${current_platform}",
287      ":verify_notice_file_${current_platform}",
288    ]
289
290    sources = [
291      _merged_sa_profile_zipfile,
292      _system_install_info_file,
293    ]
294
295    outputs = [
296      system_install_modules,
297      system_module_info_list,
298      system_modules_list,
299      _system_image_zipfile,
300    ]
301
302    args = [
303      "--system-install-info-file",
304      rebase_path(_system_install_info_file, root_build_dir),
305      "--install-modules-info-file",
306      rebase_path(system_install_modules, root_build_dir),
307      "--modules-info-file",
308      rebase_path(system_module_info_list, root_build_dir),
309      "--modules-list-file",
310      rebase_path(system_modules_list, root_build_dir),
311      "--platform-installed-path",
312      rebase_path(current_platform_dir, root_build_dir),
313      "--depfile",
314      rebase_path(depfile, root_build_dir),
315      "--sa-profile-extract-dir",
316      rebase_path(_merged_sa_profile_dir, root_build_dir),
317      "--merged-sa-profile",
318      rebase_path(_merged_sa_profile_zipfile, root_build_dir),
319      "--system-dir",
320      rebase_path("$current_platform_dir/system", root_build_dir),
321      "--system-image-zipfile",
322      rebase_path(_system_image_zipfile, root_build_dir),
323      "--host-toolchain",
324      _host_toolchain,
325    ]
326
327    _additional_system_files = []
328    foreach(tuple, _additional_system_files) {
329      args += [
330        "--additional-system-files",
331        rebase_path(tuple[0], root_build_dir) + ":" + tuple[1],
332      ]
333    }
334
335    if (post_process_modules_list != []) {
336      sources += post_process_modules_list
337      args += [ "--post-process-modules-info-files" ]
338      args += rebase_path(post_process_modules_list, root_build_dir)
339    }
340
341    args += [ "--categorized-libraries" ]
342    args +=
343        [ rebase_path("//build/ohos/packages/rules/categorized-libraries.json",
344                      root_build_dir) ]
345  }
346
347  action("check_seccomp_filter_name") {
348    script = "//build/ohos/packages/check_seccomp_library_name.py"
349    deps = [ ":${_platform}_install_modules" ]
350
351    # result is not used in script
352    process_validate_result =
353        "${current_platform_dir}/check_seccomp_filter_name.txt"
354    _system_cfg_folder = "${current_platform_dir}/system/etc/init"
355    if (target_cpu == "arm" || target_cpu == "x86") {
356      libdir = "lib"
357    } else if (target_cpu == "arm64" || target_cpu == "x86_64") {
358      libdir = "lib64"
359    } else {
360      libdir = "lib"
361    }
362    _system_seccomp_folder = "${current_platform_dir}/system/${libdir}/seccomp"
363
364    _vendor_cfg_folder = "${current_platform_dir}/vendor/etc/init"
365    _vendor_seccomp_folder = "${current_platform_dir}/vendor/${libdir}/seccomp"
366
367    outputs = [ process_validate_result ]
368
369    args = [
370      "--vendor-cfg-path",
371      rebase_path(_vendor_cfg_folder, root_build_dir),
372      "--vendor-seccomp-lib-path",
373      rebase_path(_vendor_seccomp_folder, root_build_dir),
374      "--system-cfg-path",
375      rebase_path(_system_cfg_folder, root_build_dir),
376      "--system-seccomp-lib-path",
377      rebase_path(_system_seccomp_folder, root_build_dir),
378    ]
379  }
380
381  action("process_field_validate") {
382    script = "//build/ohos/packages/process_field_validate.py"
383
384    deps = [ ":${_platform}_install_modules" ]
385
386    # result is not used in script
387    process_validate_result = "${current_platform_dir}/cfg_validate_result.txt"
388
389    # ext_root_proc_conf_path defined in config.json in vendor warehouse
390    if (ext_root_proc_conf_path != "") {
391      _privilege_whitelist = ext_root_proc_conf_path
392    } else {
393      _privilege_whitelist = "//vendor/${product_company}/${product_name}/security_config/high_privilege_process_list.json"
394    }
395
396    # ext_critical_proc_conf_path defined in config.json in vendor warehouse
397    if (ext_critical_proc_conf_path != "") {
398      _critical_whitelist = ext_critical_proc_conf_path
399    } else {
400      _critical_whitelist = "//vendor/${product_company}/${product_name}/security_config/critical_reboot_process_list.json"
401    }
402    _system_cfg_folder = "${current_platform_dir}/system/etc/init"
403
404    _vendor_cfg_folder = "${current_platform_dir}/vendor/etc/init"
405
406    outputs = [ process_validate_result ]
407
408    args = [
409      "--sys-cfg-folder",
410      rebase_path(_system_cfg_folder, root_build_dir),
411      "--vendor-cfg-folder",
412      rebase_path(_vendor_cfg_folder, root_build_dir),
413      "--high-privilege-process-list-path",
414      rebase_path(_privilege_whitelist, root_build_dir),
415      "--critical-reboot-process-list-path",
416      rebase_path(_critical_whitelist, root_build_dir),
417    ]
418  }
419}
420
421# required_install_module_list.json
422foreach(_platform, target_platform_list) {
423  current_platform_dir = "${product_output_dir}/$_platform"
424  _system_install_info_file =
425      "${current_platform_dir}/system_install_parts.json"
426  required_install_modules_file =
427      "${current_platform_dir}/required_install_module_list.json"
428  action_with_pydeps("gen_required_modules_${_platform}") {
429    deps = [ ":${_platform}_parts_list" ]
430    script = "//build/ohos/packages/gen_required_modules_list.py"
431    inputs = [ _system_install_info_file ]
432    outputs = [ required_install_modules_file ]
433    depfile = "$target_gen_dir/$target_name.d"
434    args = [
435      "--system-installed-info-file",
436      rebase_path(_system_install_info_file, root_out_dir),
437      "--required-install-modules-file",
438      rebase_path(required_install_modules_file, root_out_dir),
439      "--depfile",
440      rebase_path(depfile, root_build_dir),
441    ]
442  }
443}
444
445if (is_asan || is_tsan) {
446  foreach(_platform, target_platform_list) {
447    action("restore_first_stage_artifact_${_platform}") {
448      current_platform = _platform
449      current_platform_dir = "${product_output_dir}/$current_platform"
450      deps = [ ":${_platform}_install_modules" ]
451      print("restore_first_stage_artifact_${_platform}")
452
453      if (current_cpu == "arm64" || current_cpu == "riscv64") {
454        module_type = "lib64"
455      } else if (current_cpu == "arm") {
456        module_type = "lib"
457      }
458
459      sources_dir = [
460        "${root_build_dir}/backup/packages/${_platform}/system/$module_type",
461        "${root_build_dir}/backup/packages/${_platform}/system/bin",
462      ]
463
464      restore_dir = "${current_platform_dir}/${system_base_dir}/restore"
465
466      outputs = [ restore_dir ]
467
468      script = "//build/ohos/packages/backup_restore_artifact.py"
469      args = [ "--source-dir" ]
470      foreach(source_dir, sources_dir) {
471        args += [ rebase_path(source_dir, root_out_dir) ]
472      }
473
474      args += [
475        "--output-dir",
476        rebase_path(restore_dir, root_out_dir),
477      ]
478    }
479
480    action("restore_first_stage_symbols_${_platform}") {
481      current_platform = _platform
482      current_platform_dir = "${product_output_dir}/$current_platform"
483      deps = [ ":package_libs_symbols_${_platform}" ]
484      print("restore_first_stage_symbols_${_platform}")
485
486      sources_dir = [
487        "${root_build_dir}/backup/packages/${_platform}/exe.unstripped",
488        "${root_build_dir}/backup/packages/${_platform}/lib.unstripped",
489      ]
490
491      restore_dir = "${current_platform_dir}/restore_symbols"
492
493      outputs = [ restore_dir ]
494
495      script = "//build/ohos/packages/backup_restore_artifact.py"
496      args = [ "--source-dir" ]
497      foreach(source_dir, sources_dir) {
498        args += [ rebase_path(source_dir, root_out_dir) ]
499      }
500
501      args += [
502        "--output-dir",
503        rebase_path(restore_dir, root_out_dir),
504      ]
505    }
506  }
507}
508
509foreach(_platform, target_platform_list) {
510  current_platform_dir = "$product_output_dir/$_platform"
511  _system_install_info_file =
512      "${current_platform_dir}/system_install_parts.json"
513
514  action_with_pydeps("package_libs_symbols_${_platform}") {
515    deps = [ ":${_platform}_parts_list" ]
516    script = "//build/ohos/packages/resources_collect.py"
517    inputs = [ _system_install_info_file ]
518    output_file = "$target_out_dir/$target_name.out"
519    outputs = [ output_file ]
520
521    args = [
522      "--collect-type",
523      "libs_symbols",
524      "--system-install-info-file",
525      rebase_path(_system_install_info_file, root_build_dir),
526      "--resources-dir-list",
527      "lib.unstripped",
528      "exe.unstripped",
529      "--package-output-base-dir",
530      rebase_path("$current_platform_dir", root_build_dir),
531      "--output-file",
532      rebase_path(output_file, root_build_dir),
533    ]
534  }
535}
536
537group("package_libs_symbols") {
538  deps = []
539  foreach(_platform, target_platform_list) {
540    deps += [ ":package_libs_symbols_${_platform}" ]
541    if (is_asan || is_tsan) {
542      deps += [ ":restore_first_stage_symbols_${_platform}" ]
543    }
544  }
545}
546
547foreach(_platform, target_platform_list) {
548  current_platform_dir = "${product_output_dir}/$_platform"
549  _system_install_info_file =
550      "${current_platform_dir}/system_install_parts.json"
551
552  action_with_pydeps("package_testcase_mlf_${_platform}") {
553    testonly = true
554    deps = [
555      ":${_platform}_parts_list",
556      ":build_all_test_pkg",
557    ]
558    script = "//build/ohos/packages/resources_collect.py"
559    inputs = [ _system_install_info_file ]
560    output_file = "$target_out_dir/$target_name.out"
561    outputs = [ output_file ]
562    args = [
563      "--collect-type",
564      "module_list_files",
565      "--system-install-info-file",
566      rebase_path(_system_install_info_file, root_build_dir),
567      "--resources-dir-list",
568      "module_list_files",
569      "--package-output-base-dir",
570      rebase_path("$current_platform_dir", root_build_dir),
571      "--output-file",
572      rebase_path(output_file, root_build_dir),
573    ]
574  }
575}
576
577group("package_testcase_mlf") {
578  testonly = true
579  deps = []
580  foreach(_platform, target_platform_list) {
581    deps += [ ":package_testcase_mlf_${_platform}" ]
582  }
583}
584
585foreach(_platform, target_platform_list) {
586  current_platform_dir = "${product_output_dir}/$_platform"
587
588  _system_install_info_file =
589      "${current_platform_dir}/system_install_parts.json"
590
591  action_with_pydeps("package_testcase_${_platform}") {
592    testonly = true
593    deps = [
594      ":${_platform}_parts_list",
595      ":build_all_test_pkg",
596    ]
597    script = "//build/ohos/packages/resources_collect.py"
598    inputs = [ _system_install_info_file ]
599    output_file = "$target_out_dir/$target_name.out"
600    outputs = [ output_file ]
601
602    test_type_list = [
603      "unittest",
604      "moduletest",
605      "systemtest",
606      "performance",
607      "security",
608      "reliability",
609      "distributedtest",
610      "fuzztest",
611    ]
612
613    resources_dir_list = []
614    foreach(test_type, test_type_list) {
615      resources_dir_list += [ "tests/" + test_type ]
616    }
617
618    args = [
619      "--collect-type",
620      "testcase",
621      "--system-install-info-file",
622      rebase_path(_system_install_info_file, root_build_dir),
623      "--package-output-base-dir",
624      rebase_path("$current_platform_dir/tests", root_build_dir),
625      "--output-file",
626      rebase_path(output_file, root_build_dir),
627      "--resources-dir-list",
628    ]
629    args += resources_dir_list
630  }
631}
632
633foreach(_platform, target_platform_list) {
634  current_platform_dir = "${product_output_dir}/$_platform"
635  required_files = []
636  required_files += [
637    "${build_configs_path}/target_platforms_parts.json",
638    "${build_configs_path}/parts_info/parts_info.json",
639    "${build_configs_path}/infos_for_testfwk.json",
640  ]
641  action_with_pydeps("copy_testfwk_required_files_${_platform}") {
642    testonly = true
643    deps = [ ":package_testcase_${_platform}" ]
644    script = "//build/ohos/copy_files.py"
645    depfile = "$target_gen_dir/$target_name.d"
646    output_file = "$target_out_dir/$target_name.out"
647    outputs = [ output_file ]
648    args = [
649      "--depfile",
650      rebase_path(depfile, root_build_dir),
651      "--copy-output-dir",
652      rebase_path("$current_platform_dir/tests", root_build_dir),
653      "--outfile",
654      rebase_path(output_file, root_build_dir),
655      "--source-files",
656    ]
657    args += rebase_path(required_files, root_build_dir)
658  }
659}
660
661action_with_pydeps("open_source_package") {
662  script = "//build/scripts/code_release.py"
663  depfile = "$target_gen_dir/$target_name.d"
664  if (osp_only_collect_file) {
665    _output = "${root_build_dir}/packages/code_opensource/release_opensource/CodeOpensource.stamp"
666  } else {
667    _output = "${root_build_dir}/packages/code_opensource/CodeOpensource.tar.gz"
668  }
669  outputs = [ _output ]
670  args = [
671    "--depfile",
672    rebase_path(depfile, root_build_dir),
673    "--output",
674    rebase_path(_output, root_build_dir),
675    "--root-dir",
676    rebase_path("//", root_build_dir),
677    "--scan-dirs",
678    osp_scan_dirs,
679    "--scan-licenses",
680    osp_scan_licenses,
681  ]
682
683  # extend args
684  if (osp_only_collect_file) {
685    args += [ "--only-collect-file" ]
686  }
687}
688
689group("package_testcase") {
690  testonly = true
691  deps = []
692  foreach(_platform, target_platform_list) {
693    deps += [
694      ":copy_testfwk_required_files_${_platform}",
695      ":package_testcase_${_platform}",
696    ]
697  }
698}
699
700group("test_example_template") {
701  testonly = true
702  if (device_name == "rk3568") {
703    deps = [
704      "//build/test/test_example_template/test_ohos_executable:test_ohos_executable",
705      "//build/test/test_example_template/test_ohos_sa_profile:test_ohos_sa_profile",
706      "//build/test/test_example_template/test_ohos_shared_library:test_ohos_shared_library",
707      "//build/test/test_example_template/test_ohos_shared_library_module_install_dir:test_ohos_shared_library_module_install_dir",
708      "//build/test/test_example_template/test_ohos_shared_library_output_name:test_ohos_shared_library_output_name",
709      "//build/test/test_example_template/test_ohos_shared_library_relative_install_dir:test_ohos_shared_library_relative_install_dir",
710      "//build/test/test_example_template/test_ohos_shared_library_testonly:test_ohos_shared_library_testonly",
711      "//build/test/test_example_template/test_ohos_source_set:test_ohos_source_set",
712      "//build/test/test_example_template/test_ohos_static_library:test_ohos_static_library",
713    ]
714  }
715}
716
717group("test_rust_template") {
718  testonly = true
719  if (device_name == "rk3568") {
720    deps = [
721      "//build/rust/tests/test_bin_cargo_crate:test_bin_cargo_crate",
722      "//build/rust/tests/test_bin_crate:test_bin_crate",
723      "//build/rust/tests/test_bindgen_test/test_for_extern_c:test_extern_c",
724      "//build/rust/tests/test_bindgen_test/test_for_h:bindgen_test_for_h",
725      "//build/rust/tests/test_bindgen_test/test_for_hello_world:bindgen_test",
726      "//build/rust/tests/test_bindgen_test/test_for_hpp:bindgen_test_hpp",
727      "//build/rust/tests/test_cdylib_crate:test_cdylib_crate",
728      "//build/rust/tests/test_cxx:test_cxx_exe",
729      "//build/rust/tests/test_cxx_rust:test_cxx_rust",
730      "//build/rust/tests/test_dylib_crate:test_dylib_crate",
731      "//build/rust/tests/test_idl:test_idl",
732      "//build/rust/tests/test_proc_macro_cargo_crate:test_proc_macro_cargo_crate",
733      "//build/rust/tests/test_proc_macro_crate/test_attribute_macro:test_attribute_macro",
734      "//build/rust/tests/test_proc_macro_crate/test_derive_helper_macro:test_derive_helper_macro",
735      "//build/rust/tests/test_proc_macro_crate/test_function_macro:test_function_macro",
736      "//build/rust/tests/test_rlib_cargo_crate:test_rlib_crate_associated_bin",
737      "//build/rust/tests/test_rlib_crate:test_rlib_crate",
738      "//build/rust/tests/test_rust_ut:test_rust_ut",
739      "//build/rust/tests/test_static_link:test_static_link",
740      "//build/rust/tests/test_staticlib_crate:test_staticlib_crate",
741    ]
742  }
743}
744
745group("build_all_test_pkg") {
746  testonly = true
747  if (!is_llvm_build) {
748    deps = [
749      ":test_example_template",
750      ":test_rust_template",
751      "$root_build_dir/build_configs:parts_test",
752      "//test/testfwk/developer_test:make_temp_test",
753    ]
754  }
755}
756