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("//build/lite/ndk/ndk.gni")
15import(
16    "//foundation/bundlemanager/bundle_framework_lite/bundle_framework_lite.gni")
17
18generate_notice_file("bundle_notice_file") {
19  module_name = "bundle"
20  module_source_dir_list = [
21    "//third_party/bounds_checking_function",
22    "//third_party/cJSON",
23  ]
24}
25
26lite_component("appexecfwk_kits_lite") {
27  features = [ ":bundle" ]
28}
29
30lite_library("bundle") {
31  if (ohos_kernel_type == "liteos_m") {
32    target_type = "static_library"
33
34    if (bundle_framework_lite_enable_ohos_bundle_manager_service_parse_metadata == true) {
35      defines = [ "_MINI_BMS_PARSE_METADATA_" ]
36    }
37
38    sources = [
39      "src/ability_info.cpp",
40      "src/ability_info_utils.cpp",
41      "src/bundle_info.cpp",
42      "src/bundle_info_utils.cpp",
43      "src/element_name.cpp",
44      "src/module_info.cpp",
45      "src/module_info_utils.cpp",
46      "src/slite/bundle_manager.cpp",
47      "src/slite/bundle_manager_inner.cpp",
48      "src/slite/bundlems_slite_client.cpp",
49    ]
50
51    public_deps = [
52      "${aafwk_lite_path}/frameworks/want_lite:want",
53      "${hilog_lite_path}/frameworks/featured:hilog_static",
54    ]
55
56    include_dirs = [
57      "${appexecfwk_lite_path}/services/bundlemgr_lite/include",
58      "${appexecfwk_lite_path}/interfaces/inner_api/bundlemgr_lite/slite",
59      "${appexecfwk_lite_path}/interfaces/inner_api/bundlemgr_lite",
60      "${appexecfwk_lite_path}/interfaces/kits/bundle_lite/slite",
61      "${appexecfwk_lite_path}/interfaces/kits/bundle_lite",
62      "${appexecfwk_lite_path}/utils/bundle_lite",
63      "${appexecfwk_lite_path}/frameworks/bundle_lite/include",
64      "${hilog_lite_path}/interfaces/native/kits/hilog_lite",
65      "${permission_lite_path}/interfaces/kits",
66      "${permission_lite_path}/services/pms/include",
67      "${aafwk_lite_path}/frameworks/want_lite/include",
68      "${aafwk_lite_path}/interfaces/kits/want_lite",
69      "${aafwk_lite_path}/interfaces/kits/ability_lite/slite",
70      "${aafwk_lite_path}/interfaces/inner_api/abilitymgr_lite",
71      "${samgr_lite_path}/interfaces/kits/samgr",
72      "${samgr_lite_path}/interfaces/kits/registry",
73      "//third_party/bounds_checking_function/include",
74      "${utils_lite_path}/include",
75      "${utils_lite_path}/memory/include",
76      "//third_party/cJSON",
77    ]
78  } else {
79    target_type = "shared_library"
80
81    sources = [
82      "src/ability_info.cpp",
83      "src/ability_info_utils.cpp",
84      "src/bundle_callback.cpp",
85      "src/bundle_callback_utils.cpp",
86      "src/bundle_info.cpp",
87      "src/bundle_info_utils.cpp",
88      "src/bundle_manager.cpp",
89      "src/bundle_self_callback.cpp",
90      "src/convert_utils.cpp",
91      "src/element_name.cpp",
92      "src/module_info.cpp",
93      "src/module_info_utils.cpp",
94      "src/token_generate.cpp",
95    ]
96
97    deps = [
98      "${aafwk_lite_path}/frameworks/want_lite:want",
99      "${hilog_lite_path}/frameworks/featured:hilog_shared",
100      "${permission_lite_path}/services/pms_client:pms_client",
101    ]
102
103    include_dirs = [
104      "include",
105      "${permission_lite_path}/interfaces/kits",
106      "${permission_lite_path}/services/pms/include",
107      "${aafwk_lite_path}/frameworks/want_lite/include",
108      "${aafwk_lite_path}/interfaces/kits/want_lite",
109      "${aafwk_lite_path}/interfaces/inner_api/abilitymgr_lite",
110      "${appexecfwk_lite_path}/interfaces/inner_api/bundlemgr_lite",
111      "${appexecfwk_lite_path}/interfaces/kits/bundle_lite",
112      "${appexecfwk_lite_path}/utils/bundle_lite",
113      "${communication_path}/ipc/interfaces/innerkits/c/ipc/include",
114      "${samgr_lite_path}/interfaces/kits/samgr",
115      "${samgr_lite_path}/interfaces/kits/registry",
116      "//third_party/bounds_checking_function/include",
117      "${utils_lite_path}/include",
118      "//third_party/cJSON",
119    ]
120
121    defines = [ "OHOS_APPEXECFWK_BMS_BUNDLEMANAGER" ]
122  }
123
124  if (board_toolchain_type != "iccarm") {
125    cflags = [
126      "-fPIC",
127      "-Wall",
128      "-Wno-format",
129    ]
130    cflags_cc = cflags
131  }
132}
133
134ndk_lib("bundle_notes") {
135  lib_extension = ".so"
136  deps = [ ":bundle" ]
137  head_files = [ "${appexecfwk_lite_path}/interfaces/kits/bundle_lite" ]
138}
139