feat: load package version during build

This removes the duplication of the version string between the `Cargo.toml` and `constants.rs`
This commit is contained in:
dignifiedquire
2019-08-14 09:48:06 +02:00
committed by holger krekel
parent 7d51c6e4f4
commit 99aabef7f3
4 changed files with 16 additions and 8 deletions

View File

@@ -1,8 +1,13 @@
//! Constants
#![allow(non_camel_case_types)]
use lazy_static::lazy_static;
use deltachat_derive::*;
pub const DC_VERSION_STR: &[u8; 14] = b"1.0.0-alpha.3\x00";
lazy_static! {
pub static ref DC_VERSION_STR: String = env!("CARGO_PKG_VERSION").to_string();
}
#[repr(u8)]
#[derive(Debug, Display, Clone, Copy, PartialEq, Eq, FromPrimitive, ToPrimitive, ToSql, FromSql)]