mirror of
https://gitee.com/openharmony/hiviewdfx_hiview
synced 2025-02-17 00:59:10 +00:00
171 lines
4.2 KiB
Plaintext
171 lines
4.2 KiB
Plaintext
# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
import("//base/hiviewdfx/hiview/build/hiview_var.gni")
|
|
import("//base/hiviewdfx/hiview/hiview.gni")
|
|
import("//build/ohos.gni")
|
|
|
|
gen_plugin_script =
|
|
rebase_path("//base/hiviewdfx/hiview/build/gen_plugin_build.py")
|
|
copy_plugin_script =
|
|
rebase_path("//base/hiviewdfx/hiview/build/copy_plugin_config.py")
|
|
|
|
input_build_file =
|
|
rebase_path("//base/hiviewdfx/hiview/build/plugin_build.json")
|
|
|
|
out_plugin_config_file = "${target_gen_dir}/plugin_config"
|
|
out_plugin_build_file = "${target_gen_dir}/plugin_build.gni"
|
|
out_plugin_config_file_tmp = "${target_gen_dir}/plugin_config_tmp"
|
|
|
|
if (build_with_config) {
|
|
input_build_file = rebase_path(config_path)
|
|
}
|
|
|
|
arguments = [
|
|
"--input-file",
|
|
input_build_file,
|
|
"--plugin-config-file",
|
|
rebase_path(out_plugin_config_file_tmp),
|
|
"--plugin-build-file",
|
|
rebase_path(out_plugin_build_file),
|
|
"--target_os",
|
|
target_os,
|
|
"--double_framework",
|
|
"$is_double_framework",
|
|
"--target_platform",
|
|
target_platform,
|
|
"--target_cpu",
|
|
target_cpu,
|
|
"--plugin_so",
|
|
"$plugin_so",
|
|
"--plugin_target_platform",
|
|
plugin_target_platform,
|
|
"--plugin_target_ram",
|
|
plugin_target_ram,
|
|
"--plugin_target_rom",
|
|
plugin_target_rom,
|
|
]
|
|
|
|
result_ = exec_script(gen_plugin_script, arguments, "string")
|
|
print(result_)
|
|
action("copy_plugin_config") {
|
|
script = copy_plugin_script
|
|
outputs = [ out_plugin_config_file ]
|
|
args = [
|
|
"--src-file",
|
|
rebase_path(out_plugin_config_file_tmp),
|
|
"--dst-file",
|
|
rebase_path(out_plugin_config_file),
|
|
]
|
|
}
|
|
|
|
import(out_plugin_build_file)
|
|
ohos_prebuilt_etc("plugin_config") {
|
|
source = out_plugin_config_file
|
|
deps = [ ":copy_plugin_config" ]
|
|
|
|
part_name = "hiview"
|
|
subsystem_name = "hiviewdfx"
|
|
relative_install_dir = "hiview"
|
|
}
|
|
|
|
config("hiview_plus_config") {
|
|
visibility = [ ":*" ]
|
|
include_dirs = [ "include" ]
|
|
}
|
|
|
|
ohos_executable("hiview") {
|
|
branch_protector_ret = "pac_ret"
|
|
sanitize = {
|
|
cfi = true
|
|
cfi_cross_dso = true
|
|
cfi_vcall_icall_only = true
|
|
debug = false
|
|
}
|
|
|
|
install_enable = true
|
|
|
|
deps = [
|
|
"base:hiviewbase",
|
|
"core:hiview_core",
|
|
"service:hiview_service",
|
|
]
|
|
|
|
sources = [ "main.cpp" ]
|
|
|
|
deps += plugin_static_deps
|
|
|
|
external_deps = [
|
|
"ffrt:libffrt",
|
|
"hidumper:hidumperservice_cpu_source",
|
|
"hilog:libhilog",
|
|
"safwk:system_ability_fwk",
|
|
"samgr:samgr_proxy",
|
|
]
|
|
|
|
part_name = "hiview"
|
|
subsystem_name = "hiviewdfx"
|
|
}
|
|
|
|
group("hiview_package") {
|
|
# root of all the hiview dependencies
|
|
deps = [
|
|
":hiview",
|
|
":plugin_config",
|
|
"$hiview_plugin/faultlogger:libfaultlogger",
|
|
"$hiview_plugin/performance:xperformance",
|
|
"$hiview_plugin/plugin_build:adft",
|
|
"$hiview_plugin/plugin_build:bdfr",
|
|
"$hiview_root/utility/analysis_faultlog:analysis_faultlog",
|
|
]
|
|
|
|
if (hiview_enable_crash_validator) {
|
|
deps += [ "$hiview_plugin/crash_validator:libcrashvalidator" ]
|
|
}
|
|
|
|
if (enable_hiview_usage_event_report_build) {
|
|
deps += [ "plugins/usage_event_report/service:usage_report" ]
|
|
}
|
|
|
|
if (hiview_freeze_collect_enable) {
|
|
deps += [ "$hiview_plugin/eventlogger:eventloggerso" ]
|
|
}
|
|
|
|
deps += plugin_dynamic_deps
|
|
}
|
|
|
|
group("hiview_test_package") {
|
|
testonly = true
|
|
deps = [
|
|
"$hiview_adapter:moduletest",
|
|
"$hiview_adapter:unittest",
|
|
"adapter/service:fuzztest",
|
|
"adapter/service:unittest",
|
|
"base/test:unittest",
|
|
"core/test:unittest",
|
|
"framework/native/unified_collection:unittest",
|
|
"interfaces/js/napi/test:unittest",
|
|
"plugins:fuzztest",
|
|
"plugins:moduletest",
|
|
"plugins:unittest",
|
|
"service:fuzztest",
|
|
"test:moduletest",
|
|
"test:unittest",
|
|
"utility/common_utils:unittest",
|
|
"utility/smart_parser:moduletest",
|
|
]
|
|
|
|
deps += plugin_ut_deps
|
|
deps += plugin_mst_deps
|
|
}
|