# 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/aafwk/standard/aafwk.gni")

config("ability_manager_public_config") {
  visibility = [ ":*" ]
  include_dirs = [
    "include/",
    "//third_party/jsoncpp/include",
    "${innerkits_path}/want/include",
    "//utils/native/base/include",
    "//utils/system/safwk/native/include",
    "//foundation/aafwk/standard/interfaces/innerkits/want/include/ohos/aafwk/content",
    "//foundation/aafwk/standard/frameworks/kits/ability/native/include",
    "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler/include",
    "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core/include/bundlemgr",
    "//foundation/aafwk/standard/interfaces/innerkits/app_manager/include/appmgr",
    "//foundation/aafwk/standard/frameworks/kits/appkit/native/app/include",
    "//foundation/multimedia/image_standard/interfaces/innerkits/include",
    "//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_rdb/include",
    "//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_appdatafwk/include",
    "//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_dataability/include",
    "//foundation/aafwk/standard/interfaces/innerkits/dataobs_manager/include",
  ]
  cflags = []
  if (target_cpu == "arm") {
    cflags += [ "-DBINDER_IPC_32BIT" ]
  }
}

ohos_shared_library("ability_manager") {
  sources = [
    "${services_path}/abilitymgr/src/ability_connect_callback_stub.cpp",
    "${services_path}/abilitymgr/src/ability_manager_client.cpp",
    "${services_path}/abilitymgr/src/ability_manager_proxy.cpp",
    "${services_path}/abilitymgr/src/ability_manager_stub.cpp",
    "${services_path}/abilitymgr/src/ability_mission_info.cpp",
    "${services_path}/abilitymgr/src/ability_record_info.cpp",
    "${services_path}/abilitymgr/src/ability_running_info.cpp",
    "${services_path}/abilitymgr/src/ability_scheduler_proxy.cpp",
    "${services_path}/abilitymgr/src/ability_scheduler_stub.cpp",
    "${services_path}/abilitymgr/src/ability_start_setting.cpp",
    "${services_path}/abilitymgr/src/caller_info.cpp",
    "${services_path}/abilitymgr/src/extension_running_info.cpp",
    "${services_path}/abilitymgr/src/image_info.cpp",
    "${services_path}/abilitymgr/src/launch_param.cpp",
    "${services_path}/abilitymgr/src/lifecycle_state_info.cpp",
    "${services_path}/abilitymgr/src/mission_description_info.cpp",
    "${services_path}/abilitymgr/src/mission_info.cpp",
    "${services_path}/abilitymgr/src/mission_listener_proxy.cpp",
    "${services_path}/abilitymgr/src/mission_listener_stub.cpp",
    "${services_path}/abilitymgr/src/mission_option.cpp",
    "${services_path}/abilitymgr/src/mission_record_info.cpp",
    "${services_path}/abilitymgr/src/mission_snapshot.cpp",
    "${services_path}/abilitymgr/src/mission_stack_info.cpp",
    "${services_path}/abilitymgr/src/remote_mission_listener_proxy.cpp",
    "${services_path}/abilitymgr/src/remote_mission_listener_stub.cpp",
    "${services_path}/abilitymgr/src/sender_info.cpp",
    "${services_path}/abilitymgr/src/shared_memory.cpp",
    "${services_path}/abilitymgr/src/stack_info.cpp",
    "${services_path}/abilitymgr/src/stack_setting.cpp",
    "${services_path}/abilitymgr/src/start_options.cpp",
    "${services_path}/abilitymgr/src/stop_user_callback_proxy.cpp",
    "${services_path}/abilitymgr/src/stop_user_callback_stub.cpp",
    "${services_path}/abilitymgr/src/want_sender_info.cpp",
    "${services_path}/abilitymgr/src/want_sender_stub.cpp",
    "${services_path}/abilitymgr/src/wants_info.cpp",
    "//foundation/aafwk/standard/frameworks/kits/ability/native/src/data_ability_operation.cpp",
    "//foundation/aafwk/standard/frameworks/kits/ability/native/src/data_ability_operation_builder.cpp",
    "//foundation/aafwk/standard/frameworks/kits/ability/native/src/data_ability_result.cpp",
    "//foundation/aafwk/standard/frameworks/kits/ability/native/src/task_handler.cpp",
    "//foundation/aafwk/standard/frameworks/kits/ability/native/src/task_handler_client.cpp",
  ]

  public_configs = [
    ":ability_manager_public_config",
    "${services_path}/abilitymgr:abilityms_config",
  ]

  deps = [
    "${innerkits_path}/base:base",
    "${innerkits_path}/want:want",
    "//foundation/aafwk/standard/frameworks/kits/ability/native:dummy_classes",
    "//foundation/aafwk/standard/interfaces/innerkits/app_manager:app_manager",
    "//foundation/appexecfwk/standard/common:libappexecfwk_common",
    "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_base:appexecfwk_base",
    "//foundation/appexecfwk/standard/interfaces/innerkits/appexecfwk_core:appexecfwk_core",
    "//foundation/appexecfwk/standard/interfaces/innerkits/libeventhandler:libeventhandler",
    "//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_dataability:native_dataability",
    "//foundation/distributeddatamgr/appdatamgr/interfaces/innerkits/native_rdb:native_rdb",
    "//foundation/distributedschedule/dmsfwk/interfaces/innerkits/uri:zuri",
    "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
    "//foundation/multimedia/image_standard/interfaces/innerkits:image_native",
    "//third_party/jsoncpp:jsoncpp",
    "//utils/native/base:utils",
  ]

  external_deps = [
    "bytrace_standard:bytrace_core",
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
    "native_appdatamgr:native_appdatafwk",
    "native_appdatamgr:native_dataability",
    "native_appdatamgr:native_rdb",
  ]

  subsystem_name = "aafwk"
  part_name = "ability_runtime"
}
