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/config/subsystem/aafwk/config.gni")
15import("//build/lite/config/test.gni")
16import("//foundation/ability/ability_lite/ability_lite.gni")
17
18lite_library("abilitymanager") {
19  if (ohos_kernel_type == "liteos_m") {
20    target_type = "static_library"
21
22    sources = [
23      "src/slite/ability_manager.cpp",
24      "src/slite/ability_manager_client.cpp",
25      "src/slite/ability_manager_inner.cpp",
26      "src/slite/ability_record_state_data.cpp",
27      "src/slite/abilityms_slite_client.cpp",
28      "src/slite/mission_info.cpp",
29    ]
30
31    deps = [ "${hilog_lite_path}/frameworks/featured:hilog_static" ]
32
33    include_dirs = [
34      "${aafwk_lite_path}/interfaces/inner_api/abilitymgr_lite",
35      "${aafwk_lite_path}/interfaces/inner_api/abilitymgr_lite/slite",
36      "${aafwk_lite_path}/interfaces/kits/ability_lite",
37      "${aafwk_lite_path}/interfaces/kits/ability_lite/slite",
38      "${aafwk_lite_path}/interfaces/kits/want_lite",
39      "${aafwk_lite_path}/services/abilitymgr_lite/include/util",
40      "${appexecfwk_lite_path}/interfaces/kits/bundle_lite",
41      "${appexecfwk_lite_path}/utils/bundle_lite",
42      "${utils_lite_path}/include",
43      "${utils_lite_path}/memory/include",
44      "${ability_lite_samgr_lite_path}/interfaces/kits/registry",
45      "${ability_lite_samgr_lite_path}/interfaces/kits/samgr",
46      "//third_party/bounds_checking_function/include",
47      "./include/slite",
48    ]
49  } else {
50    target_type = "shared_library"
51
52    sources = [
53      "src/ability_callback_utils.cpp",
54      "src/ability_manager.cpp",
55      "src/ability_self_callback.cpp",
56      "src/ability_service_manager.cpp",
57      "src/abilityms_client.cpp",
58    ]
59
60    deps = [
61      "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle",
62      "${communication_path}/ipc/interfaces/innerkits/c/ipc:ipc_single",
63      "${hilog_lite_path}/frameworks/featured:hilog_shared",
64    ]
65
66    defines = [ "OHOS_APPEXECFWK_BMS_BUNDLEMANAGER" ]
67
68    include_dirs = [
69      "${aafwk_lite_path}/services/abilitymgr_lite/include",
70      "${aafwk_lite_path}/services/abilitymgr_lite/include/util",
71      "${aafwk_lite_path}/frameworks/abilitymgr_lite/include",
72      "${aafwk_lite_path}/frameworks/want_lite/include",
73      "${aafwk_lite_path}/interfaces/inner_api/abilitymgr_lite",
74      "${aafwk_lite_path}/interfaces/kits/want_lite",
75      "${aafwk_lite_path}/interfaces/kits/ability_lite",
76      "${appexecfwk_lite_path}/utils/bundle_lite",
77      "${appexecfwk_lite_path}/interfaces/kits/bundle_lite",
78      "${appexecfwk_lite_path}/frameworks/bundle_lite/include",
79      "${utils_lite_path}/include",
80      "${utils_lite_path}/memory/include",
81      "${communication_path}/ipc/interfaces/innerkits/c/ipc/include",
82      "${kv_store_path}/interfaces/inner_api/kv_store/include",
83      "${ability_lite_samgr_lite_path}/interfaces/kits/registry",
84      "${ability_lite_samgr_lite_path}/interfaces/kits/samgr",
85      "//third_party/bounds_checking_function/include",
86      "./include",
87      "./",
88    ]
89  }
90
91  if (ohos_kernel_type == "liteos_m") {
92    include_dirs += [ "${hilog_lite_path}/interfaces/native/kits/hilog_lite" ]
93  }
94}
95
96unittest("ability_manager_inner_test") {
97  output_extension = "bin"
98  output_dir = "$root_out_dir/test/unittest/ManagerInnerTest_lv0"
99
100  sources = [ "${ability_lite_path}/frameworks/abilitymgr_lite/unittest/ability_manager_inner_test.cpp" ]
101}
102
103lite_component("aafwk_abilityManager_lite") {
104  features = [ ":abilitymanager" ]
105}
106