File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ static-files = "0.2.1"
5757cargo_toml = " 0.11.5"
5858ureq = " 2.5.0"
5959sha1_smol = { version = " 1.0.0" , features =[" std" ] }
60+ vergen = { version = " 7.4.2" , features = [" build" , " git" ] }
6061zip = { git = " https://github.com/zip-rs/zip" }
6162
6263[dev-dependencies ]
Original file line number Diff line number Diff line change 1616 *
1717 */
1818
19+ use vergen:: { vergen, Config } ;
20+
1921fn main ( ) {
22+ // Init vergen
23+ if let Err ( e) = vergen ( Config :: default ( ) ) {
24+ println ! (
25+ "cargo:warning=initializing vergen failed due to error: {}" ,
26+ e
27+ ) ;
28+ }
29+
2030 println ! ( "cargo:rerun-if-changed=build.rs" ) ;
2131 println ! ( "cargo:rerun-if-changed=Cargo.toml" ) ;
2232 println ! ( "cargo:rerun-if-env-changed=LOCAL_ASSETS_PATH" ) ;
Original file line number Diff line number Diff line change @@ -92,8 +92,8 @@ pub mod version {
9292 }
9393
9494 fn current_version ( ) -> Version {
95- let current_version = env ! ( "CARGO_PKG_VERSION " ) ;
96- semver:: Version :: parse ( current_version) . expect ( "CARGO_PKG_VERSION is always valid semver" )
95+ let current_version = env ! ( "VERGEN_BUILD_SEMVER " ) ;
96+ semver:: Version :: parse ( current_version) . expect ( "VERGEN_BUILD_SEMVER is always valid semver" )
9797 }
9898
9999 fn humanize_time ( time_passed : Duration ) -> String {
You can’t perform that action at this time.
0 commit comments