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 # build system type 23 is_mini_system = false 24 is_small_system = false 25 is_standard_system = false 26} 27 28declare_args() { 29 is_large_system = !(is_standard_system || is_small_system || is_mini_system) 30} 31 32declare_args() { 33 enable_java = is_large_system 34} 35 36declare_args() { 37 build_version_alpha = true 38} 39 40declare_args() { 41 # Whether build the qemu images, this image is usd to run on emulator device. 42 build_qemu_image = false 43 44 # system package dir 45 system_base_dir = "system" 46 47 # ramdisk package dir 48 ramdisk_base_dir = "root" 49 50 # vendor package dir 51 vendor_base_dir = "vendor" 52 53 # updater package dir 54 updater_base_dir = "updater" 55 56 # check sdk interface 57 sdk_interface_check = true 58 59 # is use sdk 60 is_use_sdk = false 61 62 # build test example 63 build_example = false 64 65 # check intersdk interface 66 check_innersdk_interface = true 67 gen_innersdk_interface_signature = false 68 69 # sdk check 70 check_sdk_interface = true 71 gen_sdk_interface_signature = false 72 73 # Whether to collect the ebpf testcase. 74 ebpf_enable = false 75 76 # Info files of test targets will remove source file paths when setting true. 77 release_test_suite = false 78 79 # Whether to enable scalable build. 80 scalable_build = false 81 82 # Whether to enable pycache or not. 83 pycache_enable = true 84 85 # Whether to build js bundle to ark bytecode 86 build_ark = false 87} 88 89declare_args() { 90 build_platform = "" 91 92 product_name = "" 93 94 sparse_image = false 95} 96 97declare_args() { 98 system_kits_package = false 99 100 kits_api_statistics = false 101 102 # ohos sdk 103 build_ohos_sdk = false 104 105 # Build ohos sdk compatibility jar 106 build_bc_sdk = false 107} 108 109declare_args() { 110 # Build ohos NDK 111 build_ohos_ndk = false 112 113 # Which OS the generated NDK works on. possible values: 'win/mac/linux/default' 114 ndk_system = "default" 115 116 # Whether to archive or not, set to false in debug to save ndk build time. 117 archive_ndk = true 118 119 # Check ndk header signature, set false to generate header signature 120 check_ndk_signature = false 121} 122 123declare_args() { 124 archive_component = false 125} 126 127declare_args() { 128 build_xts = false 129} 130 131declare_args() { 132 build_asan_clean = false 133} 134 135declare_args() { 136 check_deps = false 137} 138 139# build target type 140target_type = "${target_os}-${target_cpu}" 141 142parts_src_flag_file = "$root_build_dir/build_configs/parts_src_flag.json" 143 144innersdk_dir_name = "sdk/${target_type}" 145innersdk_base_dir = "//${innersdk_dir_name}" 146 147# Compile and generate output directory 148innersdk_build_out_dir = "innerkits/${target_type}" 149 150dist_dir_name = "component_dist/${target_type}" 151dist_build_out_dir = "${root_build_dir}/component_dist/${target_type}" 152dist_subsystem_info_filename = "dist_parts_info.json" 153 154# install packages archive dir define 155dist_install_packages_dir = "${dist_dir_name}/packages_to_install" 156dist_subsystem_info_file = 157 "//${dist_install_packages_dir}/${dist_subsystem_info_filename}" 158dist_build_install_packages_dir = "${dist_build_out_dir}/packages_to_install" 159dist_subsystem_info_output_file = 160 "${dist_build_install_packages_dir}/${dist_subsystem_info_filename}" 161 162ramdisk_dir_list = [] 163 164product_build_config = 165 read_file("//out/build_configs/${product_name}/preloader/build_config.json", 166 "json") 167product_company = product_build_config.product_company 168device_name = product_build_config.device_name 169device_company = product_build_config.device_company 170 171app_target_allowlist = [ 172 "*:*_res", 173 "*:*_resources", 174 "*:*_resource", 175 "*:*_assets", 176 "*:*_asset", 177] 178app_target_types = [ 179 "hap", 180 "resources", 181 "js_assets", 182 "assets", 183] 184 185restool = "//prebuilts/build-tools/common/restool/restool" 186hapsigner = "//prebuilts/signcenter/hapsigntool/hapsigntoolv2.jar" 187hap_unpacking_tool = 188 "//developtools/packing_tool/jar/hmos_app_unpacking_tool.jar" 189hap_packing_tool = "//developtools/packing_tool/jar/hmos_app_packing_tool.jar" 190ace_loader_home = "//prebuilts/sdk/js-loader/build-tools/ace-loader" 191nodejs_version = "v12.18.4" 192nodejs = "//prebuilts/build-tools/common/nodejs/node-${nodejs_version}-${host_os}-x64/bin/node" 193ace_loader_home = "//prebuilts/sdk/js-loader/build-tools/ace-loader/" 194webpack_js = "${ace_loader_home}/node_modules/webpack/bin/webpack.js" 195webpack_config_js = "${ace_loader_home}/webpack.rich.config.js" 196default_hap_private_key_path = "OpenHarmony Application Release" 197default_signature_algorithm = "SHA256withECDSA" 198default_key_alias = "123456" 199default_keystore_password = "123456" 200default_keystore_path = "//prebuilts/signcenter/key/OpenHarmony.p12" 201default_hap_certificate_file = 202 "//prebuilts/signcenter/certificates/OpenHarmonyApplication.pem" 203