mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-11-21 12:18:32 +00:00
Some checks are pending
tinymist::auto_tag / auto-tag (push) Waiting to run
tinymist::ci / Duplicate Actions Detection (push) Waiting to run
tinymist::ci / Check Clippy, Formatting, Completion, Documentation, and Tests (Linux) (push) Waiting to run
tinymist::ci / Check Minimum Rust version and Tests (Windows) (push) Waiting to run
tinymist::ci / prepare-build (push) Waiting to run
tinymist::ci / announce (push) Blocked by required conditions
tinymist::ci / build (push) Blocked by required conditions
tinymist::gh_pages / build-gh-pages (push) Waiting to run
31 lines
794 B
Rust
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(())
|
|
}
|