• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2020 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.
13import("//build/lite/config/component/lite_component.gni")
14import(
15    "//foundation/bundlemanager/bundle_framework_lite/bundle_framework_lite.gni")
16
17config("bundle_config") {
18  defines = [ "OHOS_APPEXECFWK_BMS_BUNDLEMANAGER" ]
19  cflags_cc = [ "-std=c++14" ]
20}
21
22if (ohos_kernel_type == "liteos_m") {
23  static_library("bundlems") {
24    sources = [
25      "src/bundle_map.cpp",
26      "src/bundle_mgr_service.cpp",
27      "src/bundle_mgr_slite_feature.cpp",
28      "src/bundle_util.cpp",
29      "src/gt_bundle_extractor.cpp",
30      "src/gt_bundle_installer.cpp",
31      "src/gt_bundle_manager_service.cpp",
32      "src/gt_bundle_parser.cpp",
33      "src/gt_extractor_util.cpp",
34    ]
35
36    defines = [ "JERRY_FOR_IAR_CONFIG" ]
37    if (enable_ohos_bundle_manager_service == true) {
38      defines += [ "_MINI_BMS_" ]
39    }
40
41    if (enable_ohos_bundle_manager_service_permission == true) {
42      defines += [
43        "_MINI_BMS_PERMISSION_",
44        "BC_TRANS_ENABLE",
45      ]
46    }
47
48    if (enable_ohos_bundle_manager_service_parse_metadata == true) {
49      defines += [ "_MINI_BMS_PARSE_METADATA_" ]
50    }
51
52    deps = [
53      "${ace_engine_lite_path}/frameworks:ace_lite",
54      "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle",
55      "${hilog_lite_path}/frameworks/featured:hilog_static",
56      "${resource_management_lite_path}/frameworks/resmgr_lite:global_resmgr",
57      "${samgr_lite_path}/samgr:samgr",
58      "//build/lite/config/component/cJSON:cjson_static",
59      "//third_party/jerryscript/jerry-core:jerry-core_static",
60    ]
61
62    include_dirs = [
63      "${appexecfwk_lite_path}/services/bundlemgr_lite/include",
64      "${appexecfwk_lite_path}/interfaces/inner_api/bundlemgr_lite/slite",
65      "${appexecfwk_lite_path}/interfaces/inner_api/bundlemgr_lite",
66      "${appexecfwk_lite_path}/interfaces/kits/bundle_lite/slite",
67      "${appexecfwk_lite_path}/interfaces/kits/bundle_lite",
68      "${appexecfwk_lite_path}/utils/bundle_lite",
69      "${appexecfwk_lite_path}/frameworks/bundle_lite/include",
70      "${hilog_lite_path}/interfaces/native/kits/hilog_lite",
71      "${startup_path}/init/interfaces/innerkits/include/syspara",
72      "${aafwk_lite_path}/interfaces/kits/ability_lite/slite",
73      "${aafwk_lite_path}/services/abilitymgr_lite/include",
74      "${aafwk_lite_path}/interfaces/inner_api/abilitymgr_lite",
75      "${aafwk_lite_path}/interfaces/kits/ability_lite",
76      "${aafwk_lite_path}/interfaces/kits/want_lite",
77      "${aafwk_lite_path}/frameworks/want_lite/include",
78      "${resource_management_lite_path}/interfaces/inner_api/include",
79      "${samgr_lite_path}/interfaces/kits/registry",
80      "${samgr_lite_path}/interfaces/kits/samgr",
81      "//third_party/jerryscript/jerry-core",
82      "//third_party/jerryscript/jerry-core/api",
83      "//third_party/jerryscript/jerry-core/ecma/base",
84      "//third_party/jerryscript/jerry-core/include",
85      "//third_party/jerryscript/jerry-core/jrt",
86      "//third_party/jerryscript/jerry-core/jmem",
87      "//third_party/jerryscript/jerry-core/lit",
88      "//third_party/cJSON",
89      "//third_party/zlib",
90      "//third_party/zlib/contrib/minizip",
91      "${permission_lite_path}/interfaces/kits",
92      "${permission_lite_path}/services/pms/include",
93      "${appverify_lite_path}/include",
94      "//third_party/bounds_checking_function/include",
95      "${utils_lite_path}/include",
96      "${utils_lite_path}/memory/include",
97      "include",
98    ]
99  }
100  lite_component("appexecfwk_services_lite") {
101    features = [ ":bundlems" ]
102  }
103} else {
104  shared_library("bundlems") {
105    configs -= [ "//build/lite/config:language_cpp" ]
106    configs += [ ":bundle_config" ]
107
108    cflags = [
109      "-Wall",
110      "-Wno-format",
111      "-Wno-format-extra-args",
112    ]
113    cflags_cc = cflags
114
115    sources = [
116      "src/bundle_daemon_client.cpp",
117      "src/bundle_extractor.cpp",
118      "src/bundle_info_creator.cpp",
119      "src/bundle_inner_feature.cpp",
120      "src/bundle_installer.cpp",
121      "src/bundle_manager_service.cpp",
122      "src/bundle_map.cpp",
123      "src/bundle_ms_feature.cpp",
124      "src/bundle_ms_host.cpp",
125      "src/bundle_parser.cpp",
126      "src/bundle_res_transform.cpp",
127      "src/bundle_util.cpp",
128      "src/extractor_util.cpp",
129      "src/hap_sign_verify.cpp",
130      "src/zip_file.cpp",
131    ]
132    include_dirs = [
133      "${resource_management_lite_path}/interfaces/inner_api/include",
134      "${aafwk_lite_path}/services/abilitymgr_lite/include",
135      "${aafwk_lite_path}/interfaces/inner_api/abilitymgr_lite",
136      "${aafwk_lite_path}/interfaces/kits/ability_lite",
137      "${aafwk_lite_path}/interfaces/kits/want_lite",
138      "${aafwk_lite_path}/frameworks/want_lite/include",
139      "${appexecfwk_lite_path}/interfaces/inner_api/bundlemgr_lite",
140      "${appexecfwk_lite_path}/frameworks/bundle_lite/include",
141      "${appexecfwk_lite_path}/interfaces/kits/bundle_lite",
142      "${appexecfwk_lite_path}/utils/bundle_lite",
143      "${samgr_lite_path}/interfaces/kits/registry",
144      "${samgr_lite_path}/interfaces/kits/samgr",
145      "//third_party/cJSON",
146      "//third_party/zlib",
147      "//third_party/zlib/contrib/minizip",
148      "${permission_lite_path}/interfaces/kits",
149      "${permission_lite_path}/services/pms/include",
150      "${appverify_lite_path}/include",
151      "//third_party/bounds_checking_function/include",
152      "${utils_lite_path}/include",
153      "${utils_lite_path}/memory",
154      "include",
155    ]
156
157    public_deps = [
158      "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle",
159      "${appverify_lite_path}:verify",
160      "${hilog_lite_path}/frameworks/featured:hilog_shared",
161      "${resource_management_lite_path}/frameworks/resmgr_lite:global_resmgr",
162      "${samgr_lite_path}/samgr:samgr",
163      "//build/lite/config/component/cJSON:cjson_shared",
164      "//build/lite/config/component/zlib:zlib_shared",
165    ]
166  }
167  lite_component("appexecfwk_services_lite") {
168    features = [
169      ":bundlems",
170      "tools:bm",
171      "bundle_daemon:bundle_daemon",
172    ]
173  }
174}
175
176generate_notice_file("appexecfwk_services_lite_notice_file") {
177  module_name = "appexecfwk_services_lite"
178  module_source_dir_list = [
179    "//third_party/cJSON",
180    "//third_party/zlib",
181    "//third_party/bounds_checking_function",
182  ]
183}
184