# 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("appexecfwk_core_mock_config") {
  include_dirs = [
    "${aafwk_path}/services/abilitymgr/test/mock/libs/appexecfwk_core/include/",
    "${aafwk_path}/services/abilitymgr/test/mock/libs/appexecfwk_core/include/appmgr",
    "${aafwk_path}/services/abilitymgr/test/mock/libs/appexecfwk_core/include/bundlemgr",
    "${aafwk_path}/interfaces/innerkits/ability_manager/include",
    "${aafwk_path}/services/abilitymgr/include",
    "${bundlefwk_inner_api_path}/appexecfwk_base/include",
    "${aafwk_path}/interfaces/innerkits/app_manager/include/appmgr",
    "${aafwk_path}/frameworks/kits/ability/native/include/",
    "//base/telephony/core_service/sim/include/",
    "${aafwk_path}/services/abilitymgr/test/mock/libs/aakit/include/",
    "${bundlefwk_inner_api_path}/appexecfwk_base/include",
    "${aafwk_path}/services/common/include",
  ]
}

ohos_source_set("appexecfwk_appmgr_mock") {
  # sources = [ "src/appmgr/mock_app_manager.cpp" ]

  configs = [ ":appexecfwk_core_mock_config" ]
  cflags = []
  if (target_cpu == "arm") {
    cflags += [ "-DBINDER_IPC_32BIT" ]
  }
  deps = [
    "${aafwk_path}/interfaces/innerkits/app_manager:app_manager",
    "${ability_base_path}:want",
    "${bundlefwk_inner_api_path}/appexecfwk_base:appexecfwk_base",
    "${bundlefwk_innerkits_path}/libeventhandler:libeventhandler",
    "${distributedschedule_path}/safwk/interfaces/innerkits/safwk:system_ability_fwk",
    "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
    "//utils/native/base:utils",
  ]

  external_deps = [
    "bundle_framework:appexecfwk_core",
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
  ]
}

ohos_source_set("appexecfwk_bundlemgr_mock") {
  sources = [ "src/bundlemgr/mock_bundle_manager.cpp" ]
  testonly = true
  configs = [
    ":appexecfwk_core_mock_config",
    "${services_path}/common:common_config",
  ]
  cflags = []
  if (target_cpu == "arm") {
    cflags += [ "-DBINDER_IPC_32BIT" ]
  }
  deps = [
    "${ability_base_path}:want",
    "${bundlefwk_inner_api_path}/appexecfwk_base:appexecfwk_base",
    "${bundlefwk_innerkits_path}/libeventhandler:libeventhandler",
    "${distributedschedule_path}/safwk/interfaces/innerkits/safwk:system_ability_fwk",
    "${distributedschedule_path}/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy",
    "//third_party/googletest:gmock_main",
    "//third_party/googletest:gtest_main",
    "//utils/native/base:utils",
  ]

  external_deps = [
    "bundle_framework:appexecfwk_core",
    "hisysevent_native:libhisysevent",
    "hiviewdfx_hilog_native:libhilog",
    "ipc:ipc_core",
  ]
}
