aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/docs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-17 19:21:52 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-17 19:21:52 +0800
commit89bf57f33a9f0f5a96fc50e272c83d926fa35c4a (patch)
treecc5a72e850bdd9215b60dc1655f162e22ee97d12 /mingling_core/src/docs
parent40bb7ffd6954184fac718c8f99c9cdc3e054e4eb (diff)
refactor!: replace build.rs with compile-time macro build steps
BREAKING CHANGE: Replace the `build`/`builds` feature system with compile-time macro-driven generation. `gen_program!()` now automatically invokes `build_comp!()` and `build_pathf!()` when the `comp`/`pathf` features are enabled, eliminating the need for `build.rs` and `[build-dependencies]` blocks. This removes the `build` feature, the `mingling::build` module, and all related build-time API functions. Completion scripts are now written to `{target_directory}/mingling/` instead of `target/release/`. The `mingling_cli` uses `build_comp!("mling")` for its custom binary name.
Diffstat (limited to 'mingling_core/src/docs')
-rw-r--r--mingling_core/src/docs/build.md57
1 files changed, 0 insertions, 57 deletions
diff --git a/mingling_core/src/docs/build.md b/mingling_core/src/docs/build.md
deleted file mode 100644
index 6f9285a..0000000
--- a/mingling_core/src/docs/build.md
+++ /dev/null
@@ -1,57 +0,0 @@
-Provide Mingling's build script module for build-time behavior of specific features in `build.rs`.
-
-To use it, add a dependency on mingling under `[build-dependencies]` in `Cargo.toml`, and enable the relevant features:
-
-## Build-Time Related Features
-
-| Name | Purpose |
-| ---------------- | ------------------------------------------------------------------------------------------------- |
-| `build` | Master switch for build-time features |
-| `build_advanced` | Master switch for build-time features, paired with the `advanced` feature |
-| `build_full` | Master switch for build-time features, paired with the `full` feature |
-| `comp` | Completion script builder; both sides must enable it, generates cross-platform completion scripts |
-| `pathf` | Type path analyzer; both sides must enable it, generates type mapping tables |
-| `dispatch_tree` | Compile-time dispatch tree; when `pathf` is a build-time dependency, |
-| | and `dispatch_tree` (included in `advanced` or `full`) is enabled, both sides should enable it |
-
-```toml
-# Cargo.toml
-[dependencies.mingling]
-features = [
- "advanced", # Enable `advanced` if using it
-]
-
-[build-dependencies.mingling]
-features = [
- "build_advanced" # This side should enable `build_advanced`
-]
-```
-
-## `build.rs` Templates
-
-You can use the following template to write `build.rs` to quickly gain the build-time capabilities of `comp` and `pathf`:
-
-```rust,ignore
-// build.rs
-fn main() {
- build_scripts();
- build_pathf_mapping();
-}
-
-/// Generate completion scripts
-fn build_scripts() {
- // `env!("CARGO_PKG_NAME")` equals the crate name, which matches the binary name.
- // If your binary name differs from the crate name, specify it explicitly.
- mingling::build::build_comp_scripts(
- // Your binary name:
- env!("CARGO_PKG_NAME"),
- )
- .unwrap();
-}
-
-fn build_pathf_mapping() {
- // Build pathf type mapping to ensure that the enabled `pathf` feature
- // can correctly scan macros in the project
- mingling::build::analyze_and_build_type_mapping().unwrap();
-}
-```