aboutsummaryrefslogtreecommitdiff
path: root/development/tools/cargo-workspace2/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'development/tools/cargo-workspace2/src/lib.rs')
-rw-r--r--development/tools/cargo-workspace2/src/lib.rs64
1 files changed, 64 insertions, 0 deletions
diff --git a/development/tools/cargo-workspace2/src/lib.rs b/development/tools/cargo-workspace2/src/lib.rs
new file mode 100644
index 000000000000..689c3601cd55
--- /dev/null
+++ b/development/tools/cargo-workspace2/src/lib.rs
@@ -0,0 +1,64 @@
+//! cargo-workspace2 is a library to help manage cargo workspaces
+//!
+//! Out of the box the `cargo` workspace experience leaves a lot to be
+//! desired. Managing a repo with many crates in it can get out of
+//! hand quickly. Moreover, other tools that try to solve these
+//! issues often pick _one_ particular usecase of cargo workspaces,
+//! and enforce very strict rules on how to use them.
+//!
+//! This library aims to solve some of the issues of dealing with
+//! workspaces in a way that doesn't enforce a usage mode for the
+//! user.
+//!
+//! This package also publishes a binary (cargo ws2), which is
+//! recommended for most users. In case the binary handles a use-case
+//! you have in a way that you don't like, this library aims to
+//! provide a fallback so that you don't have to re-implement
+//! everything from scratch.
+//!
+//! ## Using this library
+//!
+//! Parsing happens in stages. First you need to use the
+//! [`cargo`](./cargo/index.html) module to parse the actual
+//! `Cargo.toml` files. After that you can use the cargo models in
+//! [`models`](models/index.html) to further process dependencies, and
+//! create a [`DepGraph`](models/struct.DepGraph.html) to resolve queries and make changes.
+
+pub mod cargo;
+pub mod models;
+pub mod ops;
+pub mod query;
+
+#[doc(hidden)]
+pub mod cli;
+
+// extern crate toml;
+// extern crate toml_edit;
+
+// pub use data_models::graph;
+// use data_models::level::Level;
+// use graph::DepGraph;
+// use std::fs::File;
+// pub use utilities::cargo_utils;
+// pub use utilities::utils;
+
+// pub mod data_models;
+// pub mod utilities;
+
+// pub fn do_batch_release(f: File, lvl: &Level) -> DepGraph {
+// let members = cargo_utils::get_members(f);
+// let configs = cargo_utils::batch_load_configs(&members);
+
+// let v = configs
+// .iter()
+// .map(|c| cargo_utils::parse_config(c, &members))
+// .fold(DepGraph::new(), |mut graph, (name, deps)| {
+// graph.add_node(name.clone());
+
+// deps.iter()
+// .fold(graph, |graph, dep| graph.add_dependency(&name, dep))
+// });
+
+// println!("{:#?}", v);
+// v
+// }