• 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/version.gni")
15
16declare_args() {
17  # build ohos version
18  build_public_version = true
19}
20
21declare_args() {
22  enable_java = is_large_system
23}
24
25declare_args() {
26  build_version_alpha = true
27}
28
29declare_args() {
30  sdk_build_public = false
31}
32
33declare_args() {
34  # Whether build the qemu images, this image is usd to run on emulator device.
35  build_qemu_image = false
36
37  # system package dir
38  system_base_dir = "system"
39
40  # ramdisk package dir
41  ramdisk_base_dir = "ramdisk"
42
43  # vendor package dir
44  vendor_base_dir = "vendor"
45
46  # chipset package dir
47  chipset_base_dir = "vendor"
48
49  # updater package dir
50  updater_base_dir = "updater"
51
52  # updater_vendor package dir
53  updater_vendor_base_dir = "updater_vendor"
54
55  # sys_prod package dir
56  sys_prod_base_dir = "sys_prod"
57
58  # eng_system package dir
59  eng_system_base_dir = "eng_system"
60
61  # eng_chipset package dir
62  eng_chipset_base_dir = "eng_chipset"
63
64  # chip_prod package dir
65  chip_prod_base_dir = "chip_prod"
66
67  # chipset passthrough libraries dir
68  chipset_passthrough_dir = "chipsetsdk"
69
70  # check sdk interface
71  sdk_interface_check = true
72
73  # is use sdk
74  is_use_sdk = false
75
76  # build test example
77  build_example = false
78
79  # check intersdk interface
80  check_innersdk_interface = true
81  gen_innersdk_interface_signature = false
82
83  # sdk check
84  check_sdk_interface = true
85  gen_sdk_interface_signature = false
86
87  # Whether to collect the ebpf testcase.
88  ebpf_enable = false
89
90  # Info files of test targets will remove source file paths when setting true.
91  release_test_suite = false
92
93  # Whether to enable scalable build.
94  scalable_build = false
95
96  # Whether to enable pycache or not.
97  pycache_enable = true
98
99  # Whether to build js bundle to ark bytecode
100  build_ark = true
101
102  # Whether to make Code_OpenSource.tar.gz
103  make_osp = false
104
105  # Enables EMMA Java code coverage. Instruments classes during build to
106  # produce .ec files during runtime
107  emma_coverage = false
108}
109
110declare_args() {
111  build_platform = ""
112
113  sparse_image = false
114}
115
116declare_args() {
117  system_kits_package = false
118
119  kits_api_statistics = false
120
121  # ohos sdk
122  build_ohos_sdk = false
123
124  # Build ohos sdk compatibility jar
125  build_bc_sdk = false
126
127  # Which OS the generated SDK works on. possible values: 'win/mac/linux/default'
128  sdk_platform = "default"
129}
130
131declare_args() {
132  # Build ohos NDK
133  build_ohos_ndk = false
134
135  # Which OS the generated NDK works on. possible values: 'win/mac/linux/default'
136  ndk_platform = "default"
137
138  # Whether to archive or not, set to false in debug to save ndk build time.
139  archive_ndk = true
140
141  # Check ndk header signature, set false to generate header signature
142  check_ndk_signature = false
143}
144
145declare_args() {
146  archive_component = false
147}
148
149declare_args() {
150  build_asan_clean = false
151}
152
153declare_args() {
154  check_deps = false
155}
156
157declare_args() {
158  enable_iccarm_sp = false
159}
160
161declare_args() {
162  enforce_selinux = false
163}
164
165declare_args() {
166  enable_notice_collection = true
167}
168
169declare_args() {
170  skip_generate_module_list_file = false
171}
172
173declare_args() {
174  ohos_skip_parse_external_deps = false
175}
176
177declare_args() {
178  load_test_config = true
179}
180
181declare_args() {
182  # Skip module_info generation when the packaging image is not needed
183  skip_gen_module_info = false
184}
185
186declare_args() {
187  build_variant = "root"
188  root_perf_main = "main"
189  device_type = "default"
190}
191
192declare_args() {
193  is_use_check_deps = true
194}
195
196declare_args() {
197  if (is_mac || is_ios) {
198    enable_bitcode = false
199    if (defined(product_build_config.enable_bitcode)) {
200      enable_bitcode = product_build_config.enable_bitcode
201    }
202  }
203}
204
205declare_args() {
206  bitcode_marker = false
207}
208
209declare_args() {
210  is_opensource = true
211}
212
213# Upgrade Skia version
214use_new_skia = true
215
216if (defined(build_cross_platform_version) && build_cross_platform_version) {
217  use_rosen_drawing = false
218} else {
219  use_rosen_drawing = true
220}
221
222# support changing the ohpm registry and using hvigor cache
223declare_args() {
224  ohpm_registry = ""
225  use_hvigor_cache = false
226  hvigor_obfuscation = true
227}
228
229# enhance some optimizations
230declare_args() {
231  enhanced_opt = true
232}
233
234# build target type
235target_type = "${target_os}-${target_cpu}"
236
237is_system_component =
238    exec_script(rebase_path("//build/scripts/dir_exists.py"),
239                [ rebase_path("//foundation/arkui", root_build_dir) ],
240                "string") == "True"
241
242parts_src_flag_file = "$root_build_dir/build_configs/parts_src_flag.json"
243
244declare_args() {
245  innersdk_dir_name = "sdk/${target_type}"
246}
247declare_args() {
248  innersdk_base_dir = "//${innersdk_dir_name}"
249}
250
251# Compile and generate output directory
252innersdk_build_out_dir = "innerkits/${target_type}"
253
254dist_dir_name = "component_dist/${target_type}"
255dist_build_out_dir = "${root_build_dir}/component_dist/${target_type}"
256dist_subsystem_info_filename = "dist_parts_info.json"
257
258# install packages archive dir define
259dist_install_packages_dir = "${dist_dir_name}/packages_to_install"
260dist_subsystem_info_file =
261    "//${dist_install_packages_dir}/${dist_subsystem_info_filename}"
262dist_build_install_packages_dir = "${dist_build_out_dir}/packages_to_install"
263dist_subsystem_info_output_file =
264    "${dist_build_install_packages_dir}/${dist_subsystem_info_filename}"
265
266ramdisk_dir_list = []
267
268app_target_allowlist = [
269  "*:*_res",
270  "*:*_resources",
271  "*:*_resource",
272  "*:*_assets",
273  "*:*_asset",
274  "*:*_profile",
275]
276app_target_types = [
277  "hap",
278  "resources",
279  "js_assets",
280  "ets_assets",
281  "assets",
282  "app_profile",
283]
284
285ohos_package_names = [
286  "ohos.*",
287  "ark.*",
288]
289
290openjdk_package_names = [
291  "java.*",
292  "javax.*",
293]
294
295hapsigner = "//developtools/hapsigner/dist/hap-sign-tool.jar"
296hap_packing_tool =
297    "${root_out_dir}/obj/developtools/packing_tool/jar/app_packing_tool.jar"
298
299nodejs = "//prebuilts/build-tools/common/nodejs/current/bin/node"
300npm = "//prebuilts/build-tools/common/nodejs/current/bin/npm"
301
302default_key_alias = "OpenHarmony Application Release"
303default_signature_algorithm = "SHA256withECDSA"
304default_hap_private_key_path = "123456"
305default_keystore_password = "123456"
306default_keystore_path = "//developtools/hapsigner/dist/OpenHarmony.p12"
307default_hap_certificate_file =
308    "//developtools/hapsigner/dist/OpenHarmonyApplication.pem"
309