Include git commit date & hash.

This commit is contained in:
Gav Wood
2016-02-21 21:14:09 +01:00
parent 22ff5bb7d7
commit ea187253a2
5 changed files with 30 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ license = "GPL-3.0"
name = "ethcore-util"
version = "0.9.99"
authors = ["Ethcore <admin@ethcore.io>"]
build = "build.rs"
[dependencies]
log = "0.3"
@@ -28,12 +29,15 @@ sha3 = { path = "sha3" }
serde = "0.6.7"
clippy = { version = "0.0.42", optional = true }
json-tests = { path = "json-tests" }
target_info = "0.1.0"
rustc_version = "0.1.0"
igd = "0.4.2"
ethcore-devtools = { path = "../devtools" }
libc = "0.2.7"
vergen = "*"
[features]
default = []
dev = ["clippy"]
[build-dependencies]
vergen = "*"

6
util/build.rs Normal file
View File

@@ -0,0 +1,6 @@
extern crate vergen;
use vergen::*;
fn main() {
vergen(OutputFns::all()).unwrap();
}

View File

@@ -82,7 +82,6 @@
//! cargo build --release
//! ```
extern crate target_info;
extern crate slab;
extern crate rustc_serialize;
extern crate mio;
@@ -109,6 +108,7 @@ extern crate igd;
extern crate ethcore_devtools as devtools;
extern crate libc;
extern crate rustc_version;
extern crate vergen;
pub mod standard;
#[macro_use]

View File

@@ -18,9 +18,10 @@
use std::fs::File;
use common::*;
use target_info::Target;
use rustc_version;
include!(concat!(env!("OUT_DIR"), "/version.rs"));
#[derive(Debug,Clone,PartialEq,Eq)]
/// Diff type for specifying a change (or not).
pub enum Diff<T> where T: Eq {
@@ -67,5 +68,5 @@ pub fn contents(name: &str) -> Result<Bytes, UtilError> {
/// Get the standard version string for this software.
pub fn version() -> String {
format!("Parity/-/{}/{}-{}-{}/{}", env!("CARGO_PKG_VERSION"), Target::arch(), Target::env(), Target::os(), rustc_version::version())
format!("Parity/{}/{}-{}/{}/rustc{}", env!("CARGO_PKG_VERSION"), short_sha(), commit_date(), target(), rustc_version::version())
}