Stephan Pleines | 85b295c | 2024-02-04 17:50:26 -0800 | [diff] [blame] | 1 | load("//aos/flatbuffers:generate.bzl", "static_flatbuffer") |
| 2 | load("//tools/build_rules:js.bzl", "ts_project") |
| 3 | load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library") |
| 4 | load("//aos:config.bzl", "aos_config") |
| 5 | |
| 6 | package(default_visibility = ["//visibility:public"]) |
| 7 | |
| 8 | cc_binary( |
| 9 | name = "py_log_reader.so", |
| 10 | srcs = ["py_log_reader.cc"], |
| 11 | linkshared = True, |
| 12 | target_compatible_with = ["@platforms//os:linux"], |
| 13 | deps = [ |
| 14 | "//aos:configuration", |
| 15 | "//aos:json_to_flatbuffer", |
| 16 | "//aos/events:shm_event_loop", |
| 17 | "//aos/events:simulated_event_loop", |
| 18 | "//aos/events/logging:log_reader", |
| 19 | "//third_party/python", |
| 20 | "@com_github_google_glog//:glog", |
| 21 | ], |
| 22 | ) |
| 23 | |
| 24 | py_test( |
| 25 | name = "log_reader_test", |
| 26 | srcs = ["log_reader_test.py"], |
| 27 | data = [ |
| 28 | ":py_log_reader.so", |
| 29 | "@sample_logfile//file", |
| 30 | ], |
| 31 | target_compatible_with = ["@platforms//os:linux"], |
| 32 | deps = ["//aos:configuration_fbs_python"], |
| 33 | ) |
| 34 | |
| 35 | static_flatbuffer( |
| 36 | name = "plot_data_fbs", |
| 37 | srcs = [ |
| 38 | "plot_data.fbs", |
| 39 | ], |
| 40 | target_compatible_with = ["@platforms//os:linux"], |
| 41 | ) |
| 42 | |
| 43 | flatbuffer_ts_library( |
| 44 | name = "plot_data_ts_fbs", |
| 45 | srcs = [ |
| 46 | "plot_data.fbs", |
| 47 | ], |
| 48 | target_compatible_with = ["@platforms//os:linux"], |
| 49 | ) |
| 50 | |
| 51 | ts_project( |
| 52 | name = "plot_data_utils", |
| 53 | srcs = ["plot_data_utils.ts"], |
| 54 | visibility = ["//visibility:public"], |
| 55 | deps = [ |
| 56 | ":plot_data_ts_fbs", |
| 57 | "//aos:configuration_ts_fbs", |
| 58 | "//aos/network/www:aos_plotter", |
| 59 | "//aos/network/www:plotter", |
| 60 | "//aos/network/www:proxy", |
| 61 | "@com_github_google_flatbuffers//reflection:reflection_ts_fbs", |
| 62 | "@com_github_google_flatbuffers//ts:flatbuffers_ts", |
| 63 | ], |
| 64 | ) |
| 65 | |
| 66 | aos_config( |
| 67 | name = "plotter", |
| 68 | src = "plotter_config.json", |
| 69 | flatbuffers = [":plot_data_fbs"], |
| 70 | target_compatible_with = ["@platforms//os:linux"], |
| 71 | deps = ["//aos/events:aos_config"], |
| 72 | ) |
| 73 | |
| 74 | cc_library( |
| 75 | name = "in_process_plotter", |
| 76 | srcs = ["in_process_plotter.cc"], |
| 77 | hdrs = ["in_process_plotter.h"], |
| 78 | data = [ |
| 79 | ":plotter", |
| 80 | "//aos/analysis/cpp_plot:cpp_plot_files", |
| 81 | ], |
| 82 | deps = [ |
| 83 | ":plot_data_fbs", |
| 84 | "//aos/events:simulated_event_loop", |
| 85 | "//aos/network:web_proxy", |
| 86 | ], |
| 87 | ) |
| 88 | |
| 89 | cc_binary( |
| 90 | name = "in_process_plotter_demo", |
| 91 | srcs = ["in_process_plotter_demo.cc"], |
| 92 | deps = [ |
| 93 | ":in_process_plotter", |
| 94 | "//aos:init", |
| 95 | ], |
| 96 | ) |
| 97 | |
| 98 | cc_binary( |
| 99 | name = "local_foxglove", |
| 100 | srcs = ["local_foxglove.cc"], |
| 101 | data = ["@foxglove_studio"], |
| 102 | deps = [ |
| 103 | "//aos:init", |
| 104 | "//aos/network:gen_embedded", |
| 105 | "//aos/seasocks:seasocks_logger", |
| 106 | "//third_party/seasocks", |
| 107 | ], |
| 108 | ) |