Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Include git commit date & hash. #486

Merged
merged 2 commits into from
Feb 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 15 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 = "0.1"

[features]
default = []
dev = ["clippy"]

[build-dependencies]
vergen = "*"
6 changes: 6 additions & 0 deletions util/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extern crate vergen;
use vergen::*;

fn main() {
vergen(OutputFns::all()).unwrap();
}
2 changes: 1 addition & 1 deletion util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
//! cargo build --release
//! ```

extern crate target_info;
extern crate slab;
extern crate rustc_serialize;
extern crate mio;
Expand All @@ -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]
Expand Down
5 changes: 3 additions & 2 deletions util/src/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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())
}