# Copyright (C) 2025 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/multimedia/media_library/media_library.gni")

ohos_hap("medialibrary_ext_hap") {
  hap_profile = "./entry/src/main/module.json"
  deps = [
    ":MediaLibStage_js_assets",
    ":MediaLibStage_resources",
  ]
  shared_libraries = [ "${MEDIALIB_INNERKITS_PATH}/medialibrary_data_extension:medialibrary_data_extension" ]
  certificate_profile = "./signature/medialib.p7b"
  hap_name = "Media_Library_Ext"
  part_name = "media_library"
  subsystem_name = "multimedia"
  module_install_dir = "app/com.ohos.medialibrary.MediaLibraryData"
  publicity_file = "../publicity.xml"
  if (defined(sign_hap_py_path)) {
    certificate_profile = "./signature/medialib_new.p7b"
    key_alias = "medialibrarydata"
    private_key_path = "medialibrarydata"
    compatible_version = "9"
  }
}

ohos_js_assets("MediaLibStage_js_assets") {
  hap_profile = "./entry/src/main/module.json"
  ets2abc = true
  source_dir = "./entry/src/main/ets"
}

ohos_app_scope("MediaLibStage_app_profile") {
  app_profile = "./AppScope/app.json"
  sources = [ "./AppScope/resources" ]
}

ohos_resources("MediaLibStage_resources") {
  sources = [ "./entry/src/main/resources" ]
  deps = [ ":MediaLibStage_app_profile" ]
  hap_profile = "./entry/src/main/module.json"
}