# Copyright (c) 2021 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/appexecfwk/standard/appexecfwk.gni") import( "//foundation/appexecfwk/standard/services/bundlemgr/appexecfwk_bundlemgr.gni") config("bundlemgr_config") { include_dirs = [ "include", "//utils/system/safwk/native/include", ] } config("bundlemgr_common_config") { include_dirs = [ "include", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base/include", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core/include/bundlemgr", "//utils/system/safwk/native/include", "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk/main/cpp/include", "//base/security/appverify/interfaces/innerkits/appverify/include", ] defines = [ "APP_LOG_TAG = \"BundleMgrService\"", "LOG_DOMAIN = 0xD001120", ] } config("bundlemgr_parse_config") { include_dirs = [ "//third_party/json/include", "//third_party/zlib/contrib/minizip", "//third_party/zlib", "//utils/native/base/include", ] } bundlemgr_parser_common_config = [ ":bundlemgr_common_config", ":bundlemgr_parse_config", ] ohos_source_set("parser_common") { sources = [ "src/base_extractor.cpp", "src/zip_file.cpp", ] public_configs = bundlemgr_parser_common_config deps = [ "${common_path}:libappexecfwk_common", "//third_party/zlib:libz", "//utils/native/base:utils", ] external_deps = [ "hiviewdfx_hilog_native:libhilog" ] } ohos_source_set("bundle_parser") { sources = [ "include/bundle_extractor.h", "include/bundle_parser.h", "include/bundle_profile.h", "src/bundle_extractor.cpp", "src/bundle_parser.cpp", "src/bundle_profile.cpp", ] public_configs = bundlemgr_parser_common_config cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ ":parser_common", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", "${common_path}:libappexecfwk_common", "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", ] external_deps = [ "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", ] } group("bms_target") { deps = [ ":installs", ":installs.rc", ":libbms", ] } ohos_shared_library("libbms") { visibility = [ "//foundation/*", "//base/*", ] include_dirs = [ "include", "//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content/", "//foundation/aafwk/standard/interfaces/innerkits/ability_manager/include", "//foundation/distributedschedule/dmsfwk/services/dtbschedmgr/include", "//base/notification/ces_standard/interfaces/innerkits/native/include", "//utils/system/safwk/native/include", "//third_party/jsoncpp/include", ] sources = [ "src/bundle_data_mgr.cpp", "src/bundle_data_storage.cpp", "src/bundle_data_storage_database.cpp", "src/bundle_mgr_host_impl.cpp", "src/bundle_mgr_service.cpp", "src/bundle_mgr_service_event_handler.cpp", "src/bundle_scanner.cpp", "src/bundle_status_callback_death_recipient.cpp", "src/kvstore_death_recipient_callback.cpp", "src/module_usage_data_storage.cpp", "src/permission_changed_death_recipient.cpp", "src/system_ability_helper.cpp", ] sources += bundle_install_sources defines = [ "APP_LOG_TAG = \"BundleMgrService\"" ] configs = [ ":bundlemgr_config", ":bundlemgr_common_config", "${libs_path}/libeventhandler:libeventhandler_config", ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ ":bundle_parser", ":parser_common", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_base:appexecfwk_base", "${appexecfwk_path}/interfaces/innerkits/appexecfwk_core:appexecfwk_core", "${common_path}:libappexecfwk_common", "${libs_path}/libeventhandler:libeventhandler_target", "//base/security/appverify/interfaces/innerkits/appverify:libhapverify", "//base/security/permission/interfaces/innerkits/permission_standard/permissionsdk:libpermissionsdk_standard", "//foundation/aafwk/standard/interfaces/innerkits/base:base", "//foundation/aafwk/standard/interfaces/innerkits/want:want", "//foundation/distributeddatamgr/distributeddatamgr/interfaces/innerkits/distributeddata:distributeddata_inner", "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "ces_standard:cesfwk_core", "ces_standard:cesfwk_innerkits", "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", ] subsystem_name = "appexecfwk" part_name = "appexecfwk_standard" } ohos_executable("installs") { sources = [ "src/installd/installd_main.cpp", "src/system_ability_helper.cpp", ] sources += install_daemon_sources defines = [ "APP_LOG_TAG = \"BundleMgrService\"" ] configs = [ ":bundlemgr_config" ] cflags = [] if (target_cpu == "arm") { cflags += [ "-DBINDER_IPC_32BIT" ] } deps = [ ":bundle_parser", ":parser_common", "${common_path}:libappexecfwk_common", "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy", "//third_party/jsoncpp:jsoncpp", ] external_deps = [ "hiviewdfx_hilog_native:libhilog", "ipc:ipc_core", ] install_enable = true subsystem_name = "appexecfwk" part_name = "appexecfwk_standard" } ohos_prebuilt_etc("installs.rc") { if (use_musl) { source = "installs.cfg" } else { source = "installs.rc" } relative_install_dir = "init" subsystem_name = "appexecfwk" part_name = "appexecfwk_standard" }