From e2a0fd2fd5c072ab9267b174f7e69c3031827496 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Thu, 18 Apr 2024 04:30:50 +0200 Subject: [PATCH] chore(deps): update to windows-rs 0.56 and other deps --- .changes/windows-rs-0.56.md | 5 + Cargo.lock | 219 ++++++++++++------ Cargo.toml | 10 +- src/config/app/raw.rs | 2 +- src/templating/init.rs | 44 ++-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 6 files changed, 189 insertions(+), 93 deletions(-) create mode 100644 .changes/windows-rs-0.56.md diff --git a/.changes/windows-rs-0.56.md b/.changes/windows-rs-0.56.md new file mode 100644 index 00000000..e917341c --- /dev/null +++ b/.changes/windows-rs-0.56.md @@ -0,0 +1,5 @@ +--- +"cargo-mobile2": "patch" +--- + +Update `windows` crate to `0.56` diff --git a/Cargo.lock b/Cargo.lock index c7316cb5..b4388a18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -41,6 +41,54 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "atty" version = "0.2.14" @@ -184,7 +232,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -202,6 +250,12 @@ dependencies = [ "vec_map", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "colored" version = "2.1.0" @@ -340,17 +394,27 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e4f5d6e192964d498b45abee72ca445e91909094bc8e8791259e82c2a0d1aa6" +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + [[package]] name = "env_logger" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", ] [[package]] @@ -562,9 +626,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.4.0" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" dependencies = [ "log", "pest", @@ -702,17 +766,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi 0.3.3", - "rustix 0.38.32", - "windows-sys 0.48.0", -] - [[package]] name = "itoa" version = "1.0.9" @@ -765,9 +818,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" @@ -1111,9 +1164,9 @@ dependencies = [ [[package]] name = "rstest" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97eeab2f3c0a199bc4be135c36c924b6590b88c377d416494288c14f2db30199" +checksum = "9d5316d2a1479eeef1ea21e7f9ddc67c191d497abc8fc3ba2467857abbb68330" dependencies = [ "futures", "futures-timer", @@ -1123,9 +1176,9 @@ dependencies = [ [[package]] name = "rstest_macros" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d428f8247852f894ee1be110b375111b586d4fa431f6c46e64ba5a0dcccbe605" +checksum = "04a9df72cc1f67020b0d63ad9bfe4a323e459ea7eb68e03bd9824db49f9a4c25" dependencies = [ "cfg-if", "glob", @@ -1452,15 +1505,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "termcolor" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" -dependencies = [ - "winapi-util", -] - [[package]] name = "terminal_size" version = "0.2.6" @@ -1658,6 +1702,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "vcpkg" version = "0.2.15" @@ -1820,12 +1870,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.54.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ - "windows-core 0.54.0", - "windows-targets 0.52.4", + "windows-core 0.56.0", + "windows-targets 0.52.5", ] [[package]] @@ -1834,26 +1884,50 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] name = "windows-core" -version = "0.54.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" dependencies = [ + "windows-implement", + "windows-interface", "windows-result", - "windows-targets 0.52.4", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", ] [[package]] name = "windows-result" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -1871,7 +1945,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -1891,17 +1965,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -1912,9 +1987,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -1924,9 +1999,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -1936,9 +2011,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -1948,9 +2029,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -1960,9 +2041,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -1972,9 +2053,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -1984,9 +2065,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" diff --git a/Cargo.toml b/Cargo.toml index 94df1ca5..38586fcf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,13 +45,13 @@ native-tls = [ "ureq/native-tls" ] default = [ "cli", "ureq/native-tls" ] [dependencies] -handlebars = "4.4" +handlebars = "5.0" serde_json = "1.0" colored = "2.1" deunicode = "1.4" dunce = "1.0" english-numbers = "0.3" -env_logger = { version = "0.10", optional = true } +env_logger = { version = "0.11", optional = true } heck = "0.5" home = "0.5" ignore = "0.4" @@ -69,7 +69,7 @@ which = "6.0" os_pipe = "1" [dev-dependencies] -rstest = "0.18" +rstest = "0.19" [target."cfg(target_os = \"macos\")".dependencies] core-foundation = "0.9" @@ -86,7 +86,7 @@ freedesktop_entry_parser = "1.3" libc = "0.2" [target."cfg(windows)".dependencies.windows] -version = "0.54" +version = "0.56" features = [ "Win32_Foundation", "Win32_Security", @@ -107,7 +107,7 @@ embed-resource = "2.4" [build-dependencies] home = { version = "0.5", optional = true } dunce = { version = "1.0", optional = true } -handlebars = { version = "4.4", optional = true } +handlebars = { version = "5.0", optional = true } log = { version = "0.4", optional = true } serde = { version = "1.0", optional = true } serde_json = { version = "1.0", optional = true } diff --git a/src/config/app/raw.rs b/src/config/app/raw.rs index 6bb04ec2..651f9d02 100644 --- a/src/config/app/raw.rs +++ b/src/config/app/raw.rs @@ -15,7 +15,7 @@ use std::{ #[derive(Debug)] enum DefaultDomainError { - FailedToGetGitEmailAddr(std::io::Error), + FailedToGetGitEmailAddr(#[allow(unused)] std::io::Error), FailedToParseEmailAddr, } diff --git a/src/templating/init.rs b/src/templating/init.rs index ead8676d..b903b29f 100644 --- a/src/templating/init.rs +++ b/src/templating/init.rs @@ -1,8 +1,8 @@ +use handlebars::RenderErrorReason; + use crate::{ bicycle::{ - handlebars::{ - self, Context, Handlebars, Helper, HelperResult, Output, RenderContext, RenderError, - }, + handlebars::{self, Context, Handlebars, Helper, HelperResult, Output, RenderContext}, Bicycle, EscapeFn, HelperDef, JsonMap, }, config::{app, Config}, @@ -45,7 +45,7 @@ fn join( ) -> HelperResult { out.write( &get_str_array(helper, |s| s.to_string()) - .ok_or_else(|| RenderError::new("`join` helper wasn't given an array"))? + .ok_or_else(|| RenderErrorReason::Other("`join` helper wasn't given an array".into()))? .join(", "), ) .map_err(Into::into) @@ -60,7 +60,9 @@ fn quote_and_join( ) -> HelperResult { out.write( &get_str_array(helper, |s| format!("{:?}", s)) - .ok_or_else(|| RenderError::new("`quote-and-join` helper wasn't given an array"))? + .ok_or_else(|| { + RenderErrorReason::Other("`quote-and-join` helper wasn't given an array".into()) + })? .join(", "), ) .map_err(Into::into) @@ -76,7 +78,9 @@ fn quote_and_join_colon_prefix( out.write( &get_str_array(helper, |s| format!("{:?}", format!(":{}", s))) .ok_or_else(|| { - RenderError::new("`quote-and-join-colon-prefix` helper wasn't given an array") + RenderErrorReason::Other( + "`quote-and-join-colon-prefix` helper wasn't given an array".into(), + ) })? .join(", "), ) @@ -118,16 +122,18 @@ fn reverse_domain_snake_case( .map_err(Into::into) } -fn app_root(ctx: &Context) -> Result<&str, RenderError> { +fn app_root(ctx: &Context) -> Result<&str, RenderErrorReason> { let app_root = ctx .data() .get(app::KEY) - .ok_or_else(|| RenderError::new("`app` missing from template data."))? + .ok_or_else(|| RenderErrorReason::Other("`app` missing from template data.".into()))? .get("root-dir") - .ok_or_else(|| RenderError::new("`app.root-dir` missing from template data."))?; - app_root - .as_str() - .ok_or_else(|| RenderError::new("`app.root-dir` contained invalid UTF-8.")) + .ok_or_else(|| { + RenderErrorReason::Other("`app.root-dir` missing from template data.".into()) + })?; + app_root.as_str().ok_or_else(|| { + RenderErrorReason::Other("`app.root-dir` contained invalid UTF-8..into()".into()) + }) } fn prefix_path( @@ -141,8 +147,9 @@ fn prefix_path( util::prefix_path(app_root(ctx)?, get_str(helper)) .to_str() .ok_or_else(|| { - RenderError::new( - "Either the `app.root-dir` or the specified path contained invalid UTF-8.", + RenderErrorReason::Other( + "Either the `app.root-dir` or the specified path contained invalid UTF-8." + .into(), ) })?, ) @@ -159,12 +166,15 @@ fn unprefix_path( out.write( util::unprefix_path(app_root(ctx)?, get_str(helper)) .map_err(|_| { - RenderError::new("Attempted to unprefix a path that wasn't in the app root dir.") + RenderErrorReason::Other( + "Attempted to unprefix a path that wasn't in the app root dir.".into(), + ) })? .to_str() .ok_or_else(|| { - RenderError::new( - "Either the `app.root-dir` or the specified path contained invalid UTF-8.", + RenderErrorReason::Other( + "Either the `app.root-dir` or the specified path contained invalid UTF-8." + .into(), ) })?, ) diff --git a/templates/platforms/android-studio/gradle/wrapper/gradle-wrapper.properties b/templates/platforms/android-studio/gradle/wrapper/gradle-wrapper.properties index a03ce6aa..13f348c8 100644 --- a/templates/platforms/android-studio/gradle/wrapper/gradle-wrapper.properties +++ b/templates/platforms/android-studio/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue May 10 19:22:52 CST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME