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 device_type = "default" 189} 190 191declare_args() { 192 is_use_check_deps = true 193} 194 195declare_args() { 196 if (is_mac || is_ios) { 197 enable_bitcode = false 198 if (defined(product_build_config.enable_bitcode)) { 199 enable_bitcode = product_build_config.enable_bitcode 200 } 201 } 202} 203 204declare_args() { 205 bitcode_marker = false 206} 207 208declare_args() { 209 is_opensource = true 210} 211 212# Upgrade Skia version 213use_new_skia = true 214 215# support changing the ohpm registry and sdk type 216declare_args() { 217 ohpm_registry = "" 218} 219 220# build target type 221target_type = "${target_os}-${target_cpu}" 222 223is_system_component = 224 exec_script(rebase_path("//build/scripts/dir_exists.py"), 225 [ rebase_path("//foundation/arkui", root_build_dir) ], 226 "string") == "True" 227 228parts_src_flag_file = "$root_build_dir/build_configs/parts_src_flag.json" 229 230innersdk_dir_name = "sdk/${target_type}" 231innersdk_base_dir = "//${innersdk_dir_name}" 232 233# Compile and generate output directory 234innersdk_build_out_dir = "innerkits/${target_type}" 235 236dist_dir_name = "component_dist/${target_type}" 237dist_build_out_dir = "${root_build_dir}/component_dist/${target_type}" 238dist_subsystem_info_filename = "dist_parts_info.json" 239 240# install packages archive dir define 241dist_install_packages_dir = "${dist_dir_name}/packages_to_install" 242dist_subsystem_info_file = 243 "//${dist_install_packages_dir}/${dist_subsystem_info_filename}" 244dist_build_install_packages_dir = "${dist_build_out_dir}/packages_to_install" 245dist_subsystem_info_output_file = 246 "${dist_build_install_packages_dir}/${dist_subsystem_info_filename}" 247 248ramdisk_dir_list = [] 249 250app_target_allowlist = [ 251 "*:*_res", 252 "*:*_resources", 253 "*:*_resource", 254 "*:*_assets", 255 "*:*_asset", 256 "*:*_profile", 257] 258app_target_types = [ 259 "hap", 260 "resources", 261 "js_assets", 262 "ets_assets", 263 "assets", 264 "app_profile", 265] 266 267ohos_package_names = [ 268 "ohos.*", 269 "ark.*", 270] 271 272openjdk_package_names = [ 273 "java.*", 274 "javax.*", 275] 276 277hapsigner = "//developtools/hapsigner/dist/hap-sign-tool.jar" 278hap_packing_tool = 279 "${root_out_dir}/obj/developtools/packing_tool/jar/app_packing_tool.jar" 280 281nodejs = "//prebuilts/build-tools/common/nodejs/current/bin/node" 282npm = "//prebuilts/build-tools/common/nodejs/current/bin/npm" 283 284default_key_alias = "OpenHarmony Application Release" 285default_signature_algorithm = "SHA256withECDSA" 286default_hap_private_key_path = "123456" 287default_keystore_password = "123456" 288default_keystore_path = "//developtools/hapsigner/dist/OpenHarmony.p12" 289default_hap_certificate_file = 290 "//developtools/hapsigner/dist/OpenHarmonyApplication.pem" 291