fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
5b0a6a97
main
1"""A module defining dependencies of the `cargo-bazel` Rust target""" 2 3load ( "@rules_rust//rust:defs.bzl" , "rust_common" ) 4load ( "//crate_universe:deps_bootstrap.bzl" , "cargo_bazel_bootstrap" ) 5load ( "//crate_universe/3rdparty:third_party_deps.bzl" , "third_party_deps" ) 6load ( "//crate_universe/3rdparty/crates:crates.bzl" , _vendor_crate_repositories = "crate_repositories" ) 7load ( "//crate_universe/private:vendor_utils.bzl" , "crates_vendor_deps" ) 8 9def crate_universe_dependencies ( rust_version = rust_common . default_version , bootstrap = False , ** kwargs ): 10"""Define dependencies of the `cargo-bazel` Rust target 11 12Args: 13rust_version (str, optional): The version of rust to use when generating dependencies. 14bootstrap (bool, optional): If true, a `cargo_bootstrap_repository` target will be generated. 15**kwargs: Arguments to pass through to cargo_bazel_bootstrap. 16 17Returns: 18list[struct(repo=str, is_dev_dep=bool)]: A list of the repositories 19defined by this macro. 20""" 21third_party_deps () 22 23if bootstrap : 24cargo_bazel_bootstrap ( rust_version = rust_version , ** kwargs ) 25 26direct_deps = _vendor_crate_repositories () 27direct_deps . extend ( crates_vendor_deps ()) 28return direct_deps