crates/holger-ui-build-thing/Cargo.toml
# holger-ui's **build thing**, as the dwarves forge finds it: a `cdylib` named
# `<repo>-build-thing` over `holger-ui-recipe`'s declaration.
#
# ## A SHIM — the recipe is `holger-ui-recipe`
#
# dwarves' code road (`dwarves/crates/dwarves/src/build_thing/code.rs`) looks for
# a package named `<repo>-build-thing` at `crates/<name>` or the repository root
# and REFUSES it unless `[lib] crate-type` contains `cdylib` (a wasm32 build of
# an rlib emits no `.wasm`). So both the name and the crate-type are a contract
# with another repository.
#
# A `cdylib` lib gets no `--extra-filename`, so two units of it overwrite one
# rlib (cargo#6313). NOTHING may depend on this crate: `xtask` depends on
# `holger-ui-recipe`. This crate is the re-export, the wasm ABI macro and the
# `emit` door.
[package]
name = "holger-ui-build-thing"
description = "holger-ui's build thing as the dwarves forge loads it: the wasm32 cdylib exporting nornir-build-thing's plugin ABI over holger-ui-recipe's declaration, plus the `emit` door that writes .nornir/build-variants.toml."
version.workspace = true
edition = "2021"
rust-version = "1.85"
license = "AGPL-3.0-only"
repository = "https://git.gunnar.rs/nordisk/holger-ui"
authors = ["Henrik Torp <henrik@vetra.se>"]
publish = false
[lib]
name = "holger_ui_build_thing"
# The contract with dwarves (header). `cdylib` is the wasm32 plugin; `rlib` is
# what this crate's own `[[bin]]` links.
crate-type = ["cdylib", "rlib"]
[[bin]]
# `cargo run -p holger-ui-build-thing -- emit` is the documented door that writes
# `.nornir/build-variants.toml`; the emitted file's header names that command.
name = "holger-ui-build-thing"
path = "src/main.rs"
[dependencies]
# The recipe. Everything this crate exports is the recipe's, re-exported.
holger-ui-recipe = { version = "3.0.0", path = "../holger-ui-recipe" }
# `export_build_thing!` and the `plugin::BuildThing` trait the macro needs in
# scope — the same entry the recipe uses, so the two cannot resolve to different
# versions of the ABI.
nornir-build-thing = { version = "0.2.0", default-features = false }
anyhow = "1"