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