1# Copyright (C) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#   http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//build/ohos.gni")
15import("//foundation/multimedia/ringtone_library/ringtone_library.gni")
16
17ohos_hap("ringtone_extension_hap") {
18  hap_profile = "RingtoneLibraryExt/entry/src/main/module.json"
19  deps = [
20    ":RingtoneLibStage_js_assets",
21    ":RingtoneLibStage_resources",
22  ]
23  publicity_file = "${RINGTONE_ROOT_PATH}/publicity.xml"
24  certificate_profile = "${RINGTONE_EXT_HAP_PATH}/signature/ringtonelibrary.p7b"
25  shared_libraries = [ "${RINGTONE_SERVICES_PATH}:ringtone_data_extension" ]
26  hap_name = "Ringtone_Library_Ext"
27  part_name = "prebuilt_hap"
28  subsystem_name = "applications"
29  module_install_dir = "app/Ringtone_Library_Ext"
30  if (defined(sign_hap_py_path)) {
31    certificate_profile =
32        "${RINGTONE_EXT_HAP_PATH}/signature/ringtonelibrary_new.p7b"
33    key_alias = "ringtonelibrarydata"
34    private_key_path = "ringtonelibrarydata"
35    compatible_version = "12"
36  }
37}
38
39ohos_js_assets("RingtoneLibStage_js_assets") {
40  hap_profile = "RingtoneLibraryExt/entry/src/main/module.json"
41  ets2abc = true
42  source_dir = "RingtoneLibraryExt/entry/src/main/ets"
43}
44
45ohos_app_scope("RingtoneLibStage_app_profile") {
46  app_profile = "RingtoneLibraryExt/AppScope/app.json"
47  sources = [ "RingtoneLibraryExt/AppScope/resources" ]
48}
49
50ohos_resources("RingtoneLibStage_resources") {
51  hap_profile = "RingtoneLibraryExt/entry/src/main/module.json"
52  deps = [ ":RingtoneLibStage_app_profile" ]
53  sources = [ "RingtoneLibraryExt/entry/src/main/resources" ]
54}
55