update to shadow-rs 0.5. make use easy (#2793)

* update to shadow-rs 0.4. use easy

* update shadow-rs to 0.5

* fix version not used

* update

* update Cargo.lock

* update Cargo.lock

* fix wasm build error when use dependence git2
fix error link:https://dev.azure.com/nushell/nushell/_build/results?buildId=4858&view=logs&j=1a745d4c-b027-5f34-06d8-d6f256bfe9f9&t=a0a335cb-fa1f-5bbf-be01-1a90d6899e54
This commit is contained in:
Rust大闸蟹 2020-12-24 00:56:05 +08:00 committed by GitHub
parent f22938fc4a
commit d2a00a2daa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

12
Cargo.lock generated
View File

@ -1919,9 +1919,9 @@ checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce"
[[package]]
name = "git2"
version = "0.13.12"
version = "0.13.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca6f1a0238d7f8f8fd5ee642f4ebac4dbc03e03d1f78fbe7a3ede35dcf7e2224"
checksum = "802b535f89475f22bb2b3d589de07861417e67b1a358c7ec8e5005bf4f209133"
dependencies = [
"bitflags",
"libc",
@ -2573,9 +2573,9 @@ checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614"
[[package]]
name = "libgit2-sys"
version = "0.12.14+1.1.0"
version = "0.12.15+1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f25af58e6495f7caf2919d08f212de550cfa3ed2f5e744988938ea292b9f549"
checksum = "48c39622f3887bc7fb2fff6d06293f64b02c1dfa281212566ac155171d13b0eb"
dependencies = [
"cc",
"libc",
@ -5183,9 +5183,9 @@ dependencies = [
[[package]]
name = "shadow-rs"
version = "0.3.20"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa99d59fca26677e3582f69069226abb6b2ce7e02d1068bcfd57510fa16ab87"
checksum = "b5ee6ecc8237a62951c2e5c871aa86799ba8a9bf909b5567129858039ae63e87"
dependencies = [
"chrono",
"git2",

View File

@ -118,7 +118,7 @@ optional = true
version = "0.24.2"
[build-dependencies]
shadow-rs = "0.3.20"
shadow-rs = "0.5"
[dev-dependencies]
quickcheck = "0.9.2"

View File

@ -1,6 +1,3 @@
fn main() -> shadow_rs::SdResult<()> {
let src_path = std::env::var("CARGO_MANIFEST_DIR")?;
let out_path = std::env::var("OUT_DIR")?;
shadow_rs::Shadow::build(src_path, out_path)?;
Ok(())
shadow_rs::new()
}

View File

@ -7,6 +7,7 @@ use nu_protocol::{value::StrExt, value::StringExt, Dictionary, Signature, Untagg
pub mod shadow {
include!(concat!(env!("OUT_DIR"), "/shadow.rs"));
}
pub struct Version;
#[async_trait]
@ -152,6 +153,8 @@ pub fn version(args: CommandArgs) -> Result<OutputStream, ShellError> {
// }
let _project_name = shadow::PROJECT_NAME;
let _version = shadow::version();
let build_time: Option<&str> = Some(shadow::BUILD_TIME).filter(|x| !x.is_empty());
if let Some(build_time) = build_time {
indexmap.insert(