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