fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

UebelAndreCleanup crate_universe dependency macros (#1460)adc80a30

0.10.0
1.1 KiB25 linesraw
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")
8load("//crate_universe/tools/cross_installer:cross_installer_deps.bzl", "cross_installer_deps")
9
10def crate_universe_dependencies(rust_version = rust_common.default_version, bootstrap = False):
11    """Define dependencies of the `cargo-bazel` Rust target
12
13    Args:
14        rust_version (str, optional): The version of rust to use when generating dependencies.
15        bootstrap (bool, optional): If true, a `cargo_bootstrap_repository` target will be generated.
16    """
17    third_party_deps()
18
19    if bootstrap:
20        cargo_bazel_bootstrap(rust_version = rust_version)
21
22    _vendor_crate_repositories()
23
24    crates_vendor_deps()
25    cross_installer_deps()