1{
2  "target_cpu": {
3    "arg_name": "--target-cpu",
4    "argDefault": "arm",
5    "arg_help": "Default:''. Help:Specifies the desired cpu architecture for the build, each may support different cpu architectures, run 'hb set --all' to list product all supported cpu architectures",
6    "arg_phase": "prebuild",
7    "arg_type": "str",
8    "arg_attribute": {
9      "optional": [
10        "arm",
11        "arm64",
12        "x86_64",
13        "x64",
14        "mipsel",
15        "riscv64",
16        "loongarch64"
17      ]
18    },
19    "resolve_function": "resolve_target_cpu",
20    "testFunction": "testBuildTargetCpu"
21  },
22  "target_os": {
23    "arg_name": "--target-os",
24    "argDefault": "ohos",
25    "arg_help": "Default:''. Help:Specifies the desired os type for the build, each may support different os type, run 'hb set --all' to list product all supported os type",
26    "arg_phase": "prebuild",
27    "arg_type": "str",
28    "arg_attribute": {
29      "optional": [
30        "android",
31        "ios"
32      ]
33    },
34    "resolve_function": "resolve_target_os",
35    "testFunction": "testBuildTargetOs"
36  },
37  "product_name": {
38    "arg_name": "--product-name",
39    "argDefault": "",
40    "arg_help": "Default:''. Help:Build a specified product. You could use this option like this: 1.'hb build --product-name rk3568@hihope' 2.'hb build --product-name rk3568'",
41    "arg_phase": "prebuild",
42    "arg_type": "str",
43    "arg_attribute": {
44      "abbreviation": "-p"
45    },
46    "resolve_function": "resolve_product",
47    "testFunction": "testProduct"
48  },
49  "rename_last_log": {
50    "arg_name": "--rename-last-log",
51    "argDefault": true,
52    "arg_help": "Default:True. Help:You can use it to decide whether to keep the last build log",
53    "arg_phase": "prebuild",
54    "arg_type": "bool",
55    "arg_attribute": {},
56    "resolve_function": "resolve_rename_last_log",
57    "testFunction": "testRenameLastLog"
58  },
59  "log_mode": {
60    "arg_name": "--log-mode",
61    "argDefault": "normal",
62    "arg_help": "Default:'normal'. Help:You can use this option to determine whether to use single-line refresh log mode",
63    "arg_phase": "prebuild",
64    "arg_type": "str",
65    "arg_attribute": {
66      "optional": [
67        "normal",
68        "silent"
69      ]
70    },
71    "resolve_function": "resolve_log_mode",
72    "testFunction": "testLogMode"
73  },
74  "precise_branch": {
75    "arg_name": "--precise-branch",
76    "argDefault": "dayu200_tdd",
77    "arg_help": "Default:'dayu200_tdd'. Help:You can use this option to select the dayu200_tdd branch",
78    "arg_phase": "prebuild",
79    "arg_type": "str",
80    "arg_attribute": {},
81    "resolve_function": "resolve_precise_branch",
82    "testFunction": "testPreciseBranch"
83  },
84  "ccache": {
85    "arg_name": "--ccache",
86    "argDefault": true,
87    "arg_help": "Default:True. Help:Enable ccache, this option could improve compilation speed. --stat-ccache can summary the cache data",
88    "arg_phase": "prebuild",
89    "arg_type": "bool",
90    "arg_attribute": {},
91    "resolve_function": "resolve_ccache",
92    "testFunction": "testCCache"
93  },
94  "xcache": {
95    "arg_name": "--xcache",
96    "argDefault": false,
97    "arg_help": "Default:False. Help:Enable xcache, this option could improve compilation speed. --stat-ccache can summary the cache data",
98    "arg_phase": "prebuild",
99    "arg_type": "bool",
100    "arg_attribute": {},
101    "resolve_function": "resolve_xcache",
102    "testFunction": "testXcache"
103  },
104  "enable_pycache": {
105    "arg_name": "--enable-pycache",
106    "argDefault": false,
107    "arg_help": "Default:False. Help:Enable pycache, This option can improve the execution speed of python files",
108    "arg_phase": "prebuild",
109    "arg_type": "bool",
110    "arg_attribute": {},
111    "resolve_function": "resolve_pycache",
112    "testFunction": "testPycache"
113  },
114  "jobs": {
115    "arg_name": "--jobs",
116    "argDefault": "",
117    "arg_help": "Deprecated, please do not use this option",
118    "arg_phase": "prebuild",
119    "arg_type": "str",
120    "arg_attribute": {
121      "deprecated": "true"
122    },
123    "resolve_function": "resolve_jobs",
124    "testFunction": "testJobs"
125  },
126  "disable_part_of_post_build": {
127    "arg_name": "--disable-part-of-post-build",
128    "argDefault": [],
129    "arg_help": "Deprecated, please do not use this option",
130    "arg_phase": "prebuild",
131    "arg_type": "list",
132    "arg_attribute": {
133      "deprecated": "true"
134    },
135    "resolve_function": "resolve_disable_part_of_post_build",
136    "testFunction": "testDisablePartOfPostBuild"
137  },
138  "build_target": {
139    "arg_name": "--build-target",
140    "argDefault": [],
141    "arg_help": "Default:[]. Help:You use this option to specify a single compilation target, and use 'hb tool --ls' to list all build target",
142    "arg_phase": "prebuild",
143    "arg_type": "list",
144    "arg_attribute": {
145      "abbreviation": "-T"
146    },
147    "resolve_function": "resolve_build_target",
148    "testFunction": "testBuildTarget"
149  },
150  "ninja_args": {
151    "arg_name": "--ninja-args",
152    "argDefault": [],
153    "arg_help": "Default:[]. Help:You can use it to pass parameters for the ninja phase, but you need to follow the specified command format. eg. --ninja-args=-dkeeprsp ",
154    "arg_phase": "prebuild",
155    "arg_type": "list",
156    "arg_attribute": {},
157    "resolve_function": "resolve_ninja_args",
158    "testFunction": "testNinjaArgs"
159  },
160  "full_compilation": {
161    "arg_name": "--full-compilation",
162    "argDefault": false,
163    "arg_help": "Default:[]. Help:You can use it to start full code compilation. The default compilation target is images. Use this option to add 'make_all' and 'make_test' to the build process.",
164    "arg_phase": "prebuild",
165    "arg_type": "bool",
166    "arg_attribute": {
167      "abbreviation": "-f"
168    },
169    "resolve_function": "resolve_full_compilation",
170    "testFunction": "testFullCompilation"
171  },
172  "strict_mode": {
173    "arg_name": "--strict-mode",
174    "argDefault": false,
175    "arg_help": "Default:False. Help:Check all produce of each phase to early terminates a potentially problematic compilation.",
176    "arg_phase": "load",
177    "arg_type": "bool",
178    "arg_attribute": {},
179    "resolve_function": "resolve_strict_mode",
180    "testFunction": "testStrictMode"
181  },
182  "scalable_build": {
183    "arg_name": "--scalable-build",
184    "argDefault": false,
185    "arg_help": "Default:False. Help:Select whether to read information from parts.json generate by preload",
186    "arg_phase": "load",
187    "arg_type": "bool",
188    "arg_attribute": {},
189    "resolve_function": "resolve_scalable_build",
190    "testFunction": "testScalableBuild"
191  },
192  "build_example": {
193    "arg_name": "--build-example",
194    "argDefault": false,
195    "arg_help": "Default:False. Help:Select whether to read information from subsystem_config_example.json",
196    "arg_phase": "load",
197    "arg_type": "bool",
198    "arg_attribute": {},
199    "resolve_function": "resolve_build_example",
200    "testFunction": "testBuildExample"
201  },
202  "build_platform_name": {
203    "arg_name": "--build-platform-name",
204    "argDefault": "phone",
205    "arg_help": "Default:'phone'. Help:Name of the compilation platform. The current optional value is 'phone'",
206    "arg_phase": "load",
207    "arg_type": "str",
208    "arg_attribute": {},
209    "resolve_function": "resolve_build_platform_name",
210    "testFunction": "testBuildPlatformName"
211  },
212  "build_xts": {
213    "arg_name": "--build-xts",
214    "argDefault": false,
215    "arg_help": "Default:False. Help:Select whether to load the components included in the subsystem xts",
216    "arg_phase": "load",
217    "arg_type": "bool",
218    "arg_attribute": {},
219    "resolve_function": "resolve_build_xts",
220    "testFunction": "testBuildXts"
221  },
222  "ignore_api_check": {
223    "arg_name": "--ignore-api-check",
224    "argDefault": [],
225    "arg_help": "Default:[]. Help:Skip the check of some subsystems",
226    "arg_phase": "load",
227    "arg_type": "list",
228    "arg_attribute": {},
229    "resolve_function": "resolve_ignore_api_check",
230    "testFunction": "testIgnoreApiCheck"
231  },
232  "load_test_config": {
233    "arg_name": "--load-test-config",
234    "argDefault": true,
235    "arg_help": "Default:True. Help:Select whether to load the test field in bundle.json, that is, whether to call the test case",
236    "arg_phase": "load",
237    "arg_type": "bool",
238    "arg_attribute": {},
239    "resolve_function": "resolve_load_test_config",
240    "testFunction": "testLoadTestConfig"
241  },
242  "skip_partlist_check": {
243    "arg_name": "--skip-partlist-check",
244    "argDefault": false,
245    "arg_help": "Default:False. Help:Skip the subsystem and component check in partlist file",
246    "arg_phase": "load",
247    "arg_type": "bool",
248    "arg_attribute": {},
249    "resolve_function": "resolve_skip_partlist_check",
250    "testFunction": "testSkipPartlistCheck"
251  },
252  "build_type": {
253    "arg_name": "--build-type",
254    "argDefault": "release",
255    "arg_help": "Default:'release'. Help:Specify compile release or debug version",
256    "arg_phase": "targetGenerate",
257    "arg_type": "str",
258    "arg_attribute": {
259      "optional": [
260        "release",
261        "profile",
262        "debug"
263      ]
264    },
265    "resolve_function": "resolve_build_type",
266    "testFunction": "testBuildType"
267  },
268  "log_level": {
269    "arg_name": "--log-level",
270    "argDefault": "info",
271    "arg_help": "Default:'INFO'. Help:Specify the log level during compilation. you can select two levels: debug, info. In debug mode, it show all command lines while building, including cxx, link, solink, etc.",
272    "arg_phase": "targetGenerate",
273    "arg_type": "str",
274    "arg_attribute": {
275      "optional": [
276        "info",
277        "debug"
278      ]
279    },
280    "resolve_function": "resolve_log_level",
281    "testFunction": "testLogLevel"
282  },
283  "export_para": {
284    "arg_name": "--export-para",
285    "argDefault": [],
286    "arg_help": "Deprecated, please do not use this option",
287    "arg_phase": "targetGenerate",
288    "arg_type": "list",
289    "arg_attribute": {
290      "deprecated": "true"
291    },
292    "resolve_function": "resolve_export_para",
293    "testFunction": "testExportPara"
294  },
295  "test": {
296    "arg_name": "--test",
297    "argDefault": [],
298    "arg_help": "Default:[]. Help:You can use it to choose test type. eg. --test xts",
299    "arg_phase": "targetGenerate",
300    "arg_type": "list",
301    "arg_attribute": {},
302    "resolve_function": "resolve_test",
303    "testFunction": "testTest"
304  },
305  "gn_args": {
306    "arg_name": "--gn-args",
307    "argDefault": [],
308    "arg_help": "Default:[]. Help:Specify gn build arguments, you could use this option like this 'hb build --gn-args is_debug=true'",
309    "arg_phase": "targetGenerate",
310    "arg_type": "list",
311    "arg_attribute": {},
312    "resolve_function": "resolve_gn_args",
313    "testFunction": "testGnArgs"
314  },
315  "gn_flags": {
316    "arg_name": "--gn-flags",
317    "argDefault": [],
318    "arg_help": "Default:[]. Help:Specify gn build arguments, you could use this option like this 'hb build --gn-flags \"--export-compile-commands\"",
319    "arg_phase": "targetGenerate",
320    "arg_type": "list",
321    "arg_attribute": {},
322    "resolve_function": "resolve_gn_flags",
323    "testFunction": "testGnFlags"
324  },
325  "compiler": {
326    "arg_name": "--compiler",
327    "argDefault": "clang",
328    "arg_help": "Deprecated, please do not use this option",
329    "arg_phase": "targetGenerate",
330    "arg_type": "str",
331    "arg_attribute": {
332      "abbreviation": "-c"
333    },
334    "resolve_function": "resolve_compiler",
335    "testFunction": "testCompiler"
336  },
337  "fast_rebuild": {
338    "arg_name": "--fast-rebuild",
339    "argDefault": false,
340    "arg_help": "Default:False. Help:You can use it to skip prepare, preloader, gn_gen steps so we can enable it only when there is no change for gn related script",
341    "arg_phase": "targetGenerate",
342    "arg_type": "bool",
343    "arg_attribute": {},
344    "resolve_function": "resolve_fast_rebuild",
345    "testFunction": "testFastRebuild"
346  },
347  "root_perf_main": {
348    "arg_name": "--root-perf-main",
349    "argDefault": "main",
350    "arg_help": "Default:root. Help:different kinds of root packages",
351    "arg_phase": "targetGenerate",
352    "arg_type": "str",
353    "arg_attribute": {
354        "optional": [
355          "root",
356          "main",
357          "root_main"
358        ]
359      },
360    "resolve_function": "resolve_root_perf_main",
361    "testFunction": "testResolveRootPerfMain"
362  },
363  "runtime_mode": {
364    "arg_name": "--runtime-mode",
365    "argDefault": "release",
366    "arg_help": "Default:release. Help:runtime mode",
367    "arg_phase": "targetGenerate",
368    "arg_type": "str",
369    "arg_attribute": {
370        "optional": [
371          "release",
372          "debug",
373          "profile"
374        ]
375      },
376    "resolve_function": "resolve_runtime_mode",
377    "testFunction": "testResolveRuntimeMode"
378  },
379  "check_compilation_parameters": {
380    "arg_name": "--check-compilation-parameters",
381    "argDefault": false,
382    "arg_help": "Default:false. Help:check compilation parameters",
383    "arg_phase": "postTargetGenerate",
384    "arg_type": "bool",
385    "arg_attribute": {},
386    "resolve_function": "resolve_check_compilation_parameters",
387    "testFunction": "testCheckCompilationParameters"
388  },
389  "keep_ninja_going": {
390    "arg_name": "--keep-ninja-going",
391    "argDefault": false,
392    "arg_help": "Default:False. Help:When you need to debug one specific target, you can use this option to keep ninja going to skip some possible error until 1000000 jobs fail",
393    "arg_phase": "targetCompilation",
394    "arg_type": "bool",
395    "arg_attribute": {},
396    "resolve_function": "resolve_keep_ninja_going",
397    "testFunction": "testKeepNinjaGoing"
398  },
399  "build_only_load": {
400    "arg_name": "--build-only-load",
401    "argDefault": false,
402    "arg_help": "Default:False. Help:Stop build until load phase ends",
403    "arg_phase": "targetCompilation",
404    "arg_type": "bool",
405    "arg_attribute": {},
406    "resolve_function": "resolve_build_only_load",
407    "testFunction": "testBuildOnlyLoad"
408  },
409  "build_only_gn": {
410    "arg_name": "--build-only-gn",
411    "argDefault": false,
412    "arg_help": "Default:False. Help:Stop build until gn phase ends",
413    "arg_phase": "targetCompilation",
414    "arg_type": "bool",
415    "arg_attribute": {},
416    "resolve_function": "resolve_build_only_gn",
417    "testFunction": "testBuildOnlyGn"
418  },
419  "build_variant": {
420    "arg_name": "--build-variant",
421    "argDefault": "root",
422    "arg_help": "Default:'root'. Help:specifies device operating mode",
423    "arg_phase": "postTargetCompilation",
424    "arg_type": "str",
425    "arg_attribute": {
426      "optional": [
427        "user",
428        "root"
429      ]
430    },
431    "resolve_function": "resolve_build_variant",
432    "testFunction": "testBuildVariant"
433  },
434  "device_type": {
435    "arg_name": "--device-type",
436    "argDefault": "default",
437    "arg_help": "Default:'default'. Help:specifies device type",
438    "arg_phase": "postTargetCompilation",
439    "arg_type": "str",
440    "arg_attribute": {},
441    "resolve_function": "resolve_device_type",
442    "testFunction": "testDeviceType"
443  },
444  "disable_package_image": {
445    "arg_name": "--disable-package-image",
446    "argDefault": false,
447    "arg_help": "deprecated, please do not use this option",
448    "arg_phase": "postTargetCompilation",
449    "arg_type": "bool",
450    "arg_attribute": {
451      "deprecated": "true"
452    },
453    "resolve_function": "resolve_disable_package_image",
454    "testFunction": "testDisablePackageImage"
455  },
456  "archive_image": {
457    "arg_name": "--archive-image",
458    "argDefault": false,
459    "arg_help": "Default:False. Help:archive image when build product complete",
460    "arg_phase": "postTargetCompilation",
461    "arg_type": "bool",
462    "arg_attribute": {},
463    "resolve_function": "resolve_archive_image",
464    "testFunction": "testArchiveImage"
465  },
466  "patch": {
467    "arg_name": "--patch",
468    "argDefault": false,
469    "arg_help": "Default:False. Help: Apply patches as per configuration in patch.yml, and handle rollback if needed.",
470    "arg_phase": "prebuild",
471    "arg_type": "bool",
472    "arg_attribute": {},
473    "resolve_function": "resolve_patch",
474    "testFunction": "testPatch"
475  },
476  "rom_size_statistics": {
477    "arg_name": "--rom-size-statistics",
478    "argDefault": false,
479    "arg_help": "Default:False. Help:statistics on the actual rom size for each compiled component",
480    "arg_phase": "postTargetCompilation",
481    "arg_type": "bool",
482    "arg_attribute": {},
483    "resolve_function": "resolve_rom_size_statistics",
484    "testFunction": "testRomSizeStatistics"
485  },
486  "stat_ccache": {
487    "arg_name": "--stat-ccache",
488    "argDefault": true,
489    "arg_help": "Default:True. Help:summary ccache hitrate, and generate ccache.log in ${HOME}/.ccache dir",
490    "arg_phase": "postTargetCompilation",
491    "arg_type": "bool",
492    "arg_attribute": {},
493    "resolve_function": "resolve_stat_ccache",
494    "testFunction": "testStatCCache"
495  },
496  "get_warning_list": {
497    "arg_name": "--get-warning-list",
498    "argDefault": true,
499    "arg_help": "Default:True. Help:You can use it to collect the build warning and generate WarningList.txt in output dir",
500    "arg_phase": "postTargetCompilation",
501    "arg_type": "bool",
502    "arg_attribute": {},
503    "resolve_function": "resolve_get_warning_list",
504    "testFunction": "testGetWarningList"
505  },
506  "generate_ninja_trace": {
507    "arg_name": "--generate-ninja-trace",
508    "argDefault": true,
509    "arg_help": "Default:True. Help:Count the duration of each ninja thread and generate the ninja trace file(build.trace.gz)",
510    "arg_phase": "postTargetCompilation",
511    "arg_type": "bool",
512    "arg_attribute": {},
513    "resolve_function": "resolve_generate_ninja_trace",
514    "testFunction": "testResolveGenerateNinjaTrace"
515  },
516  "compute_overlap_rate": {
517    "arg_name": "--compute-overlap-rate",
518    "argDefault": true,
519    "arg_help": "Default:True. Help:Compute overlap rate during the post build",
520    "arg_phase": "postTargetCompilation",
521    "arg_type": "bool",
522    "arg_attribute": {},
523    "resolve_function": "resolve_compute_overlap_rate",
524    "testFunction": "testComputeOverlapRate"
525  },
526  "clean_args": {
527    "arg_name": "--clean-args",
528    "argDefault": true,
529    "arg_help": "Default:True. Help:clean all args that generated by this compilation while compilation finished",
530    "arg_phase": "postbuild",
531    "arg_type": "bool",
532    "arg_attribute": {},
533    "resolve_function": "resolve_clean_args",
534    "testFunction": "testCleanArgs"
535  },
536  "deps_guard": {
537    "arg_name": "--deps-guard",
538    "argDefault": true,
539    "arg_help": "Default:True. Help:simplify code, remove concise dependency analysis, and speed up rule checking",
540    "arg_phase": "postTargetCompilation",
541    "arg_type": "bool",
542    "arg_attribute": {},
543    "resolve_function": "resolve_deps_guard",
544    "testFunction": "testDepsGuard"
545  }
546}
547