1fc223305Sopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd.
2fc223305Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
3fc223305Sopenharmony_ci# you may not use this file except in compliance with the License.
4fc223305Sopenharmony_ci# You may obtain a copy of the License at
5fc223305Sopenharmony_ci#
6fc223305Sopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
7fc223305Sopenharmony_ci#
8fc223305Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software
9fc223305Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
10fc223305Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11fc223305Sopenharmony_ci# See the License for the specific language governing permissions and
12fc223305Sopenharmony_ci# limitations under the License.
13fc223305Sopenharmony_ciimport("//build/test.gni")
14fc223305Sopenharmony_ciimport("//foundation/distributeddatamgr/preferences/preferences.gni")
15fc223305Sopenharmony_ci
16fc223305Sopenharmony_cimodule_output_path = "preferences/ndk_preferences"
17fc223305Sopenharmony_ci
18fc223305Sopenharmony_ci###############################################################################
19fc223305Sopenharmony_ci
20fc223305Sopenharmony_ciconfig("module_private_config") {
21fc223305Sopenharmony_ci  visibility = [ ":*" ]
22fc223305Sopenharmony_ci  include_dirs = [
23fc223305Sopenharmony_ci    "${preferences_base_path}/frameworks/ndk/include",
24fc223305Sopenharmony_ci    "${preferences_base_path}/frameworks/common/include",
25fc223305Sopenharmony_ci    "${preferences_native_path}/include",
26fc223305Sopenharmony_ci    "${preferences_native_path}/platform/include/",
27fc223305Sopenharmony_ci    "${preferences_interfaces_path}/inner_api/include/",
28fc223305Sopenharmony_ci    "${preferences_interfaces_path}/ndk/include/",
29fc223305Sopenharmony_ci    "${preferences_base_path}/test/ndk/mock",
30fc223305Sopenharmony_ci    "${preferences_native_path}/mock/ability_runtime/dataobs_manager/include",
31fc223305Sopenharmony_ci    "${preferences_native_path}/mock/ability_base/zuri/include",
32fc223305Sopenharmony_ci  ]
33fc223305Sopenharmony_ci}
34fc223305Sopenharmony_ci
35fc223305Sopenharmony_ciohos_unittest("NDKPreferencesTest") {
36fc223305Sopenharmony_ci  branch_protector_ret = "pac_ret"
37fc223305Sopenharmony_ci  sanitize = {
38fc223305Sopenharmony_ci    cfi = true
39fc223305Sopenharmony_ci    cfi_cross_dso = true
40fc223305Sopenharmony_ci    debug = false
41fc223305Sopenharmony_ci  }
42fc223305Sopenharmony_ci  module_out_path = module_output_path
43fc223305Sopenharmony_ci
44fc223305Sopenharmony_ci  sources = [
45fc223305Sopenharmony_ci    "${preferences_native_path}/mock/ability_base/zuri/src/uri.cpp",
46fc223305Sopenharmony_ci    "${preferences_native_path}/mock/ability_runtime/dataobs_manager/src/data_ability_observer_stub.cpp",
47fc223305Sopenharmony_ci    "${preferences_native_path}/mock/ability_runtime/dataobs_manager/src/dataobs_mgr_client.cpp",
48fc223305Sopenharmony_ci    "${preferences_native_path}/platform/src/preferences_db_adapter.cpp",
49fc223305Sopenharmony_ci    "${preferences_native_path}/platform/src/preferences_dfx_adapter.cpp",
50fc223305Sopenharmony_ci    "${preferences_native_path}/platform/src/preferences_file_lock.cpp",
51fc223305Sopenharmony_ci    "${preferences_native_path}/platform/src/preferences_thread.cpp",
52fc223305Sopenharmony_ci    "${preferences_native_path}/src/base64_helper.cpp",
53fc223305Sopenharmony_ci    "${preferences_native_path}/src/preferences_base.cpp",
54fc223305Sopenharmony_ci    "${preferences_native_path}/src/preferences_enhance_impl.cpp",
55fc223305Sopenharmony_ci    "${preferences_native_path}/src/preferences_helper.cpp",
56fc223305Sopenharmony_ci    "${preferences_native_path}/src/preferences_impl.cpp",
57fc223305Sopenharmony_ci    "${preferences_native_path}/src/preferences_observer.cpp",
58fc223305Sopenharmony_ci    "${preferences_native_path}/src/preferences_utils.cpp",
59fc223305Sopenharmony_ci    "${preferences_native_path}/src/preferences_value.cpp",
60fc223305Sopenharmony_ci    "${preferences_native_path}/src/preferences_value_parcel.cpp",
61fc223305Sopenharmony_ci    "${preferences_native_path}/src/preferences_xml_utils.cpp",
62fc223305Sopenharmony_ci    "${preferences_ndk_path}/src/convertor_error_code.cpp",
63fc223305Sopenharmony_ci    "${preferences_ndk_path}/src/oh_preferences.cpp",
64fc223305Sopenharmony_ci    "${preferences_ndk_path}/src/oh_preferences_option.cpp",
65fc223305Sopenharmony_ci    "${preferences_ndk_path}/src/oh_preferences_value.cpp",
66fc223305Sopenharmony_ci    "mock/application_context.cpp",
67fc223305Sopenharmony_ci    "unittest/preferences_ndk_test.cpp",
68fc223305Sopenharmony_ci    "unittest/preferences_ndk_value_test.cpp",
69fc223305Sopenharmony_ci    "unittest/preferences_test_utils.cpp",
70fc223305Sopenharmony_ci  ]
71fc223305Sopenharmony_ci
72fc223305Sopenharmony_ci  configs = [ ":module_private_config" ]
73fc223305Sopenharmony_ci  external_deps = [
74fc223305Sopenharmony_ci    "access_token:libaccesstoken_sdk",
75fc223305Sopenharmony_ci    "c_utils:utils",
76fc223305Sopenharmony_ci    "hilog:libhilog",
77fc223305Sopenharmony_ci    "hisysevent:libhisysevent",
78fc223305Sopenharmony_ci    "hitrace:hitrace_meter",
79fc223305Sopenharmony_ci    "ipc:ipc_core",
80fc223305Sopenharmony_ci    "libxml2:libxml2",
81fc223305Sopenharmony_ci  ]
82fc223305Sopenharmony_ci}
83fc223305Sopenharmony_ci
84fc223305Sopenharmony_ci###############################################################################
85fc223305Sopenharmony_cigroup("unittest") {
86fc223305Sopenharmony_ci  testonly = true
87fc223305Sopenharmony_ci
88fc223305Sopenharmony_ci  deps = [ ":NDKPreferencesTest" ]
89fc223305Sopenharmony_ci}
90fc223305Sopenharmony_ci###############################################################################
91