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