Merge pull request #592 from vbrandl/dependabot/cargo/vergen-8.1.1

chore(deps): Bump vergen from 7.5.1 to 8.1.1
This commit is contained in:
Valentin Brandl 2023-04-13 12:08:51 +02:00 committed by GitHub
commit fd3746e781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1107 additions and 550 deletions

1623
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ name = "hoc"
version = "0.33.0" version = "0.33.0"
authors = ["Valentin Brandl <vbrandl@riseup.net>"] authors = ["Valentin Brandl <vbrandl@riseup.net>"]
edition = "2021" edition = "2021"
build = "build.rs" build = "src/build.rs"
[lib] [lib]
path = "src/lib.rs" path = "src/lib.rs"
@ -37,8 +37,9 @@ tracing-log = "0.1.3"
tracing-subscriber = { version = "0.3.16", features = ["registry", "env-filter"] } tracing-subscriber = { version = "0.3.16", features = ["registry", "env-filter"] }
[build-dependencies] [build-dependencies]
anyhow = "1.0.70"
ructe = { version = "0.16.1", features = ["mime03"] } ructe = { version = "0.16.1", features = ["mime03"] }
vergen = { version = "7.5.1", default-features = false, features = ["git"] } vergen = { version = "8.1.1", default-features = false, features = ["git", "gitoxide"] }
[dev-dependencies] [dev-dependencies]
awc = "3.1.1" awc = "3.1.1"

View File

@ -1,15 +0,0 @@
extern crate ructe;
extern crate vergen;
use ructe::{Ructe, RucteError};
use vergen::{vergen, Config, ShaKind};
fn main() -> Result<(), RucteError> {
let mut config = Config::default();
*config.git_mut().sha_kind_mut() = ShaKind::Short;
vergen(config).expect("Unable to generate static repo info");
let mut ructe = Ructe::from_env()?;
let mut statics = ructe.statics()?;
statics.add_files("static")?;
ructe.compile_templates("templates")
}

12
src/build.rs Normal file
View File

@ -0,0 +1,12 @@
use anyhow::Result;
use ructe::Ructe;
use vergen::EmitBuilder;
fn main() -> Result<()> {
EmitBuilder::builder().git_sha(true).emit()?;
let mut ructe = Ructe::from_env()?;
let mut statics = ructe.statics()?;
statics.add_files("static")?;
Ok(ructe.compile_templates("templates")?)
}

View File

@ -4,7 +4,7 @@ pub struct VersionInfo<'a> {
} }
pub(crate) const VERSION_INFO: VersionInfo = VersionInfo { pub(crate) const VERSION_INFO: VersionInfo = VersionInfo {
commit: env!("VERGEN_GIT_SHA_SHORT"), commit: env!("VERGEN_GIT_SHA"),
version: env!("CARGO_PKG_VERSION"), version: env!("CARGO_PKG_VERSION"),
}; };