Mercurial
comparison hg-web/BUILD @ 195:f8f5004a920a
Merging back hg-web-tip
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Tue, 27 Jan 2026 06:51:44 -0800 |
| parents | 9f4429c49733 |
| children |
comparison
equal
deleted
inserted
replaced
| 189:14cc84ba35a0 | 195:f8f5004a920a |
|---|---|
| 1 load("@rules_cc//cc:cc_binary.bzl", "cc_binary") | 1 load("@rules_cc//cc:cc_binary.bzl", "cc_binary") |
| 2 load("//gui_ze:gui_ze.bzl", "move_files_into_dir", "bundle") | 2 load("//gui_ze:gui_ze.bzl", "move_files_into_dir", "bundle", "bun_bundle") |
| 3 | 3 |
| 4 # Source files | |
| 5 filegroup( | |
| 6 name = "src_ts_files", | |
| 7 srcs = glob([ | |
| 8 "src/**/*.ts", | |
| 9 "src/**/*.tsx", | |
| 10 "src/**/*.js", | |
| 11 "src/**/*.jsx", | |
| 12 ], allow_empty = True), | |
| 13 ) | |
| 14 | |
| 15 # Bundle TypeScript with Bun | |
| 16 bun_bundle( | |
| 17 name = "page", | |
| 18 src = "src/main.tsx", | |
| 19 deps = [ | |
| 20 ":src_ts_files", | |
| 21 "//markdown_converter:markdown_to_html_wasm", | |
| 22 "//third_party/highlight:js", | |
| 23 ], | |
| 24 visibility = ["//visibility:public"], | |
| 25 ) | |
| 26 | |
| 27 # Prepare compiled assets | |
| 4 move_files_into_dir( | 28 move_files_into_dir( |
| 5 name = "compiled_ts", | 29 name = "compiled_js", |
| 6 srcs = [ | 30 srcs = [ |
| 7 "//markdown_converter:markdown_to_html", | 31 ":page", |
| 32 "//markdown_converter:markdown_to_html_wasm", | |
| 33 "//third_party/highlight:js", | |
| 8 ], | 34 ], |
| 9 dest = "src", | 35 dest = "src", |
| 10 ) | 36 ) |
| 11 | 37 |
| 38 move_files_into_dir( | |
| 39 name = "public_files", | |
| 40 srcs = ["//mrjunejune:public_files"], | |
| 41 dest = "src/public", | |
| 42 ) | |
| 43 | |
| 44 move_files_into_dir( | |
| 45 name = "public_fonts_files", | |
| 46 srcs = ["//mrjunejune:public_fonts_files"], | |
| 47 dest = "src/public/fonts", | |
| 48 ) | |
| 49 | |
| 12 filegroup( | 50 filegroup( |
| 13 name = "src_files", | 51 name = "all_assets", |
| 14 srcs = glob(["src/**"]) + [":compiled_ts"], | 52 srcs = glob(["src/**"]) + [":compiled_js", ":public_files", ":public_fonts_files"], |
| 53 ) | |
| 54 | |
| 55 # Server binaries | |
| 56 cc_binary( | |
| 57 name = "hg_web_server", | |
| 58 srcs = ["main.c"], | |
| 59 deps = ["//seobeo:seobeo"], | |
| 60 data = [":all_assets"], | |
| 15 ) | 61 ) |
| 16 | 62 |
| 17 cc_binary( | 63 cc_binary( |
| 18 name = "hg_web_server", | 64 name = "hg_web_server_debug", |
| 19 srcs = ["main.c"], | 65 srcs = ["main.c"], |
| 20 deps = ["//seobeo:seobeo_server"], | 66 deps = ["//seobeo:seobeo"], |
| 21 data = [":src_files"], | 67 data = [":all_assets"], |
| 22 defines = ["REPO_ROOT=\\\"\"/home/mrjunejune/zenbu\"\\\""], | |
| 23 ) | 68 ) |
| 24 | 69 |
| 25 bundle( | 70 bundle( |
| 26 name = "hg_web_server_bundle", | 71 name = "hg_web_server_bundle", |
| 27 binary = ":hg_web_server", | 72 binary = ":hg_web_server", |
| 28 ) | 73 ) |
| 29 | |
| 30 | |
| 31 cc_binary( | |
| 32 name = "hg_web_server_debug", | |
| 33 srcs = ["main.c"], | |
| 34 deps = ["//seobeo:seobeo_tcp_server_ws_debug"], | |
| 35 data = [":src_files"], | |
| 36 defines = ["REPO_ROOT=\\\"\"/home/mrjunejune/zenbu\"\\\""], | |
| 37 ) | |
| 38 |