Merge pull request #1011 from matthiasbeyer/integrate-0.3.0-patches
Integrate 0.3.0 patches
This commit is contained in:
commit
764ff6ea96
6 changed files with 18 additions and 111 deletions
|
@ -13,8 +13,6 @@ documentation = "https://matthiasbeyer.github.io/imag/imag_documentation/index.h
|
||||||
repository = "https://github.com/matthiasbeyer/imag"
|
repository = "https://github.com/matthiasbeyer/imag"
|
||||||
homepage = "http://imag-pim.org"
|
homepage = "http://imag-pim.org"
|
||||||
|
|
||||||
build = "build.rs"
|
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
clap = ">=2.16.1"
|
clap = ">=2.16.1"
|
||||||
version = "2.0"
|
version = "2.0"
|
||||||
|
|
103
bin/build.rs
103
bin/build.rs
|
@ -1,103 +0,0 @@
|
||||||
//
|
|
||||||
// imag - the personal information management suite for the commandline
|
|
||||||
// Copyright (C) 2015, 2016 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
|
|
||||||
//
|
|
||||||
|
|
||||||
extern crate clap;
|
|
||||||
extern crate libimagrt;
|
|
||||||
extern crate libimagentrytag;
|
|
||||||
extern crate libimagutil;
|
|
||||||
#[macro_use] extern crate version;
|
|
||||||
|
|
||||||
use clap::Shell;
|
|
||||||
use libimagrt::runtime::Runtime;
|
|
||||||
|
|
||||||
/// This macro generates mods with the given '$modulename',
|
|
||||||
/// whose content is the file given with `$path`.
|
|
||||||
/// In this case, It is used specifically to include the
|
|
||||||
/// `ui.rs` files of the imag binaries.
|
|
||||||
/// The imag project (accidentally?) followed the convention
|
|
||||||
/// to write a `ui.rs` containing the function
|
|
||||||
/// `fn build_ui(app : App) -> App`.
|
|
||||||
/// This macro allows us to use the same named functions by
|
|
||||||
/// putting them each into their own module.
|
|
||||||
macro_rules! gen_mods_buildui {
|
|
||||||
($(($path:expr, $modulename:ident)$(,)*)*) => (
|
|
||||||
$(
|
|
||||||
mod $modulename {
|
|
||||||
include!($path);
|
|
||||||
}
|
|
||||||
)*
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// This macro reduces boilerplate code.
|
|
||||||
///
|
|
||||||
/// For example: `build_subcommand!("counter", imagcounter)`
|
|
||||||
/// will result in the following code:
|
|
||||||
/// ```ignore
|
|
||||||
/// imagcounter::build_ui(Runtime::get_default_cli_builder(
|
|
||||||
/// "counter",
|
|
||||||
/// &version!()[..],
|
|
||||||
/// "counter"))
|
|
||||||
/// ```
|
|
||||||
/// As for the `&version!()[..]` part, it does not matter
|
|
||||||
/// which version the subcommand is getting here, as the
|
|
||||||
/// output of this script is a completion script, which
|
|
||||||
/// does not contain information about the version at all.
|
|
||||||
macro_rules! build_subcommand {
|
|
||||||
($name:expr, $module:ident) => (
|
|
||||||
$module::build_ui(Runtime::get_default_cli_builder(
|
|
||||||
$name,
|
|
||||||
&version!()[..],
|
|
||||||
$name))
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Actually generates the module.
|
|
||||||
gen_mods_buildui!(
|
|
||||||
("../imag-link/src/ui.rs", imaglink),
|
|
||||||
("../imag-notes/src/ui.rs", imagnotes),
|
|
||||||
("../imag-ref/src/ui.rs", imagref),
|
|
||||||
("../imag-store/src/ui.rs", imagstore),
|
|
||||||
("../imag-tag/src/ui.rs", imagtag),
|
|
||||||
("../imag-view/src/ui.rs", imagview)
|
|
||||||
);
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
// Make the `imag`-App...
|
|
||||||
let mut app = Runtime::get_default_cli_builder(
|
|
||||||
"imag",
|
|
||||||
&version!()[..],
|
|
||||||
"imag")
|
|
||||||
// and add all the subapps as subcommands.
|
|
||||||
.subcommand(build_subcommand!("link", imaglink))
|
|
||||||
.subcommand(build_subcommand!("notes", imagnotes))
|
|
||||||
.subcommand(build_subcommand!("ref", imagref))
|
|
||||||
.subcommand(build_subcommand!("store", imagstore))
|
|
||||||
.subcommand(build_subcommand!("tag", imagtag))
|
|
||||||
.subcommand(build_subcommand!("view", imagview));
|
|
||||||
|
|
||||||
let outdir = std::env::var("OUT_DIR").unwrap();
|
|
||||||
|
|
||||||
// Actually generates the completion files
|
|
||||||
app.gen_completions("imag", Shell::Bash, outdir.clone());
|
|
||||||
app.gen_completions("imag", Shell::Fish, outdir.clone());
|
|
||||||
app.gen_completions("imag", Shell::Zsh, outdir);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -3,6 +3,12 @@ name = "imag-mail"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
authors = ["Matthias Beyer <mail@beyermatthias.de>"]
|
authors = ["Matthias Beyer <mail@beyermatthias.de>"]
|
||||||
|
|
||||||
|
description = "Part of the imag core distribution: imag-notes command"
|
||||||
|
|
||||||
|
keywords = ["imag", "PIM", "personal", "information", "management"]
|
||||||
|
readme = "../README.md"
|
||||||
|
license = "LGPL-2.1"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
semver = "0.5"
|
semver = "0.5"
|
||||||
clap = "2.*"
|
clap = "2.*"
|
||||||
|
|
|
@ -3,6 +3,12 @@ name = "libimagannotation"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
authors = ["Matthias Beyer <mail@beyermatthias.de>"]
|
authors = ["Matthias Beyer <mail@beyermatthias.de>"]
|
||||||
|
|
||||||
|
description = "Library for the imag core distribution"
|
||||||
|
|
||||||
|
keywords = ["imag", "PIM", "personal", "information", "management"]
|
||||||
|
readme = "../README.md"
|
||||||
|
license = "LGPL-2.1"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
uuid = { version = "0.3.1", features = ["v4"] }
|
uuid = { version = "0.3.1", features = ["v4"] }
|
||||||
lazy_static = "0.1.15"
|
lazy_static = "0.1.15"
|
||||||
|
|
|
@ -19,12 +19,12 @@ toml = "0.4"
|
||||||
toml-query = "0.3"
|
toml-query = "0.3"
|
||||||
is-match = "0.1"
|
is-match = "0.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
env_logger = "0.4"
|
|
||||||
|
|
||||||
[dependencies.libimagerror]
|
[dependencies.libimagerror]
|
||||||
path = "../libimagerror"
|
path = "../libimagerror"
|
||||||
|
|
||||||
[dependencies.libimagstore]
|
[dependencies.libimagstore]
|
||||||
path = "../libimagstore"
|
path = "../libimagstore"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
env_logger = "0.4"
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,6 @@ toml-query = "0.3"
|
||||||
lazy_static = "0.2"
|
lazy_static = "0.2"
|
||||||
toml = "0.4"
|
toml = "0.4"
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
is-match = "0.1"
|
|
||||||
|
|
||||||
[dependencies.libimagerror]
|
[dependencies.libimagerror]
|
||||||
path = "../libimagerror"
|
path = "../libimagerror"
|
||||||
|
|
||||||
|
@ -31,3 +28,6 @@ path = "../libimagstore"
|
||||||
[dependencies.libimagutil]
|
[dependencies.libimagutil]
|
||||||
path = "../libimagutil"
|
path = "../libimagutil"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
is-match = "0.1"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue