1# Copyright (c) 2021 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("//arkcompiler/ets_frontend/es2panda/es2abc_config.gni")
15import("//build/ohos.gni")
16
17config("calendarmanager_public_config") {
18  include_dirs = [
19    "./common",
20    "./native/include",
21    "./napi/include",
22  ]
23  configs = [ "//build/config/compiler:exceptions" ]
24}
25
26jspath = "js/editor.js"
27
28# compile .js to .abc.
29action("gen_editor_abc") {
30  visibility = [ ":*" ]
31  script = "../../../../arkcompiler/ets_frontend/es2panda/scripts/generate_js_bytecode.py"
32
33  args = [
34    "--src-js",
35    rebase_path(jspath),
36    "--dst-file",
37    rebase_path(target_out_dir + "/editor.abc"),
38    "--frontend-tool-path",
39    rebase_path("${es2abc_build_path}"),
40    "--module",
41  ]
42  deps = [ "../../../../arkcompiler/ets_frontend/es2panda:es2panda_build" ]
43  inputs = [ jspath ]
44  outputs = [ target_out_dir + "/editor.abc" ]
45}
46
47base_output_path = get_label_info(":editor_js", "target_out_dir")
48editor_obj_path = base_output_path + "/editor.o"
49gen_js_obj("editor_js") {
50  input = jspath
51  output = editor_obj_path
52  dep = ":gen_editor_abc"
53}
54
55abc_output_path = get_label_info(":editor_abc", "target_out_dir")
56editor_abc_obj_path = abc_output_path + "/editor_abc.o"
57gen_js_obj("editor_abc") {
58  input = "$target_out_dir/editor.abc"
59  output = editor_abc_obj_path
60  dep = ":gen_editor_abc"
61}
62
63ohos_shared_library("calendarmanager") {
64  sources = [
65    "./napi/src/calendar_enum_napi.cpp",
66    "./napi/src/calendar_manager_napi.cpp",
67    "./napi/src/calendar_napi.cpp",
68    "./napi/src/event_filter_napi.cpp",
69    "./napi/src/module_init.cpp",
70    "./napi/src/module_register.cpp",
71    "./napi/src/napi_env.cpp",
72    "./napi/src/napi_queue.cpp",
73    "./napi/src/napi_util.cpp",
74    "./native/src/calendar_env.cpp",
75    "./native/src/data_share_helper_manager.cpp",
76    "./native/src/event_filter.cpp",
77    "./native/src/native_calendar.cpp",
78    "./native/src/native_calendar_manager.cpp",
79    "./native/src/native_util.cpp",
80  ]
81
82  deps = [
83    ":editor_abc",
84    ":editor_js",
85  ]
86
87  public_configs = [ ":calendarmanager_public_config" ]
88
89  external_deps = [
90    "ability_base:want",
91    "ability_base:zuri",
92    "ability_runtime:ability_context_native",
93    "ability_runtime:ability_manager",
94    "ability_runtime:abilitykit_native",
95    "ability_runtime:data_ability_helper",
96    "ability_runtime:napi_base_context",
97    "access_token:libaccesstoken_sdk",
98    "ace_engine:ace_uicontent",
99    "c_utils:utils",
100    "data_share:datashare_common",
101    "data_share:datashare_consumer",
102    "hilog:libhilog",
103    "ipc:ipc_single",
104    "napi:ace_napi",
105  ]
106
107  public_deps = []
108  relative_install_dir = "module"
109  part_name = "calendar_data"
110  subsystem_name = "applications"
111}
112
113ohos_static_library("calendarmanager_static") {
114  branch_protector_ret = "pac_ret"
115  sanitize = {
116    cfi = true
117    cfi_cross_dso = true
118    debug = false
119  }
120  sources = [
121    "./native/src/calendar_env.cpp",
122    "./native/src/data_share_helper_manager.cpp",
123    "./native/src/event_filter.cpp",
124    "./native/src/native_calendar.cpp",
125    "./native/src/native_calendar_manager.cpp",
126    "./native/src/native_util.cpp",
127  ]
128
129  deps = []
130
131  public_configs = [ ":calendarmanager_public_config" ]
132
133  external_deps = [
134    "ability_base:want",
135    "ability_base:zuri",
136    "ability_runtime:ability_context_native",
137    "ability_runtime:ability_manager",
138    "ability_runtime:abilitykit_native",
139    "ability_runtime:data_ability_helper",
140    "ability_runtime:napi_base_context",
141    "c_utils:utils",
142    "data_share:datashare_common",
143    "data_share:datashare_consumer",
144    "hilog:libhilog",
145    "ipc:ipc_single",
146    "napi:ace_napi",
147  ]
148
149  public_deps = []
150  part_name = "calendar_data"
151  subsystem_name = "applications"
152}
153