Inital commit
This commit is contained in:
71
wails_bun/private/macros.bzl
Normal file
71
wails_bun/private/macros.bzl
Normal file
@@ -0,0 +1,71 @@
|
||||
"""Macros for Bun-backed Wails applications."""
|
||||
|
||||
load("//wails:defs.bzl", "wails_build_assets", "wails_generate_bindings", "wails_run")
|
||||
load(":private/dev_session.bzl", "wails_bun_dev_session")
|
||||
load(":private/frontend_dist.bzl", "wails_bun_frontend_dev", "wails_bun_frontend_dist")
|
||||
|
||||
def wails_bun_app(
|
||||
name,
|
||||
app_binary,
|
||||
frontend_srcs,
|
||||
package_json,
|
||||
node_modules,
|
||||
build_asset_srcs,
|
||||
app_name,
|
||||
binary_name,
|
||||
icon = None,
|
||||
bindings_package_dir = ".",
|
||||
frontend_strip_prefix = "",
|
||||
build_strip_prefix = "",
|
||||
visibility = None):
|
||||
wails_bun_frontend_dist(
|
||||
name = name + "_frontend_dist",
|
||||
srcs = frontend_srcs,
|
||||
node_modules = node_modules,
|
||||
package_json = package_json,
|
||||
strip_prefix = frontend_strip_prefix,
|
||||
visibility = visibility,
|
||||
)
|
||||
|
||||
wails_build_assets(
|
||||
name = name + "_build_assets",
|
||||
srcs = build_asset_srcs,
|
||||
app_name = app_name,
|
||||
binary_name = binary_name,
|
||||
strip_prefix = build_strip_prefix,
|
||||
visibility = visibility,
|
||||
)
|
||||
|
||||
wails_generate_bindings(
|
||||
name = name + "_bindings",
|
||||
out_dir = "frontend/src/lib/bindings",
|
||||
package_dir = bindings_package_dir,
|
||||
visibility = visibility,
|
||||
)
|
||||
|
||||
wails_bun_frontend_dev(
|
||||
name = name + "_frontend_dev",
|
||||
data = frontend_srcs,
|
||||
node_modules = node_modules,
|
||||
package_json = package_json,
|
||||
visibility = visibility,
|
||||
)
|
||||
|
||||
wails_run(
|
||||
name = name + "_run",
|
||||
binary = app_binary,
|
||||
build_assets = name + "_build_assets",
|
||||
icon = icon,
|
||||
visibility = visibility,
|
||||
)
|
||||
|
||||
wails_bun_dev_session(
|
||||
name = name + "_dev",
|
||||
workspace_dir = native.package_name() or ".",
|
||||
frontend_dev = name + "_frontend_dev",
|
||||
app_binary = app_binary,
|
||||
build_assets = name + "_build_assets",
|
||||
bindings_target = name + "_bindings",
|
||||
icon = icon,
|
||||
visibility = visibility,
|
||||
)
|
||||
Reference in New Issue
Block a user