summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2018-02-18 20:03:09 +0100
committerGitHub <noreply@github.com>2018-02-18 20:03:09 +0100
commit3341e3640cbdca41343c88ab09bd42fe0b023fa2 (patch)
treeb0e15275bf7333cd8709298836006607e8fe0fe8
parent1d46004da22fb5861aaaa04d7754256f301da1ca (diff)
parent3bd8822f4f62b89aa71f2708c965c2be3fe620ef (diff)
downloadimag-3341e3640cbdca41343c88ab09bd42fe0b023fa2.zip
imag-3341e3640cbdca41343c88ab09bd42fe0b023fa2.tar.gz
Merge pull request #1224 from matthiasbeyer/git-version-in-version
Git version in version
-rw-r--r--bin/core/imag-annotate/Cargo.toml2
-rw-r--r--bin/core/imag-annotate/src/main.rs5
-rw-r--r--bin/core/imag-diagnostics/Cargo.toml2
-rw-r--r--bin/core/imag-diagnostics/src/main.rs5
-rw-r--r--bin/core/imag-edit/Cargo.toml2
-rw-r--r--bin/core/imag-edit/src/main.rs5
-rw-r--r--bin/core/imag-gps/Cargo.toml2
-rw-r--r--bin/core/imag-gps/src/main.rs5
-rw-r--r--bin/core/imag-grep/Cargo.toml2
-rw-r--r--bin/core/imag-grep/src/main.rs5
-rw-r--r--bin/core/imag-init/Cargo.toml2
-rw-r--r--bin/core/imag-link/Cargo.toml2
-rw-r--r--bin/core/imag-link/src/main.rs5
-rw-r--r--bin/core/imag-mv/Cargo.toml2
-rw-r--r--bin/core/imag-mv/src/main.rs5
-rw-r--r--bin/core/imag-ref/Cargo.toml2
-rw-r--r--bin/core/imag-ref/src/main.rs5
-rw-r--r--bin/core/imag-store/Cargo.toml2
-rw-r--r--bin/core/imag-store/src/main.rs5
-rw-r--r--bin/core/imag-tag/Cargo.toml2
-rw-r--r--bin/core/imag-tag/src/main.rs5
-rw-r--r--bin/core/imag-view/Cargo.toml2
-rw-r--r--bin/core/imag-view/src/main.rs5
-rw-r--r--bin/core/imag/Cargo.toml2
-rw-r--r--bin/core/imag/src/main.rs6
-rw-r--r--bin/domain/imag-bookmark/Cargo.toml2
-rw-r--r--bin/domain/imag-bookmark/src/main.rs5
-rw-r--r--bin/domain/imag-contact/Cargo.toml2
-rw-r--r--bin/domain/imag-contact/src/main.rs5
-rw-r--r--bin/domain/imag-diary/Cargo.toml2
-rw-r--r--bin/domain/imag-diary/src/main.rs6
-rw-r--r--bin/domain/imag-habit/Cargo.toml2
-rw-r--r--bin/domain/imag-habit/src/main.rs5
-rw-r--r--bin/domain/imag-log/Cargo.toml2
-rw-r--r--bin/domain/imag-log/src/main.rs5
-rw-r--r--bin/domain/imag-mail/Cargo.toml2
-rw-r--r--bin/domain/imag-mail/src/main.rs5
-rw-r--r--bin/domain/imag-notes/Cargo.toml2
-rw-r--r--bin/domain/imag-notes/src/main.rs5
-rw-r--r--bin/domain/imag-timetrack/Cargo.toml2
-rw-r--r--bin/domain/imag-timetrack/src/main.rs5
-rw-r--r--bin/domain/imag-todo/Cargo.toml2
-rw-r--r--bin/domain/imag-todo/src/main.rs5
-rw-r--r--build.rs34
-rw-r--r--lib/core/libimagrt/src/lib.rs1
-rw-r--r--lib/core/libimagrt/src/version.rs32
46 files changed, 174 insertions, 44 deletions
diff --git a/bin/core/imag-annotate/Cargo.toml b/bin/core/imag-annotate/Cargo.toml
index c825165..b07ecd6 100644
--- a/bin/core/imag-annotate/Cargo.toml
+++ b/bin/core/imag-annotate/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-annotate/src/main.rs b/bin/core/imag-annotate/src/main.rs
index 4bdd944..609deae 100644
--- a/bin/core/imag-annotate/src/main.rs
+++ b/bin/core/imag-annotate/src/main.rs
@@ -39,7 +39,7 @@ extern crate log;
extern crate libimagentryannotation;
extern crate libimagentryedit;
extern crate libimagerror;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagstore;
extern crate libimagutil;
@@ -59,8 +59,9 @@ use libimagutil::warn_exit::warn_exit;
mod ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-annotation",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Add annotations to entries",
ui::build_ui);
diff --git a/bin/core/imag-diagnostics/Cargo.toml b/bin/core/imag-diagnostics/Cargo.toml
index df2bb9f..bf33f9e 100644
--- a/bin/core/imag-diagnostics/Cargo.toml
+++ b/bin/core/imag-diagnostics/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[dependencies]
toml = "0.4"
toml-query = "0.6"
diff --git a/bin/core/imag-diagnostics/src/main.rs b/bin/core/imag-diagnostics/src/main.rs
index 371b1bc..24426e6 100644
--- a/bin/core/imag-diagnostics/src/main.rs
+++ b/bin/core/imag-diagnostics/src/main.rs
@@ -36,7 +36,7 @@ extern crate clap;
extern crate toml;
extern crate toml_query;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagerror;
extern crate libimagentrylink;
extern crate libimagstore;
@@ -92,8 +92,9 @@ impl<'a> From<FileLockEntry<'a>> for Diagnostic {
}
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-diagnostics",
- &env!("CARGO_PKG_VERSION")[..],
+ &version,
"Print diagnostics about imag and the imag store",
ui::build_ui);
diff --git a/bin/core/imag-edit/Cargo.toml b/bin/core/imag-edit/Cargo.toml
index e125a27..b498c42 100644
--- a/bin/core/imag-edit/Cargo.toml
+++ b/bin/core/imag-edit/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-edit/src/main.rs b/bin/core/imag-edit/src/main.rs
index bf05e8e..c69c341 100644
--- a/bin/core/imag-edit/src/main.rs
+++ b/bin/core/imag-edit/src/main.rs
@@ -37,7 +37,7 @@ extern crate clap;
extern crate libimagentryedit;
extern crate libimagerror;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagstore;
extern crate libimagutil;
@@ -52,8 +52,9 @@ use libimagstore::storeid::IntoStoreId;
mod ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-edit",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Edit store entries with $EDITOR",
ui::build_ui);
diff --git a/bin/core/imag-gps/Cargo.toml b/bin/core/imag-gps/Cargo.toml
index f534741..119b4c6 100644
--- a/bin/core/imag-gps/Cargo.toml
+++ b/bin/core/imag-gps/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-gps/src/main.rs b/bin/core/imag-gps/src/main.rs
index 26253e3..0a1dafa 100644
--- a/bin/core/imag-gps/src/main.rs
+++ b/bin/core/imag-gps/src/main.rs
@@ -37,7 +37,7 @@ extern crate clap;
extern crate log;
extern crate libimagentrygps;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagutil;
extern crate libimagerror;
extern crate libimagstore;
@@ -59,8 +59,9 @@ use libimagstore::storeid::IntoStoreId;
mod ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-gps",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Add GPS coordinates to entries",
ui::build_ui);
diff --git a/bin/core/imag-grep/Cargo.toml b/bin/core/imag-grep/Cargo.toml
index 745dca9..d59516d 100644
--- a/bin/core/imag-grep/Cargo.toml
+++ b/bin/core/imag-grep/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-grep/src/main.rs b/bin/core/imag-grep/src/main.rs
index f386880..aba2219 100644
--- a/bin/core/imag-grep/src/main.rs
+++ b/bin/core/imag-grep/src/main.rs
@@ -37,7 +37,7 @@ extern crate clap;
extern crate regex;
extern crate libimagstore;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagerror;
use regex::Regex;
@@ -54,8 +54,9 @@ struct Options {
}
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-grep",
- env!("CARGO_PKG_VERSION"),
+ &version,
"grep through entries text",
ui::build_ui);
diff --git a/bin/core/imag-init/Cargo.toml b/bin/core/imag-init/Cargo.toml
index da9e24d..7eaf6f0 100644
--- a/bin/core/imag-init/Cargo.toml
+++ b/bin/core/imag-init/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-link/Cargo.toml b/bin/core/imag-link/Cargo.toml
index 60f7456..c05fe18 100644
--- a/bin/core/imag-link/Cargo.toml
+++ b/bin/core/imag-link/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-link/src/main.rs b/bin/core/imag-link/src/main.rs
index 28a1077..2266e06 100644
--- a/bin/core/imag-link/src/main.rs
+++ b/bin/core/imag-link/src/main.rs
@@ -39,7 +39,7 @@ extern crate url;
#[cfg(test)] extern crate toml_query;
extern crate libimagentrylink;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagstore;
extern crate libimagerror;
@@ -72,8 +72,9 @@ mod ui;
use ui::build_ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-link",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Link entries",
build_ui);
if rt.cli().is_present("check-consistency") {
diff --git a/bin/core/imag-mv/Cargo.toml b/bin/core/imag-mv/Cargo.toml
index faa0db9..7c38f93 100644
--- a/bin/core/imag-mv/Cargo.toml
+++ b/bin/core/imag-mv/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-mv/src/main.rs b/bin/core/imag-mv/src/main.rs
index 4de0186..fbb5021 100644
--- a/bin/core/imag-mv/src/main.rs
+++ b/bin/core/imag-mv/src/main.rs
@@ -35,7 +35,7 @@
#[macro_use] extern crate log;
extern crate clap;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagstore;
extern crate libimagerror;
extern crate libimagentrylink;
@@ -56,8 +56,9 @@ use libimagentrylink::internal::InternalLinker;
use libimagstore::iter::get::StoreIdGetIteratorExtension;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-mv",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Move things around in the store",
build_ui);
diff --git a/bin/core/imag-ref/Cargo.toml b/bin/core/imag-ref/Cargo.toml
index 29af8fe..b0fb814 100644
--- a/bin/core/imag-ref/Cargo.toml
+++ b/bin/core/imag-ref/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-ref/src/main.rs b/bin/core/imag-ref/src/main.rs
index 3235d1c..3d1339e 100644
--- a/bin/core/imag-ref/src/main.rs
+++ b/bin/core/imag-ref/src/main.rs
@@ -35,7 +35,7 @@
#[macro_use] extern crate log;
extern crate clap;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagentryref;
extern crate libimagerror;
extern crate libimagentrylist;
@@ -56,8 +56,9 @@ use libimagrt::setup::generate_runtime_setup;
use libimagrt::runtime::Runtime;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-ref",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Reference files outside of the store",
build_ui);
rt.cli()
diff --git a/bin/core/imag-store/Cargo.toml b/bin/core/imag-store/Cargo.toml
index 39d3db4..db74694 100644
--- a/bin/core/imag-store/Cargo.toml
+++ b/bin/core/imag-store/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-store/src/main.rs b/bin/core/imag-store/src/main.rs
index bbcb326..2b16b04 100644
--- a/bin/core/imag-store/src/main.rs
+++ b/bin/core/imag-store/src/main.rs
@@ -38,7 +38,7 @@ extern crate toml;
#[cfg(test)] extern crate toml_query;
#[macro_use] extern crate error_chain;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagstore;
extern crate libimagerror;
@@ -76,8 +76,9 @@ use verify::verify;
use ids::ids;
fn main() {
+ let version = make_imag_version!();
let mut rt = generate_runtime_setup("imag-store",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Direct interface to the store. Use with great care!",
build_ui);
diff --git a/bin/core/imag-tag/Cargo.toml b/bin/core/imag-tag/Cargo.toml
index f5059c7..1da7b18 100644
--- a/bin/core/imag-tag/Cargo.toml
+++ b/bin/core/imag-tag/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-tag/src/main.rs b/bin/core/imag-tag/src/main.rs
index 98b1ebd..ea7ca32 100644
--- a/bin/core/imag-tag/src/main.rs
+++ b/bin/core/imag-tag/src/main.rs
@@ -23,7 +23,7 @@ extern crate clap;
#[cfg(test)] extern crate toml;
extern crate libimagstore;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagentrytag;
extern crate libimagerror;
@@ -58,8 +58,9 @@ mod ui;
use ui::build_ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-store",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Direct interface to the store. Use with great care!",
build_ui);
diff --git a/bin/core/imag-view/Cargo.toml b/bin/core/imag-view/Cargo.toml
index 6a98a30..6f3452b 100644
--- a/bin/core/imag-view/Cargo.toml
+++ b/bin/core/imag-view/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag-view/src/main.rs b/bin/core/imag-view/src/main.rs
index ea55c9a..37a02d0 100644
--- a/bin/core/imag-view/src/main.rs
+++ b/bin/core/imag-view/src/main.rs
@@ -41,7 +41,7 @@ extern crate toml_query;
extern crate libimagentryview;
extern crate libimagerror;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagstore;
use std::collections::BTreeMap;
@@ -64,8 +64,9 @@ mod ui;
use ui::build_ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup( "imag-view",
- env!("CARGO_PKG_VERSION"),
+ &version,
"View entries (readonly)",
build_ui);
diff --git a/bin/core/imag/Cargo.toml b/bin/core/imag/Cargo.toml
index 729d033..fcdfb96 100644
--- a/bin/core/imag/Cargo.toml
+++ b/bin/core/imag/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/core/imag/src/main.rs b/bin/core/imag/src/main.rs
index 19f5308..9addf82 100644
--- a/bin/core/imag/src/main.rs
+++ b/bin/core/imag/src/main.rs
@@ -23,7 +23,7 @@ extern crate walkdir;
extern crate toml;
extern crate toml_query;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagerror;
use std::env;
@@ -120,11 +120,11 @@ fn get_commands() -> Vec<String> {
fn main() {
// Initialize the Runtime and build the CLI
let appname = "imag";
- let version = env!("CARGO_PKG_VERSION");
+ let version = make_imag_version!();
let about = "imag - the PIM suite for the commandline";
let commands = get_commands();
let helptext = help_text(commands.clone());
- let mut app = Runtime::get_default_cli_builder(appname, version, about)
+ let mut app = Runtime::get_default_cli_builder(appname, &version, about)
.settings(&[AppSettings::AllowExternalSubcommands, AppSettings::ArgRequiredElseHelp])
.arg(Arg::with_name("version")
.long("version")
diff --git a/bin/domain/imag-bookmark/Cargo.toml b/bin/domain/imag-bookmark/Cargo.toml
index 7a4f97e..4b4ee6a 100644
--- a/bin/domain/imag-bookmark/Cargo.toml
+++ b/bin/domain/imag-bookmark/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/domain/imag-bookmark/src/main.rs b/bin/domain/imag-bookmark/src/main.rs
index e046cf0..d630bac 100644
--- a/bin/domain/imag-bookmark/src/main.rs
+++ b/bin/domain/imag-bookmark/src/main.rs
@@ -38,7 +38,7 @@ extern crate toml;
extern crate toml_query;
extern crate libimagbookmark;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagerror;
extern crate libimagutil;
@@ -59,8 +59,9 @@ mod ui;
use ui::build_ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-bookmark",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Bookmark collection tool",
build_ui);
diff --git a/bin/domain/imag-contact/Cargo.toml b/bin/domain/imag-contact/Cargo.toml
index c3cbf9b..71a4b1c 100644
--- a/bin/domain/imag-contact/Cargo.toml
+++ b/bin/domain/imag-contact/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/domain/imag-contact/src/main.rs b/bin/domain/imag-contact/src/main.rs
index 3f2a0e6..502b41b 100644
--- a/bin/domain/imag-contact/src/main.rs
+++ b/bin/domain/imag-contact/src/main.rs
@@ -43,7 +43,7 @@ extern crate uuid;
extern crate libimagcontact;
extern crate libimagstore;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagerror;
extern crate libimagutil;
extern crate libimaginteraction;
@@ -79,8 +79,9 @@ use util::build_data_object_for_handlebars;
use create::create;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-contact",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Contact management tool",
build_ui);
diff --git a/bin/domain/imag-diary/Cargo.toml b/bin/domain/imag-diary/Cargo.toml
index 1cbb642..35f8180 100644
--- a/bin/domain/imag-diary/Cargo.toml
+++ b/bin/domain/imag-diary/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/domain/imag-diary/src/main.rs b/bin/domain/imag-diary/src/main.rs
index 935630a..1ed4266 100644
--- a/bin/domain/imag-diary/src/main.rs
+++ b/bin/domain/imag-diary/src/main.rs
@@ -43,7 +43,7 @@ extern crate libimagentryedit;
extern crate libimagentrylist;
extern crate libimagerror;
extern crate libimaginteraction;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagstore;
extern crate libimagtimeui;
extern crate libimagutil;
@@ -68,10 +68,10 @@ use ui::build_ui;
use view::view;
fn main() {
+ let version = make_imag_version!();
let name = "imag-diary";
- let version = env!("CARGO_PKG_VERSION");
let about = "Personal Diary/Diaries";
- let ui = build_ui(Runtime::get_default_cli_builder(name, version, about));
+ let ui = build_ui(Runtime::get_default_cli_builder(name, &version, about));
let rt = {
let rt = Runtime::new(ui);
if rt.is_ok() {
diff --git a/bin/domain/imag-habit/Cargo.toml b/bin/domain/imag-habit/Cargo.toml
index 3748e47..56bf662 100644
--- a/bin/domain/imag-habit/Cargo.toml
+++ b/bin/domain/imag-habit/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/domain/imag-habit/src/main.rs b/bin/domain/imag-habit/src/main.rs
index f8fd12e..a3ef565 100644
--- a/bin/domain/imag-habit/src/main.rs
+++ b/bin/domain/imag-habit/src/main.rs
@@ -41,7 +41,7 @@ extern crate chrono;
extern crate libimaghabit;
extern crate libimagstore;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagerror;
extern crate libimagutil;
extern crate libimagentrylist;
@@ -65,8 +65,9 @@ use libimaginteraction::ask::ask_bool;
mod ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-habit",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Habit tracking tool",
ui::build_ui);
diff --git a/bin/domain/imag-log/Cargo.toml b/bin/domain/imag-log/Cargo.toml
index a606c89..2eccb2d 100644
--- a/bin/domain/imag-log/Cargo.toml
+++ b/bin/domain/imag-log/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/domain/imag-log/src/main.rs b/bin/domain/imag-log/src/main.rs
index cf2e4c9..66a34ad 100644
--- a/bin/domain/imag-log/src/main.rs
+++ b/bin/domain/imag-log/src/main.rs
@@ -39,7 +39,7 @@ extern crate toml;
extern crate toml_query;
extern crate libimaglog;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagerror;
extern crate libimagdiary;
@@ -56,8 +56,9 @@ use ui::build_ui;
use toml::Value;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-log",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Overlay to imag-diary to 'log' single lines of text",
build_ui);
diff --git a/bin/domain/imag-mail/Cargo.toml b/bin/domain/imag-mail/Cargo.toml
index dabbe14..2bdd968 100644
--- a/bin/domain/imag-mail/Cargo.toml
+++ b/bin/domain/imag-mail/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/domain/imag-mail/src/main.rs b/bin/domain/imag-mail/src/main.rs
index c05065c..6a018f9 100644
--- a/bin/domain/imag-mail/src/main.rs
+++ b/bin/domain/imag-mail/src/main.rs
@@ -20,7 +20,7 @@
extern crate clap;
#[macro_use] extern crate log;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagmail;
extern crate libimagerror;
extern crate libimagutil;
@@ -36,8 +36,9 @@ mod ui;
use ui::build_ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-mail",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Mail collection tool",
build_ui);
diff --git a/bin/domain/imag-notes/Cargo.toml b/bin/domain/imag-notes/Cargo.toml
index 2370764..d65f68c 100644
--- a/bin/domain/imag-notes/Cargo.toml
+++ b/bin/domain/imag-notes/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/domain/imag-notes/src/main.rs b/bin/domain/imag-notes/src/main.rs
index 321650d..d15a211 100644
--- a/bin/domain/imag-notes/src/main.rs
+++ b/bin/domain/imag-notes/src/main.rs
@@ -22,7 +22,7 @@ extern crate clap;
extern crate itertools;
extern crate libimagnotes;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagentryedit;
extern crate libimagerror;
extern crate libimagutil;
@@ -48,8 +48,9 @@ mod ui;
use ui::build_ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-notes",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Note taking helper",
build_ui);
diff --git a/bin/domain/imag-timetrack/Cargo.toml b/bin/domain/imag-timetrack/Cargo.toml
index 586472f..71fe0e3 100644
--- a/bin/domain/imag-timetrack/Cargo.toml
+++ b/bin/domain/imag-timetrack/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/domain/imag-timetrack/src/main.rs b/bin/domain/imag-timetrack/src/main.rs
index c505446..ef857d5 100644
--- a/bin/domain/imag-timetrack/src/main.rs
+++ b/bin/domain/imag-timetrack/src/main.rs
@@ -29,7 +29,7 @@ extern crate kairos;
extern crate libimagerror;
extern crate libimagstore;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagtimetrack;
extern crate libimagutil;
@@ -58,8 +58,9 @@ use year::year;
use libimagrt::setup::generate_runtime_setup;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-timetrack",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Time tracking module",
build_ui);
diff --git a/bin/domain/imag-todo/Cargo.toml b/bin/domain/imag-todo/Cargo.toml
index 1fcb6bb..053ed55 100644
--- a/bin/domain/imag-todo/Cargo.toml
+++ b/bin/domain/imag-todo/Cargo.toml
@@ -13,6 +13,8 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
repository = "https://github.com/matthiasbeyer/imag"
homepage = "http://imag-pim.org"
+build = "../../../build.rs"
+
[badges]
travis-ci = { repository = "matthiasbeyer/imag" }
is-it-maintained-issue-resolution = { repository = "matthiasbeyer/imag" }
diff --git a/bin/domain/imag-todo/src/main.rs b/bin/domain/imag-todo/src/main.rs
index 656899a..e7f5334 100644
--- a/bin/domain/imag-todo/src/main.rs
+++ b/bin/domain/imag-todo/src/main.rs
@@ -23,7 +23,7 @@ extern crate toml;
extern crate toml_query;
#[macro_use] extern crate is_match;
-extern crate libimagrt;
+#[macro_use] extern crate libimagrt;
extern crate libimagerror;
extern crate libimagtodo;
@@ -39,8 +39,9 @@ mod ui;
use ui::build_ui;
fn main() {
+ let version = make_imag_version!();
let rt = generate_runtime_setup("imag-todo",
- env!("CARGO_PKG_VERSION"),
+ &version,
"Interface with taskwarrior",
build_ui);
diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..c2c4ec6
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,34 @@
+//
+// imag - the personal information management suite for the commandline
+// Copyright (C) 2015-2018 the imag contributors
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; version
+// 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+use std::process::Command;
+fn main() {
+ let profile = String::from(std::env::var("PROFILE").unwrap());
+ let git_version = if profile == "debug" {
+ let output = Command::new("git")
+ .args(&["describe", "HEAD"])
+ .output()
+ .unwrap();
+ String::from_utf8(output.stdout).unwrap()
+ } else {
+ String::from("")
+ };
+
+ println!("cargo:rustc-env=CARGO_BUILD_VERSION={}", git_version);
+}
diff --git a/lib/core/libimagrt/src/lib.rs b/lib/core/libimagrt/src/lib.rs
index b7336ab..b6c6e73 100644
--- a/lib/core/libimagrt/src/lib.rs
+++ b/lib/core/libimagrt/src/lib.rs
@@ -59,4 +59,5 @@ pub mod logger;
pub mod runtime;
pub mod setup;
pub mod spec;
+pub mod version;
diff --git a/lib/core/libimagrt/src/version.rs b/lib/core/libimagrt/src/version.rs
new file mode 100644
index 0000000..10e034b
--- /dev/null
+++ b/lib/core/libimagrt/src/version.rs
@@ -0,0 +1,32 @@
+//
+// imag - the personal information management suite for the commandline
+// Copyright (C) 2015-2018 Matthias Beyer <mail@beyermatthias.de> and contributors
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; version
+// 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+
+#[macro_export]
+macro_rules! make_imag_version {
+ () => {{
+ let pkg_version = env!("CARGO_PKG_VERSION");
+ let git_version = env!("CARGO_BUILD_VERSION");
+
+ if git_version == "" {
+ String::from(pkg_version)
+ } else {
+ String::from(git_version)
+ }
+ }}
+}