# Copyright (c) 2023-2026 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("//base/security/asset/config.gni")
import("//build/ohos.gni")

group("asset_component") {
  deps = [
    "interfaces/inner_kits/rs/asset:asset_sdk_rust",
    "interfaces/kits/c/asset:asset_ndk",
  ]

  if (support_jsapi) {
    deps += [
      "frameworks/asset/js/napi:asset_napi",
      "frameworks/secure_access_fence/js/napi:abilitytoolaccessctrl_napi"
    ]
  }

  if (asset_build_mode == "full") {
    deps += [
      "sa_profile:asset_sa_profiles",
      "services/asset/core_service:asset_service",
      "services/asset/plugin:asset_plugin",
    ]
  }
}

group("saf_component") {
  if (os_level == "standard") {
    deps = [
      "sa_profile:saf_service_profile",
      "services/secure_access_fence/core_service:secure_access_fence_service",
      "services/secure_access_fence/plugin:saf_plugin",
    ]
  }
}

# need set different name from asset_test for building script limit
group("asset_bin_test") {
  testonly = true
  deps = [
    "test/asset/unittest/kits_ndk:asset_ndk_test",
    "test/asset/unittest/module_test:asset_dependency_test",
    "test/secure_access_fence/unittest/kits_ndk:saf_agent_fence_ndk_test",
    #"test/secure_access_fence/agent_fence:saf_agent_fence_test",
    #"test/secure_access_fence/agent_fence:saf_agent_fence_manual_test",
    #"test/secure_access_fence/agent_fence:saf_agent_fence_stress_test",
    #"test/secure_access_fence/agent_fence:saf_agent_fence_no_permission_test",
    #"test/secure_access_fence/agent_fence:saf_agent_fence_screen_lock_test",
    #"test/secure_access_fence/agent_fence:saf_agent_fence_screen_lock_hap_identity_test",
    #"test/secure_access_fence/agent_fence:saf_agent_fence_request_tool_permissions_local_test",
    #"test/secure_access_fence/agent_fence:saf_agent_fence_grant_tool_permissions_by_user_local_test"
  ]
  if (enable_local_test) {
    deps += [ "test/asset/unittest/inner_kits_rust:rust_asset_inner_test" ]
    deps += [ "test/asset/unittest/module_test:rust_asset_module_test" ]
    deps += [ "services/asset/common:rust_asset_calling_info_test" ]
    deps += [ "services/asset/db_operator:rust_asset_db_operator_test" ]
    deps += [ "test/asset/unittest/ut_test/services/core_service:rust_asset_core_service_ut_test" ]
    deps += [ "test/secure_access_fence/agent_fence:saf_agent_fence_test" ]
    deps += [ "test/secure_access_fence/agent_fence:saf_agent_fence_manual_test" ]
    deps += [ "test/secure_access_fence/agent_fence:saf_agent_fence_stress_test" ]
    deps += [ "test/secure_access_fence/agent_fence:saf_agent_fence_no_permission_test" ]
    deps += [ "test/secure_access_fence/agent_fence:saf_agent_fence_screen_lock_test" ]
    deps += [ "test/secure_access_fence/agent_fence:saf_agent_fence_screen_lock_hap_identity_test" ]
    deps += [ "test/secure_access_fence/agent_fence:saf_agent_fence_request_tool_permissions_local_test" ]
    deps += [ "test/secure_access_fence/agent_fence:saf_agent_fence_grant_tool_permissions_by_user_local_test" ]
  }
}