This commit is contained in:
parent
e57294ff4c
commit
914ee4b637
1571
Cargo.lock
generated
1571
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -3,7 +3,7 @@ name = "hoc"
|
||||
version = "0.33.0"
|
||||
authors = ["Valentin Brandl <vbrandl@riseup.net>"]
|
||||
edition = "2021"
|
||||
build = "build.rs"
|
||||
build = "src/build.rs"
|
||||
|
||||
[lib]
|
||||
path = "src/lib.rs"
|
||||
@ -37,8 +37,9 @@ tracing-log = "0.1.3"
|
||||
tracing-subscriber = { version = "0.3.16", features = ["registry", "env-filter"] }
|
||||
|
||||
[build-dependencies]
|
||||
anyhow = "1.0.70"
|
||||
ructe = { version = "0.16.1", features = ["mime03"] }
|
||||
vergen = { version = "8.1.1", default-features = false, features = ["git"] }
|
||||
vergen = { version = "8.1.1", default-features = false, features = ["git", "gitoxide"] }
|
||||
|
||||
[dev-dependencies]
|
||||
awc = "3.1.1"
|
||||
|
15
build.rs
15
build.rs
@ -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")
|
||||
}
|
14
src/build.rs
Normal file
14
src/build.rs
Normal file
@ -0,0 +1,14 @@
|
||||
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")?)
|
||||
}
|
@ -4,7 +4,7 @@ pub struct VersionInfo<'a> {
|
||||
}
|
||||
|
||||
pub(crate) const VERSION_INFO: VersionInfo = VersionInfo {
|
||||
commit: env!("VERGEN_GIT_SHA_SHORT"),
|
||||
commit: env!("VERGEN_GIT_SHA"),
|
||||
version: env!("CARGO_PKG_VERSION"),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user