Merge branch 'master' into conditional-style

This commit is contained in:
Filip Bachul 2023-03-28 13:06:29 +02:00
commit 5a30c0976e
4 changed files with 57 additions and 33 deletions

53
Cargo.lock generated
View File

@ -265,12 +265,22 @@ dependencies = [
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.1.13" version = "4.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c911b090850d79fc64fe9ea01e28e465f65e821e08813ced95bced72f7a8a9b" checksum = "906f7fe1da4185b7a282b2bc90172a496f9def1aca4545fe7526810741591e14"
dependencies = [
"clap_builder",
"clap_derive",
"once_cell",
]
[[package]]
name = "clap_builder"
version = "4.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "351f9ad9688141ed83dfd8f5fb998a06225ef444b48ff4dc43de6d409b7fd10b"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"clap_derive",
"clap_lex", "clap_lex",
"is-terminal", "is-terminal",
"once_cell", "once_cell",
@ -282,18 +292,18 @@ dependencies = [
[[package]] [[package]]
name = "clap_complete" name = "clap_complete"
version = "4.1.5" version = "4.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37686beaba5ac9f3ab01ee3172f792fc6ffdd685bfb9e63cfef02c0571a4e8e1" checksum = "40d3120a421cd111c43f1a6c7d0dd83bb6aaa0659c164468a1654014632a5ec6"
dependencies = [ dependencies = [
"clap", "clap",
] ]
[[package]] [[package]]
name = "clap_derive" name = "clap_derive"
version = "4.1.12" version = "4.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a932373bab67b984c790ddf2c9ca295d8e3af3b7ef92de5a5bacdccdee4b09b" checksum = "81d7dc0031c3a59a04fc2ba395c8e2dd463cba1859275f065d225f6122221b45"
dependencies = [ dependencies = [
"heck 0.4.0", "heck 0.4.0",
"proc-macro2", "proc-macro2",
@ -303,12 +313,9 @@ dependencies = [
[[package]] [[package]]
name = "clap_lex" name = "clap_lex"
version = "0.3.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" checksum = "4f0807fb6f644c83f3e4ec014fec9858c1c8b26a7db8eb5f0bde5817df9c1df7"
dependencies = [
"os_str_bytes",
]
[[package]] [[package]]
name = "clru" name = "clru"
@ -1945,12 +1952,6 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "os_str_bytes"
version = "6.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff"
[[package]] [[package]]
name = "parking" name = "parking"
version = "2.0.0" version = "2.0.0"
@ -2348,9 +2349,9 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.7.2" version = "1.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cce168fea28d3e05f158bda4576cf0c844d5045bc2cc3620fa0292ed5bb5814c" checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -2465,18 +2466,18 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.158" version = "1.0.159"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.158" version = "1.0.159"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -2496,9 +2497,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.94" version = "1.0.95"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744"
dependencies = [ dependencies = [
"itoa", "itoa",
"ryu", "ryu",

View File

@ -43,8 +43,8 @@ gix-faster = ["gix-features/zlib-stock", "gix/fast-sha1"]
[dependencies] [dependencies]
chrono = { version = "0.4.24", default-features = false, features = ["clock", "std", "wasmbind"] } chrono = { version = "0.4.24", default-features = false, features = ["clock", "std", "wasmbind"] }
clap = { version = "4.1.13", features = ["derive", "cargo", "unicode"] } clap = { version = "4.1.14", features = ["derive", "cargo", "unicode"] }
clap_complete = "4.1.5" clap_complete = "4.1.6"
dirs-next = "2.0.0" dirs-next = "2.0.0"
dunce = "1.0.3" dunce = "1.0.3"
gethostname = "0.4.1" gethostname = "0.4.1"
@ -67,11 +67,11 @@ pest_derive = "2.5.6"
quick-xml = "0.28.1" quick-xml = "0.28.1"
rand = "0.8.5" rand = "0.8.5"
rayon = "1.7.0" rayon = "1.7.0"
regex = "1.7.2" regex = "1.7.3"
rust-ini = "0.18.0" rust-ini = "0.18.0"
semver = "1.0.17" semver = "1.0.17"
serde = { version = "1.0.158", features = ["derive"] } serde = { version = "1.0.159", features = ["derive"] }
serde_json = "1.0.94" serde_json = "1.0.95"
sha1 = "0.10.5" sha1 = "0.10.5"
shadow-rs = { version = "0.21.0", default-features = false } shadow-rs = { version = "0.21.0", default-features = false }
# battery is optional (on by default) because the crate doesn't currently build for Termux # battery is optional (on by default) because the crate doesn't currently build for Termux

View File

@ -100,7 +100,7 @@ NixOS = " "
OpenBSD = " " OpenBSD = " "
openSUSE = " " openSUSE = " "
OracleLinux = " " OracleLinux = " "
Pop = " " Pop = " "
Raspbian = " " Raspbian = " "
Redhat = " " Redhat = " "
RedHatEnterprise = " " RedHatEnterprise = " "

View File

@ -75,7 +75,7 @@ fn parse_gradle_version_from_properties(wrapper_properties: &str) -> Option<Stri
.rsplit_once('/')? .rsplit_once('/')?
.1 .1
.strip_prefix("gradle-")? .strip_prefix("gradle-")?
.split_once('-')? .rsplit_once('-')?
.0; .0;
Some(version.to_string()) Some(version.to_string())
} }
@ -217,4 +217,27 @@ zipStorePath=wrapper/dists
Some("7.5.1".to_string()) Some("7.5.1".to_string())
); );
} }
#[test]
fn test_format_wrapper_properties_unstable_versions() {
let input = |version: &str| {
format!(
"\
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\\://services.gradle.org/distributions/gradle-{version}-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
"
)
};
assert_eq!(
parse_gradle_version_from_properties(&input("8.1-rc-1")),
Some("8.1-rc-1".to_string())
);
assert_eq!(
parse_gradle_version_from_properties(&input("7.5.1-20220729132837+0000")),
Some("7.5.1-20220729132837+0000".to_string())
);
}
} }