• 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  # sys_prod package dir
53  sys_prod_base_dir = "sys_prod"
54
55  # chip_prod package dir
56  chip_prod_base_dir = "chip_prod"
57
58  # check sdk interface
59  sdk_interface_check = true
60
61  # is use sdk
62  is_use_sdk = false
63
64  # build test example
65  build_example = false
66
67  # check intersdk interface
68  check_innersdk_interface = true
69  gen_innersdk_interface_signature = false
70
71  # sdk check
72  check_sdk_interface = true
73  gen_sdk_interface_signature = false
74
75  # Whether to collect the ebpf testcase.
76  ebpf_enable = false
77
78  # Info files of test targets will remove source file paths when setting true.
79  release_test_suite = false
80
81  # Whether to enable scalable build.
82  scalable_build = false
83
84  # Whether to enable pycache or not.
85  pycache_enable = true
86
87  # Whether to build js bundle to ark bytecode
88  build_ark = true
89
90  # Whether to make Code_OpenSource.tar.gz
91  make_osp = false
92}
93
94declare_args() {
95  build_platform = ""
96
97  sparse_image = false
98}
99
100declare_args() {
101  system_kits_package = false
102
103  kits_api_statistics = false
104
105  # ohos sdk
106  build_ohos_sdk = false
107
108  # Build ohos sdk compatibility jar
109  build_bc_sdk = false
110}
111
112declare_args() {
113  # Build ohos NDK
114  build_ohos_ndk = false
115
116  # Which OS the generated NDK works on. possible values: 'win/mac/linux/default'
117  ndk_system = "default"
118
119  # Whether to archive or not, set to false in debug to save ndk build time.
120  archive_ndk = true
121
122  # Check ndk header signature, set false to generate header signature
123  check_ndk_signature = false
124}
125
126declare_args() {
127  archive_component = false
128}
129
130declare_args() {
131  build_asan_clean = false
132}
133
134declare_args() {
135  check_deps = false
136}
137
138declare_args() {
139  enforce_selinux = false
140}
141
142declare_args() {
143  enable_notice_collection = true
144}
145
146declare_args() {
147  skip_generate_module_list_file = false
148}
149
150declare_args() {
151  load_test_config = true
152}
153
154declare_args() {
155  # Skip module_info generation when the packaging image is not needed
156  skip_gen_module_info = false
157}
158
159declare_args() {
160  build_variant = "root"
161  device_type = "default"
162}
163
164# build target type
165target_type = "${target_os}-${target_cpu}"
166
167parts_src_flag_file = "$root_build_dir/build_configs/parts_src_flag.json"
168
169innersdk_dir_name = "sdk/${target_type}"
170innersdk_base_dir = "//${innersdk_dir_name}"
171
172# Compile and generate output directory
173innersdk_build_out_dir = "innerkits/${target_type}"
174
175dist_dir_name = "component_dist/${target_type}"
176dist_build_out_dir = "${root_build_dir}/component_dist/${target_type}"
177dist_subsystem_info_filename = "dist_parts_info.json"
178
179# install packages archive dir define
180dist_install_packages_dir = "${dist_dir_name}/packages_to_install"
181dist_subsystem_info_file =
182    "//${dist_install_packages_dir}/${dist_subsystem_info_filename}"
183dist_build_install_packages_dir = "${dist_build_out_dir}/packages_to_install"
184dist_subsystem_info_output_file =
185    "${dist_build_install_packages_dir}/${dist_subsystem_info_filename}"
186
187ramdisk_dir_list = []
188
189app_target_allowlist = [
190  "*:*_res",
191  "*:*_resources",
192  "*:*_resource",
193  "*:*_assets",
194  "*:*_asset",
195  "*:*_profile",
196]
197app_target_types = [
198  "hap",
199  "resources",
200  "js_assets",
201  "ets_assets",
202  "assets",
203  "app_profile",
204]
205
206if (host_os == "mac") {
207  restool = "//prebuilts/build-tools/common/restool/darwin-x86/restool"
208} else {
209  restool = "//prebuilts/build-tools/common/restool/restool"
210}
211
212hapsigner = "//developtools/hapsigner/dist/hap-sign-tool.jar"
213hap_packing_tool =
214    "${root_out_dir}/obj/developtools/packing_tool/jar/app_packing_tool.jar"
215nodejs_version = "v12.18.4"
216if (host_os == "mac") {
217  nodejs = "//prebuilts/build-tools/common/nodejs/node-${nodejs_version}-darwin-x64/bin/node"
218} else {
219  nodejs = "//prebuilts/build-tools/common/nodejs/node-${nodejs_version}-${host_os}-x64/bin/node"
220}
221default_hap_private_key_path = "OpenHarmony Application Release"
222default_signature_algorithm = "SHA256withECDSA"
223default_key_alias = "123456"
224default_keystore_password = "123456"
225default_keystore_path = "//developtools/hapsigner/dist/OpenHarmony.p12"
226default_hap_certificate_file =
227    "//developtools/hapsigner/dist/OpenHarmonyApplication.pem"
228