1# Copyright (c) 2022-2023 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. 13import("//base/hiviewdfx/hiview/hiview.gni") 14import("//build/ohos.gni") 15 16if (enable_hiview_usage_event_report_build) { 17 config("usage_event_report_config") { 18 visibility = [ "*:*" ] 19 include_dirs = [ 20 "cache/include", 21 "event/include", 22 "include", 23 ] 24 25 if (power_manager_enable) { 26 include_dirs += [ "idl/include" ] 27 } 28 } 29 30 ohos_source_set("usage_event_report") { 31 configs = [ ":usage_event_report_config" ] 32 33 sources = [ 34 "cache/event_db_helper.cpp", 35 "cache/json_parser.cpp", 36 "cache/usage_event_cacher.cpp", 37 "event/sys_usage_event.cpp", 38 "usage_event_report.cpp", 39 ] 40 41 if (power_manager_enable) { 42 sources += [ "idl/hiview_shutdown_callback.cpp" ] 43 } 44 45 deps = [ 46 "$hiview_base:hiviewbase", 47 "//third_party/bounds_checking_function:libsec_shared", 48 "//third_party/jsoncpp:jsoncpp", 49 ] 50 51 external_deps = [ 52 "hilog:libhilog", 53 "hisysevent:libhisysevent", 54 "ipc:ipc_single", 55 "relational_store:native_rdb", 56 ] 57 58 defines = [] 59 if (power_manager_enable) { 60 external_deps += [ "power_manager:powermgr_client" ] 61 defines += [ "POWER_MANAGER_ENABLE" ] 62 } 63 64 part_name = "hiview" 65 subsystem_name = "hiviewdfx" 66 } 67} else { 68 ohos_source_set("usage_event_report") { 69 } 70} 71 72group("unittest") { 73 testonly = true 74 deps = [] 75} 76 77group("moduletest") { 78 testonly = true 79 deps = [] 80} 81