cargo_e/
lib.rs

1#![doc = include_str!("../README.md")]
2
3// Re-export std common modules
4pub mod prelude {
5    pub use std::env;
6    pub use std::error::Error;
7    pub use std::fs;
8    pub use std::io;
9    pub use std::path::{Path, PathBuf};
10    pub use std::process::exit;
11    pub use std::process::Child;
12    pub use std::process::Command;
13    pub use std::process::Stdio;
14    pub use std::sync::mpsc;
15    pub use std::sync::{Arc, Mutex};
16    pub use std::time::Instant;
17    //pub use tracing::{debug, error, info};
18    pub use log::{debug, error, info, log_enabled, Level};
19}
20
21pub mod e_findmain;
22pub use e_findmain::*;
23pub mod e_bacon;
24pub mod e_types;
25pub use e_bacon::*;
26pub mod e_cli;
27pub use e_cli::Cli;
28pub mod e_manifest;
29pub use e_manifest::{collect_workspace_members, locate_manifest};
30pub mod e_parser;
31pub use e_parser::parse_available;
32pub mod e_autosense;
33pub mod e_cargocommand_ext;
34pub mod e_collect;
35pub mod e_command_builder;
36pub mod e_diagnostics_dispatchers;
37pub mod e_discovery;
38pub mod e_eventdispatcher;
39pub mod e_features;
40pub mod e_fmt;
41pub mod e_installer;
42pub mod e_prebuild;
43pub mod e_processmanager;
44pub mod e_prompts;
45pub mod e_reports;
46pub mod e_runall;
47pub mod e_runner;
48pub mod e_target;
49pub mod e_tui;
50pub mod e_workspace;
51#[cfg(feature = "uses_tts")]
52use once_cell::sync::OnceCell;
53use dashmap::DashSet;
54
55#[cfg(feature = "uses_tts")]
56pub static GLOBAL_TTS: OnceCell<std::sync::Mutex<tts::Tts>> = OnceCell::new();
57pub static GLOBAL_MANAGER: OnceCell<std::sync::Arc<e_processmanager::ProcessManager>> =
58    OnceCell::new();
59pub static GLOBAL_CLI: OnceCell<Cli> = OnceCell::new();
60/// A global set to track PIDs of ewindow processes.
61pub static GLOBAL_EWINDOW_PIDS: OnceCell<dashmap::DashMap<u32,u32>> = OnceCell::new();
62// Plugin system modules
63/// Extension API: unified CLI+targets for embedding cargo-e
64pub mod ext;
65#[cfg(feature = "uses_plugins")]
66pub mod plugins;
67
68#[allow(unused_macros)]
69macro_rules! doc_with_joke {
70    (
71        $(#[$attr:meta])*
72        $vis:vis fn $name:ident($($arg:tt)*) -> $ret:ty $body:block
73    ) => {
74        $(#[$attr])*                           // Re-emit external doc attributes.
75        #[doc = "Have you read the Guide for You To Read?"] // Extra injected doc comment.
76        $vis fn $name($($arg)*) -> $ret $body    // Emit the function.
77    };
78}
79
80// Define the helper macro.
81// macro_rules! doc_with_funny {
82//     ($doc:expr) => {
83//         #[doc = concat!($doc, "\n\nSee also the [Guide for You To Read](index.html) for more details.")]
84//     };
85// }
86
87// Define the helper macro that captures external attributes and injects an extra doc attribute.
88// macro_rules! doc_with_funny {
89//     (
90//         $(#[$attr:meta])*
91//         $vis:vis fn $name:ident($($arg:tt)*) -> $ret:ty $body:block
92//     ) => {
93//         $(#[$attr])*                           // Re-emit external doc attributes.
94//         #[doc = "Have you read the Guide for You To Read?"] // Extra injected doc comment.
95//         $vis fn $name($($arg)*) -> $ret $body    // Emit the function.
96//     };
97// }
98
99// #[doc = include_str!("../documents/guide.md")]
100// pub mod a_guide {
101//     /// An example constant to force module inclusion.
102//     doc_with_guide!("This function does something important.");
103//     pub const a_const: () = ();
104
105//     /// An example function to force module inclusion.
106//     pub fn a_function() {}
107
108//     /// An example struct to force module inclusion.
109//     pub struct AStruct;
110
111//     /// An example enum to force module inclusion.
112//     pub enum AEnum {
113//         AVariant,
114//     }
115
116//     /// An example trait to force module inclusion.
117//     pub trait ATrait {}
118
119//     /// An example type alias to force module inclusion.
120//     pub type AType = ();
121// }
122
123// // Re-export so the module shows in the public API.
124// pub use a_guide as __THE_GUIDE;
125
126#[macro_use]
127pub mod a_funny_docs;
128
129#[doc = include_str!("../documents/guide.md")]
130pub mod a_guide {
131    // A constant with a humorous aside
132    #[doc = "A wacky constant that reminds you of the fleeting nature of existence—because constants, like our dreams, never change."]
133    #[doc = "Imagine staring into the abyss of an unchanging value and laughing at the cosmic joke: even when everything is fixed, there’s always room for a little absurdity. In a world of mutable chaos, this constant stands as a monument to the absurdity of permanence."]
134    #[doc = "SEE ALSO THE **[GUIDE FOR YOU TO READ](index.html) FOR MORE DETAILS** ON THE MYSTERIES OF CONSTANTS."]
135    pub const A_CONST: () = ();
136    // A function with a humorous aside
137    #[doc = "An eccentric function that performs its task with a whimsical twist."]
138    #[doc = "Picture a function that cracks jokes as it runs—each call a mini stand-up routine where recursion becomes a humorous loop and error handling turns into a comedy of exceptions. This function reminds you that even in logic there is laughter."]
139    #[doc = "SEE ALSO THE **[GUIDE FOR YOU TO READ](index.html) FOR MORE DETAILS** ON THE ART OF FUNCTIONAL HUMOR."]
140    pub fn a_function() {}
141
142    // A struct with a humorous aside
143    #[doc = "A delightfully absurd struct that encapsulates the essence of lighthearted programming."]
144    #[doc = "Think of it as the punchline to a well-crafted joke: simple on the surface yet bursting with hidden layers of wit. This struct is the blueprint for designing data structures that know how to have a good time even when they’re being strictly typed."]
145    #[doc = "SEE ALSO THE **[GUIDE FOR YOU TO READ](index.html) FOR MORE DETAILS** ON STRUCTURING YOUR HUMOR."]
146    pub struct AStruct;
147
148    // An enum with a humorous aside
149    #[doc = "An enum whose variants are as unpredictable as the punchline of an offbeat comedy routine."]
150    #[doc = "Each variant is a different flavor of chaos—a reminder that sometimes, even in the binary world of enums, you need a twist of fate and a pinch of absurdity. Embrace the randomness with a hearty chuckle."]
151    #[doc = "SEE ALSO THE **[GUIDE FOR YOU TO READ](index.html) FOR MORE DETAILS** ON ENUMERATING THE LAUGHTER."]
152    //#[doc = doc_with_funny!("**ENUMERATE THE LAUGHTER:** This enum's variants are as surprising as a punchline in the middle of a monologue. Discover the unexpected twist in every variant.")]
153    pub enum AEnum {
154        #[doc = "A variant that boldly goes where no variant has gone before—capturing the essence of unexpected hilarity."]
155        AVariant,
156    }
157
158    // A trait with a humorous aside
159    #[doc = "A quirky trait that defines behaviors with a tongue-in-cheek twist."]
160    #[doc = "Imagine a trait written by a stand-up comedian: each method is a punchline, each implementation an opportunity for subtle humor. Types implementing this trait are expected not just to act, but to entertain—blending functionality with a dash of wit."]
161    #[doc = "SEE ALSO THE **[GUIDE FOR YOU TO READ](index.html) FOR MORE DETAILS** ON TRAIT-ORIENTED COMEDY."]
162    pub trait ATrait {}
163
164    // A type alias with a humorous aside
165    #[doc = "A type alias that serves as a humorous shortcut to a more verbose reality."]
166    #[doc = "Sometimes types need nicknames too. This alias is like that clever one-liner you whisper at a party—short, memorable, and unexpectedly delightful. It’s the wink in the midst of an otherwise serious type system."]
167    #[doc = "SEE ALSO THE **[GUIDE FOR YOU TO READ](index.html) FOR MORE DETAILS** ON ALIASING THE ORDINARY INTO THE EXTRAORDINARY."]
168    pub type AType = ();
169}
170
171/// If you didn't get it the first time, then look again!  
172/// Check out the **[GUIDE FOR YOU TO READ](theSeachIsOver/index.html)** for all the brilliant details you missed.
173pub use a_guide as theSeachIsOver;