mirror of
https://github.com/zap-proto/rust.git
synced 2026-10-30 15:04:23 +00:00
Surgical follow-up to the capnp→zap rename, sweeping branding leftovers the prior pass missed. Display/identity + own-project URLs only; no library symbols, deps, or wire-protocol semantics touched. - blog/index.html: title + H1 "Cap'n Proto for Rust" → "ZAP for Rust"; upstream repo link → github.com/zap-proto/rust; docs link → docs.rs/zap (matches crate `documentation` field). Aligns with blog/_config.yml which already reads "ZAP for Rust". - blog/_layouts/post.html: footer self-link capnproto/capnproto-rust → zap-proto/rust. - blog/css/syntax.css: highlighter class .language-capnp → .language-zap. - benchmark/build.rs: regen doc comment now drives the `zap` CLI. - example/addressbook_send/README.md: "Cap'N Proto messages" → "ZAP messages" (file already used the `zap`/`libzap-dev` binaries). - zap-rpc/schema/rpc.zap: two orphaned "Cap'n-Proto-based" comment phrases → "ZAP-based" (comment-only; the paragraph already says ZAP). - rename regenerate-capnp-schema-code.sh → regenerate-zap-schema-code.sh. Preserved as honest attribution / library refs: LLM.md lineage note, zap-futures/CONTRIBUTORS upstream PR link, benchmark "Cap'n-Proto-derived" test-case credit, kj:: types in historical blog posts, dated 2014 blog post prose, upstream copyrights.
26 lines
1.0 KiB
Rust
26 lines
1.0 KiB
Rust
// build.rs — copy pre-generated schema-bound Rust into OUT_DIR.
|
|
//
|
|
// No schema compiler invoked at build time. The schemas were compiled
|
|
// once during development and the generated *_zap.rs files are checked
|
|
// into the source tree alongside the schemas. This means: zero build-
|
|
// time dependency on any external compiler, instant builds, fully
|
|
// reproducible.
|
|
//
|
|
// To regenerate from .zap schemas (developer task):
|
|
// 1. install the zapc binary: `cargo install --path ../zapc`
|
|
// 2. compile via: `zap compile -orust *.zap`
|
|
// (the zapc binary is the codegen plugin invoked by the zap CLI's
|
|
// schema parser frontend; neither is linked at build time)
|
|
|
|
use std::{env, fs, path::Path};
|
|
|
|
fn main() {
|
|
let out_dir = env::var("OUT_DIR").unwrap();
|
|
for name in ["carsales_zap", "catrank_zap", "eval_zap"] {
|
|
let src = format!("{}.rs", name);
|
|
let dst = Path::new(&out_dir).join(&src);
|
|
fs::copy(&src, &dst).expect(&format!("copy {}", src));
|
|
println!("cargo:rerun-if-changed={}", src);
|
|
}
|
|
}
|