• 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("//base/update/updater/updater_default_cfg.gni")
15import("//build/ohos.gni")
16SUBSYSTEM_DIR = "//base/update/updater/services/script"
17
18yacc_path = "$root_out_dir/updater/updater/yacc"
19script_yacc_path = "$SUBSYSTEM_DIR/script_interpreter/script_yacc.y"
20script_lex_path = "$SUBSYSTEM_DIR/script_interpreter/script_lex.l"
21action("gen_yacc") {
22  script = "//base/update/updater/services/script/generate_yacc.py"
23  inputs = [ script ]
24  outputs = [
25    "$root_out_dir/updater/updater/yacc/lexer.cpp",
26    "$root_out_dir/updater/updater/yacc/parser.cpp",
27  ]
28  args = [
29    "--output",
30    rebase_path(yacc_path, root_build_dir),
31    "--bisoninput",
32    rebase_path(script_yacc_path, root_build_dir),
33    "--flexinput",
34    rebase_path(script_lex_path, root_build_dir),
35  ]
36}
37
38config("script_config") {
39  visibility = [ ":*" ]
40
41  include_dirs = [
42    "//base/update/updater/interfaces/kits/include",
43    "//base/update/updater/services/include/log",
44    "//base/update/updater/services/include/package",
45    "//base/update/updater/services/include/script",
46    "//base/update/updater/services/include/updater",
47    "//base/update/updater/utils/include",
48    "//third_party/bounds_checking_function/include",
49    "script_instruction",
50    "script_interpreter",
51    "script_manager",
52    "threadpool",
53    "$yacc_path",
54  ]
55
56  configs = [ "//build/config/compiler:exceptions" ]
57}
58
59ohos_static_library("libupdaterscript") {
60  sources = [
61    "$SUBSYSTEM_DIR/script_instruction/script_basicinstruction.cpp",
62    "$SUBSYSTEM_DIR/script_instruction/script_instructionhelper.cpp",
63    "$SUBSYSTEM_DIR/script_instruction/script_loadscript.cpp",
64    "$SUBSYSTEM_DIR/script_instruction/script_registercmd.cpp",
65    "$SUBSYSTEM_DIR/script_instruction/script_updateprocesser.cpp",
66    "$SUBSYSTEM_DIR/script_interpreter/script_context.cpp",
67    "$SUBSYSTEM_DIR/script_interpreter/script_expression.cpp",
68    "$SUBSYSTEM_DIR/script_interpreter/script_function.cpp",
69    "$SUBSYSTEM_DIR/script_interpreter/script_interpreter.cpp",
70    "$SUBSYSTEM_DIR/script_interpreter/script_param.cpp",
71    "$SUBSYSTEM_DIR/script_interpreter/script_scanner.cpp",
72    "$SUBSYSTEM_DIR/script_interpreter/script_statement.cpp",
73    "$SUBSYSTEM_DIR/script_manager/script_managerImpl.cpp",
74    "$SUBSYSTEM_DIR/script_manager/script_utils.cpp",
75    "$SUBSYSTEM_DIR/threadpool/threadpool.cpp",
76    "$root_out_dir/updater/updater/yacc/lexer.cpp",
77    "$root_out_dir/updater/updater/yacc/parser.cpp",
78  ]
79  configs = [ ":script_config" ]
80
81  external_deps += [ "c_utils:utils" ]
82  deps = [
83    "//base/update/updater/services/script:gen_yacc",
84    "//third_party/bounds_checking_function:libsec_static",
85  ]
86}
87