From c216c38004103289917c1ff67b29cc28aae1a851 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Mon, 23 Dec 2024 11:07:11 -0800 Subject: [PATCH] Regenerate documentation --- docs/src/crate_universe_bzlmod.md | 63 ++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/docs/src/crate_universe_bzlmod.md b/docs/src/crate_universe_bzlmod.md index ddb8f84e8a..2c37456f78 100644 --- a/docs/src/crate_universe_bzlmod.md +++ b/docs/src/crate_universe_bzlmod.md @@ -148,7 +148,7 @@ crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate") crate.spec(package = "serde", features = ["derive"], version = "1.0") crate.spec(package = "serde_json", version = "1.0") -crate.spec(package = "tokio", default_features=False, features = ["macros", "net", "rt-multi-thread"], version = "1.38") +crate.spec(package = "tokio", default_features = False, features = ["macros", "net", "rt-multi-thread"], version = "1.38") crate.from_specs() use_repo(crate, "crates") @@ -340,10 +340,15 @@ crate.annotation(deps, patch_args, patch_tool, patches, proc_macro_deps, repositories, rustc_env, rustc_env_files, rustc_flags, shallow_since, version) crate.from_cargo(name, cargo_config, cargo_lockfile, generate_binaries, generate_build_scripts, - manifests, splicing_config, supported_platform_triples) -crate.from_specs(name, cargo_config, generate_binaries, generate_build_scripts, splicing_config, + manifests, supported_platform_triples) +crate.from_specs(name, cargo_config, generate_binaries, generate_build_scripts, supported_platform_triples) +crate.render_config(build_file_template, crate_label_template, crate_repository_template, + crates_module_template, default_alias_rule, default_package_name, + generate_rules_license_metadata, generate_target_compatible_with, + platforms_template, regen_command, vendor_mode) crate.spec(artifact, branch, default_features, features, git, lib, package, rev, tag, version) +crate.splicing_config(resolver_version) Crate universe module extensions. @@ -355,6 +360,8 @@ Crate universe module extensions. ### annotation +A collection of extra attributes and settings for a particular crate. + **Attributes** | Name | Description | Type | Mandatory | Default | @@ -414,7 +421,6 @@ Generates a repo @crates from a Cargo.toml / Cargo.lock pair. | generate_binaries | Whether to generate `rust_binary` targets for all the binary crates in every package. By default only the `rust_library` targets are generated. | Boolean | optional | `False` | | generate_build_scripts | Whether or not to generate [cargo build scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html) by default. | Boolean | optional | `True` | | manifests | A list of Cargo manifests (`Cargo.toml` files). | List of labels | optional | `[]` | -| splicing_config | The configuration flags to use for splicing Cargo maniests. Use `//crate_universe:defs.bzl\%rsplicing_config` to generate the value for this field. If unset, the defaults defined there will be used. | String | optional | `""` | | supported_platform_triples | A set of all platform triples to consider when generating dependencies. | List of strings | optional | `["aarch64-apple-darwin", "aarch64-apple-ios", "aarch64-apple-ios-sim", "aarch64-linux-android", "aarch64-pc-windows-msvc", "aarch64-unknown-fuchsia", "aarch64-unknown-linux-gnu", "aarch64-unknown-nixos-gnu", "aarch64-unknown-nto-qnx710", "arm-unknown-linux-gnueabi", "armv7-linux-androideabi", "armv7-unknown-linux-gnueabi", "i686-apple-darwin", "i686-linux-android", "i686-pc-windows-msvc", "i686-unknown-freebsd", "i686-unknown-linux-gnu", "powerpc-unknown-linux-gnu", "riscv32imc-unknown-none-elf", "riscv64gc-unknown-none-elf", "s390x-unknown-linux-gnu", "thumbv7em-none-eabi", "thumbv8m.main-none-eabi", "wasm32-unknown-unknown", "wasm32-wasip1", "x86_64-apple-darwin", "x86_64-apple-ios", "x86_64-linux-android", "x86_64-pc-windows-msvc", "x86_64-unknown-freebsd", "x86_64-unknown-fuchsia", "x86_64-unknown-linux-gnu", "x86_64-unknown-nixos-gnu", "x86_64-unknown-none"]` | @@ -431,13 +437,48 @@ Generates a repo @crates from the defined `spec` tags. | cargo_config | A [Cargo configuration](https://doc.rust-lang.org/cargo/reference/config.html) file. | Label | optional | `None` | | generate_binaries | Whether to generate `rust_binary` targets for all the binary crates in every package. By default only the `rust_library` targets are generated. | Boolean | optional | `False` | | generate_build_scripts | Whether or not to generate [cargo build scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html) by default. | Boolean | optional | `True` | -| splicing_config | The configuration flags to use for splicing Cargo maniests. Use `//crate_universe:defs.bzl\%rsplicing_config` to generate the value for this field. If unset, the defaults defined there will be used. | String | optional | `""` | | supported_platform_triples | A set of all platform triples to consider when generating dependencies. | List of strings | optional | `["aarch64-apple-darwin", "aarch64-apple-ios", "aarch64-apple-ios-sim", "aarch64-linux-android", "aarch64-pc-windows-msvc", "aarch64-unknown-fuchsia", "aarch64-unknown-linux-gnu", "aarch64-unknown-nixos-gnu", "aarch64-unknown-nto-qnx710", "arm-unknown-linux-gnueabi", "armv7-linux-androideabi", "armv7-unknown-linux-gnueabi", "i686-apple-darwin", "i686-linux-android", "i686-pc-windows-msvc", "i686-unknown-freebsd", "i686-unknown-linux-gnu", "powerpc-unknown-linux-gnu", "riscv32imc-unknown-none-elf", "riscv64gc-unknown-none-elf", "s390x-unknown-linux-gnu", "thumbv7em-none-eabi", "thumbv8m.main-none-eabi", "wasm32-unknown-unknown", "wasm32-wasip1", "x86_64-apple-darwin", "x86_64-apple-ios", "x86_64-linux-android", "x86_64-pc-windows-msvc", "x86_64-unknown-freebsd", "x86_64-unknown-fuchsia", "x86_64-unknown-linux-gnu", "x86_64-unknown-nixos-gnu", "x86_64-unknown-none"]` | + + +### render_config + +Various settings used to configure rendered outputs. + +The template parameters each support a select number of format keys. A description of each key +can be found below where the supported keys for each template can be found in the parameter docs + +| key | definition | +| --- | --- | +| `name` | The name of the crate. Eg `tokio` | +| `repository` | The rendered repository name for the crate. Directly relates to `crate_repository_template`. | +| `triple` | A platform triple. Eg `x86_64-unknown-linux-gnu` | +| `version` | The crate version. Eg `1.2.3` | +| `target` | The library or binary target of the crate | +| `file` | The basename of a file | + +**Attributes** + +| Name | Description | Type | Mandatory | Default | +| :------------- | :------------- | :------------- | :------------- | :------------- | +| build_file_template | The base template to use for BUILD file names. The available format keys are [`{name}`, {version}`]. | String | optional | `"//:BUILD.{name}-{version}.bazel"` | +| crate_label_template | The base template to use for crate labels. The available format keys are [`{repository}`, `{name}`, `{version}`, `{target}`]. | String | optional | `"@{repository}__{name}-{version}//:{target}"` | +| crate_repository_template | The base template to use for Crate label repository names. The available format keys are [`{repository}`, `{name}`, `{version}`]. | String | optional | `"{repository}__{name}-{version}"` | +| crates_module_template | The pattern to use for the `defs.bzl` and `BUILD.bazel` file names used for the crates module. The available format keys are [`{file}`]. | String | optional | `"//:{file}"` | +| default_alias_rule | Alias rule to use when generating aliases for all crates. Acceptable values are 'alias', 'dbg'/'fastbuild'/'opt' (transitions each crate's `compilation_mode`) or a string representing a rule in the form '