git.delta.rocks / jrsonnet / refs/commits / 3ee61c42d34d

difftreelog

source

crates/jrsonnet-stdlib/build.rs538 Bsourcehistory
1use std::{borrow::Cow, env, fs::File, io::Write, path::Path};23use bincode::serialize;4use jrsonnet_parser::{parse, ParserSettings, Source};56fn main() {7	let parsed = parse(8		include_str!("./src/std.jsonnet"),9		&ParserSettings {10			file_name: Source::new_virtual(Cow::Borrowed("<std>")),11		},12	)13	.expect("parse");1415	{16		let out_dir = env::var("OUT_DIR").unwrap();17		let dest_path = Path::new(&out_dir).join("stdlib.bincode");18		let mut f = File::create(&dest_path).unwrap();19		f.write_all(&serialize(&parsed).unwrap()).unwrap();20	}21}