-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathohos_var.gni
executable file
·456 lines (364 loc) · 10.1 KB
/
ohos_var.gni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/version.gni")
declare_args() {
# build ohos version
build_public_version = true
}
declare_args() {
enable_java = is_large_system
}
declare_args() {
build_version_alpha = true
}
declare_args() {
sdk_build_public = false
use_current_sdk = false
}
declare_args() {
# Whether build the qemu images, this image is usd to run on emulator device.
build_qemu_image = false
# system package dir
system_base_dir = "system"
# ramdisk package dir
ramdisk_base_dir = "ramdisk"
# vendor package dir
vendor_base_dir = "vendor"
# chipset package dir
chipset_base_dir = "vendor"
# updater package dir
updater_base_dir = "updater"
# updater_vendor package dir
updater_vendor_base_dir = "updater_vendor"
# sys_prod package dir
sys_prod_base_dir = "sys_prod"
# eng_system package dir
eng_system_base_dir = "eng_system"
# eng_chipset package dir
eng_chipset_base_dir = "eng_chipset"
# chip_prod package dir
chip_prod_base_dir = "chip_prod"
# chipset passthrough libraries dir
chipset_passthrough_dir = "chipsetsdk"
# check sdk interface
sdk_interface_check = true
# is use sdk
is_use_sdk = false
# build test example
build_example = false
# check intersdk interface
check_innersdk_interface = true
gen_innersdk_interface_signature = false
# sdk check
check_sdk_interface = true
gen_sdk_interface_signature = false
# Whether to collect the ebpf testcase.
ebpf_enable = false
# Info files of test targets will remove source file paths when setting true.
release_test_suite = false
# Whether to enable scalable build.
scalable_build = false
# Whether to enable pycache or not.
pycache_enable = true
# Whether to build js bundle to ark bytecode
build_ark = true
# Whether to make Code_OpenSource.tar.gz
make_osp = false
# sepcify opensource scan dir, separated by a colon
osp_scan_dirs = "third_party:kernel:device:drivers"
# sepcify opensource scan license, separated by a colon
osp_scan_licenses = "GPL:LGPL"
# Collecting but not pacaking open-source packages for post processing
osp_only_collect_file = false
# Enables EMMA Java code coverage. Instruments classes during build to
# produce .ec files during runtime
emma_coverage = false
}
declare_args() {
build_platform = ""
sparse_image = false
}
declare_args() {
system_kits_package = false
kits_api_statistics = false
# ohos sdk
build_ohos_sdk = false
enable_enhanced_opt = true
# Build ohos sdk compatibility jar
build_bc_sdk = false
# Which OS the generated SDK works on. possible values: 'win/mac/linux/default'
sdk_platform = "default"
}
declare_args() {
# Build ohos NDK
build_ohos_ndk = false
# Which OS the generated NDK works on. possible values: 'win/mac/linux/default'
ndk_platform = "default"
# Whether to archive or not, set to false in debug to save ndk build time.
archive_ndk = true
# Check ndk header signature, set false to generate header signature
check_ndk_signature = false
}
declare_args() {
archive_component = false
}
declare_args() {
build_asan_clean = false
}
declare_args() {
check_deps = false
}
declare_args() {
enable_iccarm_sp = false
}
declare_args() {
enforce_selinux = false
}
declare_args() {
enable_notice_collection = true
}
declare_args() {
skip_generate_module_list_file = true
}
declare_args() {
ohos_skip_parse_external_deps = false
}
declare_args() {
load_test_config = true
}
declare_args() {
# Skip module_info generation when the packaging image is not needed
skip_gen_module_info = false
}
declare_args() {
enable_archive_sdk = true
enable_process_notice = true
}
declare_args() {
build_variant = "root"
root_perf_main = "main"
device_type = "default"
}
declare_args() {
is_use_check_deps = true
}
if (ohos_indep_compiler_enable) {
is_use_check_deps = false
}
declare_args() {
if (is_mac || is_ios) {
enable_bitcode = false
if (defined(product_build_config.enable_bitcode)) {
enable_bitcode = product_build_config.enable_bitcode
}
}
}
declare_args() {
bitcode_marker = false
}
declare_args() {
is_opensource = true
}
# Upgrade Skia version
use_new_skia = true
if (defined(build_cross_platform_version) && build_cross_platform_version) {
use_rosen_drawing = false
} else {
use_rosen_drawing = true
}
# support changing the ohpm registry and using hvigor cache
declare_args() {
ohpm_registry = ""
use_hvigor_cache = false
hvigor_obfuscation = true
}
# enhance some optimizations
declare_args() {
enhanced_opt = true
}
# build target type
target_type = "${target_os}-${target_cpu}"
is_system_component =
exec_script(rebase_path("//build/scripts/dir_exists.py"),
[ rebase_path("//foundation/arkui", root_build_dir) ],
"string") == "True"
parts_src_flag_file = "$root_build_dir/build_configs/parts_src_flag.json"
declare_args() {
innersdk_dir_name = "sdk/${target_type}"
}
declare_args() {
innersdk_base_dir = "//${innersdk_dir_name}"
}
declare_args() {
ability_runtime_graphics = true
}
declare_args() {
window_manager_use_sceneboard = false
}
# Compile and generate output directory
innersdk_build_out_dir = "innerkits/${target_type}"
dist_dir_name = "component_dist/${target_type}"
dist_build_out_dir = "${root_build_dir}/component_dist/${target_type}"
dist_subsystem_info_filename = "dist_parts_info.json"
# install packages archive dir define
dist_install_packages_dir = "${dist_dir_name}/packages_to_install"
dist_subsystem_info_file =
"//${dist_install_packages_dir}/${dist_subsystem_info_filename}"
dist_build_install_packages_dir = "${dist_build_out_dir}/packages_to_install"
dist_subsystem_info_output_file =
"${dist_build_install_packages_dir}/${dist_subsystem_info_filename}"
ramdisk_dir_list = []
app_target_allowlist = [
"*:*_res",
"*:*_resources",
"*:*_resource",
"*:*_assets",
"*:*_asset",
"*:*_profile",
]
app_target_types = [
"hap",
"resources",
"js_assets",
"ets_assets",
"assets",
"app_profile",
]
ohos_package_names = [
"ohos.*",
"ark.*",
]
openjdk_package_names = [
"java.*",
"javax.*",
]
if (ohos_indep_compiler_enable) {
hapsigner = "//prebuilts/ohos-sdk/linux/14/toolchains/lib/hap-sign-tool.jar"
hap_packing_tool =
"//prebuilts/ohos-sdk/linux/14/toolchains/lib/app_packing_tool.jar"
} else {
hapsigner = "//developtools/hapsigner/dist/hap-sign-tool.jar"
hap_packing_tool =
"${root_out_dir}/obj/developtools/packing_tool/jar/app_packing_tool.jar"
}
nodejs = "//prebuilts/build-tools/common/nodejs/current/bin/node"
npm = "//prebuilts/build-tools/common/nodejs/current/bin/npm"
default_key_alias = "OpenHarmony Application Release"
default_signature_algorithm = "SHA256withECDSA"
default_hap_private_key_path = "123456"
default_keystore_password = "123456"
if (ohos_indep_compiler_enable) {
default_keystore_path =
"//prebuilts/ohos-sdk/linux/14/toolchains/lib/OpenHarmony.p12"
default_hap_certificate_file =
"//prebuilts/ohos-sdk/OpenHarmonyApplication.pem"
} else {
default_keystore_path = "//developtools/hapsigner/dist/OpenHarmony.p12"
default_hap_certificate_file =
"//developtools/hapsigner/dist/OpenHarmonyApplication.pem"
}
declare_args() {
build_default_sdk_target = false
build_mac_sdk_target = false
build_linux_sdk_target = false
build_windows_sdk_target = false
build_ohos_sdk_target = false
}
declare_args() {
build_default_ndk_target = false
build_mac_ndk_target = false
build_linux_ndk_target = false
build_windows_ndk_target = false
build_ohos_ndk_target = false
}
python_script = "//build/scripts/is_substring.py"
if (exec_script(python_script,
[
sdk_platform,
"default",
],
"string") == "True") {
build_default_sdk_target = true
}
if (exec_script(python_script,
[
sdk_platform,
"mac",
],
"string") == "True") {
build_mac_sdk_target = true
}
if (exec_script(python_script,
[
sdk_platform,
"win",
],
"string") == "True") {
build_windows_sdk_target = true
}
if (exec_script(python_script,
[
sdk_platform,
"linux",
],
"string") == "True") {
build_linux_sdk_target = true
}
if (exec_script(python_script,
[
sdk_platform,
"ohos",
],
"string") == "True") {
build_ohos_sdk_target = true
}
if (exec_script(python_script,
[
ndk_platform,
"default",
],
"string") == "True") {
build_default_ndk_target = true
}
if (exec_script(python_script,
[
ndk_platform,
"mac",
],
"string") == "True") {
build_mac_ndk_target = true
}
if (exec_script(python_script,
[
ndk_platform,
"win",
],
"string") == "True") {
build_windows_ndk_target = true
}
if (exec_script(python_script,
[
ndk_platform,
"linux",
],
"string") == "True") {
build_linux_ndk_target = true
}
if (exec_script(python_script,
[
ndk_platform,
"ohos",
],
"string") == "True") {
build_ohos_ndk_target = true
}