tinymist/crates/tinymist-core/build.rs
Myriad-Dreamin d32f6261f1
feat: build tinymist targeting web (#1102)
* feat: add web target

* dev: simple package rule

* dev: update web release

* dev: update workspace

* ci: setup wasm pack

* ci: correct path to upload

* ci: build artifact

* fix: update metadata and launch config
2025-01-03 10:30:38 +08:00

31 lines
794 B
Rust

//! Generates project metadata.
use anyhow::Result;
use vergen::EmitBuilder;
fn main() -> Result<()> {
// Emit the instructions
EmitBuilder::builder()
.all_cargo()
.build_timestamp()
.git_sha(false)
.git_describe(true, true, None)
.all_rustc()
.emit()?;
let metadata = cargo_metadata::MetadataCommand::new().exec().unwrap();
let typst = metadata
.packages
.iter()
.find(|package| package.name == "typst")
.expect("Typst should be a dependency");
println!("cargo:rustc-env=TYPST_VERSION={}", typst.version);
let src = typst
.source
.as_ref()
.map(|e| e.repr.as_str())
.unwrap_or_default();
println!("cargo:rustc-env=TYPST_SOURCE={src}");
Ok(())
}