From 3d5d219a8c016673c2e73caabbc08c08aeeec847 Mon Sep 17 00:00:00 2001 From: hzhou Date: Thu, 24 Sep 2020 17:26:58 +0800 Subject: [PATCH] version --- .gitignore | 4 ++++ Cargo.lock | 3 ++- Cargo.toml | 7 ++++++- build.rs | 3 +++ libs/hbb_common | 2 +- src/hbbr/main.rs | 2 +- src/lib.rs | 2 ++ src/main.rs | 4 ++-- 8 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 build.rs diff --git a/.gitignore b/.gitignore index 53eaa21..892f3d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ /target **/*.rs.bk +version.rs +sled.db +hbbs.sh +hbbs.conf diff --git a/Cargo.lock b/Cargo.lock index c127648..07ed9c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -476,8 +476,9 @@ dependencies = [ [[package]] name = "hbbs" -version = "0.1.0" +version = "1.0.0" dependencies = [ + "cc 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)", "hbb_common 0.1.0", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index bd323c9..b4f200e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,9 @@ [package] name = "hbbs" -version = "0.1.0" +version = "1.0.0" authors = ["open-trade "] edition = "2018" +build= "build.rs" [[bin]] name = "hbbr" @@ -20,6 +21,10 @@ lazy_static = "1.4" clap = "2.33" rust-ini = "0.15" +[build-dependencies] +cc = "1.0" +hbb_common = { path = "libs/hbb_common" } + [workspace] members = ["libs/hbb_common"] diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..6259a53 --- /dev/null +++ b/build.rs @@ -0,0 +1,3 @@ +fn main() { + hbb_common::gen_version(); +} diff --git a/libs/hbb_common b/libs/hbb_common index 311c388..fae9789 160000 --- a/libs/hbb_common +++ b/libs/hbb_common @@ -1 +1 @@ -Subproject commit 311c3881d18589a382f07c2d572d00123fd0b295 +Subproject commit fae9789b30fea0ff90f05e319002ca1c48b529c7 diff --git a/src/hbbr/main.rs b/src/hbbr/main.rs index 05feced..a75c346 100644 --- a/src/hbbr/main.rs +++ b/src/hbbr/main.rs @@ -28,7 +28,7 @@ async fn main() -> ResultType<()> { DEFAULT_PORT ); let matches = App::new("hbbr") - .version("1.0") + .version(hbbs::VERSION) .author("Zhou Huabing ") .about("RustDesk Relay Server") .args_from_usage(&args) diff --git a/src/lib.rs b/src/lib.rs index ae049bb..72f8347 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,3 +2,5 @@ mod rendezvous_server; mod sled_async; use sled_async::*; pub use rendezvous_server::*; +mod version; +pub use version::*; diff --git a/src/main.rs b/src/main.rs index c66bb9c..43c6ef2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,14 +13,14 @@ async fn main() -> ResultType<()> { let args = format!( "-c --config=[FILE] +takes_value 'Sets a custom config file' -p, --port=[NUMBER(default={})] 'Sets the listening port' - -s, --serial=[NUMBER(default={0})] 'Sets configure update serial number' + -s, --serial=[NUMBER(default=0)] 'Sets configure update serial number' -R, --rendezvous-servers=[HOSTS] 'Sets rendezvous servers, seperated by colon' -u, --software-url=[URL] 'Sets download url of RustDesk software of newest version' -r, --relay-server=[HOST] 'Sets the default relay server'", DEFAULT_PORT ); let matches = App::new("hbbs") - .version("1.0") + .version(crate::VERSION) .author("Zhou Huabing ") .about("RustDesk Rendezvous Server") .args_from_usage(&args)