• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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/ohos_var.gni")
15
16# load build configs and write load result to out_build_dir/build_configs
17build_loader_script = rebase_path("//build/loader/load.py")
18
19_platforms_config_file = "${preloader_output_dir}/platforms.build"
20
21_subsystem_config_file = "${preloader_output_dir}/subsystem_config.json"
22
23_exclusion_modules_config_file =
24    "${preloader_output_dir}/exclusion_modules.json"
25
26build_platform = ""
27
28arguments = [
29  "--subsystem-config-file",
30  rebase_path(_subsystem_config_file),
31  "--platforms-config-file",
32  rebase_path(_platforms_config_file),
33  "--exclusion-modules-config-file",
34  rebase_path(_exclusion_modules_config_file),
35  "--source-root-dir",
36  rebase_path("//"),
37  "--gn-root-out-dir",
38  rebase_path(root_build_dir),
39  "--target-os",
40  target_os,
41  "--target-cpu",
42  target_cpu,
43]
44
45arguments += [
46  "--os-level",
47  os_level,
48]
49
50if (build_platform != "") {
51  arguments += [
52    "--build-platform-name",
53    build_platform,
54  ]
55}
56
57if (scalable_build) {
58  arguments += [ "--scalable-build" ]
59}
60
61if (build_example) {
62  arguments += [
63    "--example-subsystem-file",
64    rebase_path("//build/subsystem_config_example.json", "$root_out_dir"),
65  ]
66}
67if (build_xts) {
68  arguments += [ "--build-xts" ]
69}
70
71if (load_test_config) {
72  arguments += [ "--load-test-config" ]
73}
74
75arguments += [
76  "--ignore-api-check",
77  "xts",
78  "common",
79  "developertest",
80]
81
82load_result = exec_script(build_loader_script, arguments, "string")
83
84if (load_result != "") {
85  print()
86  print(load_result)
87}
88
89print("build configs generation is complete.")
90