| # Copyright 2020 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/components.gni") |
| import("//build/config.gni") |
| |
| ############################################################################### |
| # GROUPS |
| ############################################################################### |
| group("forensics") { |
| testonly = true |
| |
| deps = [ |
| ":pkg", |
| ":tests", |
| "crasher", |
| "snapshot", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| "crash_reports/tests", |
| "exceptions/tests", |
| "feedback:tests", |
| "feedback_data/system_log_recorder/tests", |
| "feedback_data/tests", |
| "last_reboot/tests", |
| "snapshot/tests", |
| "utils/redact/tests", |
| "utils/tests", |
| ] |
| } |
| |
| group("userdebug_configs") { |
| deps = [ ":crash_reports_userdebug_config" ] |
| } |
| |
| group("user_configs") { |
| deps = [ |
| ":crash_reports_user_config", |
| ":feedback_data_limit_inspect_data", |
| ":feedback_redact_data", |
| ] |
| } |
| |
| ############################################################################### |
| # PACKAGES |
| ############################################################################### |
| fuchsia_package("pkg") { |
| package_name = "forensics" |
| |
| deps = [ |
| ":exceptions", |
| ":feedback", |
| ] |
| } |
| |
| ############################################################################### |
| # COMPONENTS |
| ############################################################################### |
| fuchsia_component("exceptions") { |
| manifest = "exceptions/meta/exceptions.cml" |
| |
| deps = [ |
| ":exception_handler_exe", |
| ":exceptions_exe", |
| ] |
| } |
| |
| fuchsia_component("feedback") { |
| manifest = "feedback/meta/feedback.cml" |
| |
| deps = [ |
| ":crash_reports_default_config", |
| ":feedback_data_config", |
| ":feedback_exe", |
| ":system_log_recorder_exe", |
| ] |
| } |
| |
| ############################################################################### |
| # EXECUTABLES |
| ############################################################################### |
| # We use a template to have multiple copies of the same binary named differently. |
| template("forensics_unified_binary") { |
| executable(target_name) { |
| output_name = invoker.output_name |
| |
| sources = [ "unified_binary.cc" ] |
| |
| deps = [ |
| "exceptions:main", |
| "exceptions/handler:main", |
| "feedback:main", |
| "feedback_data/system_log_recorder:main", |
| "//sdk/lib/syslog/cpp", |
| ] |
| } |
| } |
| |
| forensics_unified_binary("exceptions_exe") { |
| output_name = "exceptions" |
| } |
| |
| forensics_unified_binary("exception_handler_exe") { |
| output_name = "exception_handler" |
| } |
| |
| forensics_unified_binary("feedback_exe") { |
| output_name = "feedback" |
| } |
| |
| forensics_unified_binary("system_log_recorder_exe") { |
| output_name = "system_log_recorder" |
| } |
| |
| ############################################################################### |
| # CONFIGS |
| ############################################################################### |
| resource("crash_reports_default_config") { |
| sources = [ "crash_reports/configs/default.json" ] |
| |
| outputs = [ "data/crash_reports/default_config.json" ] |
| } |
| |
| config_data("crash_reports_user_config") { |
| for_pkg = "forensics" |
| |
| sources = [ "crash_reports/configs/user.json" ] |
| |
| outputs = [ "crash_reports/override_config.json" ] |
| } |
| |
| config_data("crash_reports_userdebug_config") { |
| for_pkg = "forensics" |
| |
| sources = [ "crash_reports/configs/userdebug.json" ] |
| |
| outputs = [ "crash_reports/override_config.json" ] |
| } |
| |
| config_data("crash_reports_upload_to_prod_server_config") { |
| for_pkg = "forensics" |
| |
| sources = [ "crash_reports/configs/upload_to_prod_server.json" ] |
| |
| outputs = [ "crash_reports/override_config.json" ] |
| } |
| |
| resource("feedback_data_config") { |
| sources = [ "feedback_data/configs/default.json" ] |
| |
| outputs = [ "data/feedback_data/config.json" ] |
| } |
| |
| config_data("feedback_data_limit_inspect_data") { |
| for_pkg = "forensics" |
| |
| sources = [ "feedback_data/configs/limit_inspect_data" ] |
| |
| outputs = [ "feedback_data/limit_inspect_data" ] |
| } |
| |
| config_data("feedback_redact_data") { |
| for_pkg = "forensics" |
| |
| sources = [ "feedback/configs/redact_data" ] |
| |
| outputs = [ "feedback/redact_data" ] |
| } |
| |
| config_data("feedback_remote_device_id_provider") { |
| for_pkg = "forensics" |
| |
| sources = [ "feedback/configs/remote_device_id_provider" ] |
| |
| outputs = [ "feedback/remote_device_id_provider" ] |
| } |
| |
| config_data("exceptions_enable_jitd_on_startup") { |
| for_pkg = "forensics" |
| |
| sources = [ "exceptions/configs/jitd_on_startup.json" ] |
| |
| outputs = [ "exceptions/enable_jitd_on_startup.json" ] |
| } |