Refactor: Move mod git into binstalk-downloader (#1285)

To speedup codegen time for `binstalk`, also fixed the docs.rs build for
`binstalk-downloader`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-08-12 17:20:26 +10:00 committed by GitHub
parent 6a1d317fde
commit c57356e870
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 7 deletions

2
Cargo.lock generated
View file

@ -243,7 +243,6 @@ dependencies = [
"compact_str",
"detect-targets",
"either",
"gix",
"glob",
"home",
"itertools",
@ -286,6 +285,7 @@ dependencies = [
"flate2",
"futures-util",
"generic-array",
"gix",
"httpdate",
"percent-encoding",
"quinn 0.10.2",

View file

@ -20,6 +20,7 @@ compact_str = "0.7.0"
flate2 = { version = "1.0.26", default-features = false }
futures-util = "0.3.28"
generic-array = "0.14.7"
gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true }
httpdate = "1.0.2"
reqwest = { version = "0.11.18", features = ["stream", "gzip", "brotli", "deflate"], default-features = false }
percent-encoding = "2.2.0"
@ -91,6 +92,9 @@ cross-lang-fat-lto = ["zstd/fat-lto"]
gh-api-client = ["json"]
json = ["serde", "serde_json"]
git = ["dep:gix"]
git-max-perf = ["gix?/max-performance"]
[package.metadata.docs.rs]
all-features = true
features = ["gh-api-client", "git"]
rustdoc-args = ["--cfg", "docsrs"]

View file

@ -12,4 +12,7 @@ pub mod gh_api_client;
pub mod remote;
#[cfg(feature = "git")]
pub mod git;
mod utils;

View file

@ -19,7 +19,6 @@ command-group = { version = "2.1.0", features = ["with-tokio"] }
compact_str = { version = "0.7.0", features = ["serde"] }
detect-targets = { version = "0.1.10", path = "../detect-targets" }
either = "1.8.1"
gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true }
glob = "0.3.1"
home = "0.5.5"
itertools = "0.11.0"
@ -53,8 +52,8 @@ windows = { version = "0.48.0", features = ["Win32_Storage_FileSystem", "Win32_F
[features]
default = ["static", "rustls", "git"]
git = ["dep:gix"]
git-max-perf = ["gix?/max-performance"]
git = ["binstalk-downloader/git"]
git-max-perf = ["binstalk-downloader/git-max-perf"]
static = ["binstalk-downloader/static"]
pkg-config = ["binstalk-downloader/pkg-config"]

View file

@ -1,7 +1,5 @@
pub(crate) mod cargo_toml_workspace;
pub(crate) mod futures_resolver;
#[cfg(feature = "git")]
pub(crate) mod git;
pub mod jobserver_client;
pub mod remote;
pub mod signal;
@ -11,6 +9,9 @@ pub mod tasks;
pub use binstalk_downloader::gh_api_client;
pub(crate) use binstalk_downloader::{bytes, download};
#[cfg(feature = "git")]
pub(crate) use binstalk_downloader::git;
pub(crate) fn is_universal_macos(target: &str) -> bool {
["universal-apple-darwin", "universal2-apple-darwin"].contains(&target)
}