Kevin Flansburg f3eb1eb535
Experimental RPC Support (#551)
* Prototyping

* rpc client example

* Prototype WIT codegen

* Documentation

* Final tweaks
2024-04-28 18:44:12 -04:00

14 lines
452 B
Rust

use std::env::var;
use worker_codegen::wit::expand_wit_source;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Tell Cargo that if the given file changes, to rerun this build script.
println!("cargo::rerun-if-changed=wit/calculator.wit");
let source = expand_wit_source("wit/calculator.wit")?;
let out_dir = var("OUT_DIR")?;
let dest = format!("{}/calculator.rs", out_dir);
std::fs::write(dest, source)?;
Ok(())
}