Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 1 | load("@npm_bazel_typescript//:defs.bzl", "ts_library") |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 2 | load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "rollup_bundle") |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 3 | load("//aos:config.bzl", "aos_config") |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 4 | |
| 5 | filegroup( |
| 6 | name = "files", |
| 7 | srcs = glob([ |
| 8 | "**/*.html", |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 9 | "**/*.css", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 10 | ]), |
Austin Schuh | a4f69d6 | 2020-02-28 13:58:14 -0800 | [diff] [blame] | 11 | visibility = ["//visibility:public"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 12 | ) |
| 13 | |
| 14 | ts_library( |
| 15 | name = "proxy", |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 16 | srcs = [ |
| 17 | "config_handler.ts", |
| 18 | "proxy.ts", |
| 19 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 20 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a4f69d6 | 2020-02-28 13:58:14 -0800 | [diff] [blame] | 21 | visibility = ["//visibility:public"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 22 | deps = [ |
Alex Perry | d5e1357 | 2020-02-22 15:15:08 -0800 | [diff] [blame] | 23 | "//aos:configuration_ts_fbs", |
Austin Schuh | a4f69d6 | 2020-02-28 13:58:14 -0800 | [diff] [blame] | 24 | "//aos/network:connect_ts_fbs", |
| 25 | "//aos/network:web_proxy_ts_fbs", |
Philipp Schrader | e625ba2 | 2020-11-16 20:11:37 -0800 | [diff] [blame] | 26 | "@com_github_google_flatbuffers//ts:flatbuffers_ts", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 27 | ], |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 28 | ) |
| 29 | |
| 30 | ts_library( |
| 31 | name = "main", |
| 32 | srcs = [ |
| 33 | "main.ts", |
| 34 | "ping_handler.ts", |
| 35 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 36 | target_compatible_with = ["@platforms//os:linux"], |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 37 | deps = [ |
| 38 | ":proxy", |
| 39 | "//aos/events:ping_ts_fbs", |
| 40 | ], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 41 | ) |
| 42 | |
| 43 | rollup_bundle( |
Alex Perry | 5f474f2 | 2020-02-01 12:14:24 -0800 | [diff] [blame] | 44 | name = "main_bundle", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 45 | enable_code_splitting = False, |
| 46 | entry_point = "main.ts", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 47 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a4f69d6 | 2020-02-28 13:58:14 -0800 | [diff] [blame] | 48 | visibility = ["//aos:__subpackages__"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 49 | deps = [ |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 50 | ":main", |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 51 | ], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 52 | ) |
| 53 | |
| 54 | genrule( |
| 55 | name = "flatbuffers", |
| 56 | srcs = [ |
| 57 | "@com_github_google_flatbuffers//:flatjs", |
| 58 | ], |
| 59 | outs = [ |
| 60 | "flatbuffers.js", |
| 61 | ], |
| 62 | cmd = "cp $(location @com_github_google_flatbuffers//:flatjs) $@", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 63 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | a4f69d6 | 2020-02-28 13:58:14 -0800 | [diff] [blame] | 64 | visibility = ["//aos:__subpackages__"], |
Alex Perry | b3b5079 | 2020-01-18 16:13:45 -0800 | [diff] [blame] | 65 | ) |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 66 | |
| 67 | ts_library( |
| 68 | name = "reflection_test_main", |
| 69 | srcs = [ |
| 70 | "reflection_test_main.ts", |
| 71 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 72 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 73 | deps = [ |
| 74 | ":reflection_ts", |
Philipp Schrader | e625ba2 | 2020-11-16 20:11:37 -0800 | [diff] [blame] | 75 | "//aos:configuration_ts_fbs", |
| 76 | "//aos:json_to_flatbuffer_flatbuffer_ts", |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 77 | "//aos/network/www:proxy", |
Philipp Schrader | e625ba2 | 2020-11-16 20:11:37 -0800 | [diff] [blame] | 78 | "@com_github_google_flatbuffers//ts:flatbuffers_ts", |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 79 | ], |
| 80 | ) |
| 81 | |
| 82 | ts_library( |
| 83 | name = "reflection_ts", |
| 84 | srcs = ["reflection.ts"], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 85 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | a8f2c45 | 2020-07-05 21:17:56 -0700 | [diff] [blame] | 86 | visibility = ["//visibility:public"], |
Philipp Schrader | e625ba2 | 2020-11-16 20:11:37 -0800 | [diff] [blame] | 87 | deps = [ |
| 88 | "//aos:configuration_ts_fbs", |
| 89 | "//aos:json_to_flatbuffer_flatbuffer_ts", |
| 90 | "@com_github_google_flatbuffers//ts:flatbuffers_ts", |
| 91 | ], |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 92 | ) |
| 93 | |
James Kuszmaul | a8f2c45 | 2020-07-05 21:17:56 -0700 | [diff] [blame] | 94 | ts_library( |
| 95 | name = "plotter", |
| 96 | srcs = [ |
| 97 | "plotter.ts", |
| 98 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 99 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | a8f2c45 | 2020-07-05 21:17:56 -0700 | [diff] [blame] | 100 | visibility = ["//visibility:public"], |
| 101 | ) |
| 102 | |
| 103 | ts_library( |
| 104 | name = "graph_main", |
| 105 | srcs = [ |
| 106 | "graph_main.ts", |
| 107 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 108 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | a8f2c45 | 2020-07-05 21:17:56 -0700 | [diff] [blame] | 109 | deps = [ |
| 110 | ":plotter", |
| 111 | ":proxy", |
| 112 | ":reflection_ts", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 113 | "//aos:configuration_ts_fbs", |
| 114 | "//aos/network:connect_ts_fbs", |
| 115 | "@com_github_google_flatbuffers//ts:flatbuffers_ts", |
James Kuszmaul | a8f2c45 | 2020-07-05 21:17:56 -0700 | [diff] [blame] | 116 | ], |
| 117 | ) |
| 118 | |
| 119 | rollup_bundle( |
| 120 | name = "graph_main_bundle", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 121 | enable_code_splitting = False, |
| 122 | entry_point = "graph_main.ts", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 123 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | a8f2c45 | 2020-07-05 21:17:56 -0700 | [diff] [blame] | 124 | deps = [ |
| 125 | ":graph_main", |
| 126 | ], |
| 127 | ) |
| 128 | |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 129 | aos_config( |
| 130 | name = "test_config", |
| 131 | src = "test_config_file.json", |
| 132 | flatbuffers = [ |
| 133 | "//aos:configuration_fbs", |
| 134 | "//aos:json_to_flatbuffer_flatbuffer", |
| 135 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 136 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 137 | deps = [ |
| 138 | "//aos/events:config", |
| 139 | ], |
| 140 | ) |
| 141 | |
| 142 | rollup_bundle( |
| 143 | name = "reflection_test_bundle", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 144 | enable_code_splitting = False, |
| 145 | entry_point = "reflection_test_main.ts", |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 146 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 147 | deps = [ |
| 148 | ":reflection_test_main", |
| 149 | ], |
| 150 | ) |
| 151 | |
| 152 | sh_binary( |
| 153 | name = "web_proxy_demo", |
| 154 | srcs = ["web_proxy_demo.sh"], |
| 155 | data = [ |
James Kuszmaul | a8f2c45 | 2020-07-05 21:17:56 -0700 | [diff] [blame] | 156 | ":graph.html", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 157 | ":graph_main_bundle.min.js", |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 158 | ":reflection_test.html", |
Austin Schuh | da9d060 | 2019-09-15 17:29:38 -0700 | [diff] [blame] | 159 | ":reflection_test_bundle.min.js", |
Austin Schuh | 14d7d3d | 2020-09-10 18:14:36 -0700 | [diff] [blame] | 160 | ":test_config", |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 161 | "//aos/network:web_proxy_main", |
Austin Schuh | 14d7d3d | 2020-09-10 18:14:36 -0700 | [diff] [blame] | 162 | "//y2020:config", |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 163 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame^] | 164 | target_compatible_with = ["@platforms//os:linux"], |
James Kuszmaul | abb7713 | 2020-08-01 19:56:16 -0700 | [diff] [blame] | 165 | ) |