# Copyright (c) 2021-2022 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/ability/ability_runtime/ability_runtime.gni")

group("native_wantagent") {
  deps = [ ":wantagent_innerkits" ]
}

config("wantagent_innerkits_public_config") {
  visibility = [ ":*" ]

  include_dirs = [
    "//base/notification/eventhandler/interfaces/inner_api",
    "${ability_base_kits_path}/configuration/include",
    "${global_path}/resource_management/interfaces/inner_api/include",
    "${ability_runtime_path}/interfaces/kits/native/ability/native",
    "${ability_runtime_innerkits_path}/ability_manager/include",
    "${ability_runtime_innerkits_path}/wantagent/include",
    "${ability_runtime_services_path}/abilitymgr/include",
    "${ability_runtime_innerkits_path}/app_manager/include/appmgr",
    "${bundlefwk_inner_api_path}/appexecfwk_base/include",
    "${bundlefwk_inner_api_path}/appexecfwk_core/include/bundlemgr",
    "${ability_runtime_path}/interfaces/kits/native/appkit/app",
    "${ability_runtime_path}/interfaces/kits/native/appkit/ability_runtime",
    "//third_party/icu/icu4c/source/common",
  ]
}

ohos_shared_library("wantagent_innerkits") {
  include_dirs = [ "${ability_runtime_services_path}/common/include" ]

  sources = [
    "${ability_runtime_services_path}/abilitymgr/src/sender_info.cpp",
    "${ability_runtime_services_path}/abilitymgr/src/want_receiver_stub.cpp",
    "${ability_runtime_services_path}/abilitymgr/src/want_sender_info.cpp",
    "${ability_runtime_services_path}/abilitymgr/src/want_sender_proxy.cpp",
    "${ability_runtime_services_path}/abilitymgr/src/want_sender_stub.cpp",
    "${ability_runtime_services_path}/abilitymgr/src/wants_info.cpp",
    "src/completed_dispatcher.cpp",
    "src/pending_want.cpp",
    "src/trigger_info.cpp",
    "src/want_agent.cpp",
    "src/want_agent_client.cpp",
    "src/want_agent_helper.cpp",
    "src/want_agent_info.cpp",
    "src/want_agent_log_wrapper.cpp",
  ]

  configs = [ "//commonlibrary/c_utils/base:utils_config" ]

  public_configs = [ ":wantagent_innerkits_public_config" ]

  external_deps = [
    "ability_base:want",
    "bundle_framework:appexecfwk_core",
    "c_utils:utils",
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
    "samgr:samgr_proxy",
  ]

  if (is_double_framework) {
    cflags = [ "-DCONFIG_DUAL_FRAMEWORK" ]
  }

  subsystem_name = "ability"
  part_name = "ability_runtime"
}
