hiviewdfx_hiview/BUILD.gn
YOUR_NAME b50f843cd8 modify part name
Signed-off-by: YOUR_NAME <mashuang9@huawei.com>
2021-07-27 16:03:52 +08:00

127 lines
3.1 KiB
Plaintext

# Copyright (c) 2021 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("//build/ohos.gni")
if (!build_public_version) {
oem_script = rebase_path("//base/hiviewdfx/hiview/build/run_oem_hook.py")
print(exec_script(oem_script, [], "string", []))
}
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") {
install_enable = true
deps = [
"base:hiviewbase",
"core:hiview_core",
"service:hiview_service",
]
sources = [ "main.cpp" ]
deps += plugin_static_deps
part_name = "hiview"
subsystem_name = "hiviewdfx"
}
group("hiview_package") {
# root of all the hiview dependencies
deps = [
":hiview",
":plugin_config",
]
deps += plugin_dynamic_deps
}
group("hiview_test_package") {
testonly = true
deps = [
"adapter:moduletest",
"adapter:unittest",
"base/test:unittest",
"core/test:unittest",
"plugins:moduletest",
"plugins:unittest",
"test:moduletest",
]
}