From ec0b6ef08370891fbdda0fde62d9a58810a630c3 Mon Sep 17 00:00:00 2001 From: timofey Date: Wed, 21 Feb 2024 15:58:42 +0000 Subject: [PATCH] blanket workspace template --- src/exercises/multiple_blanket.md | 72 +++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/src/exercises/multiple_blanket.md b/src/exercises/multiple_blanket.md index 333f46e..fb8b36b 100644 --- a/src/exercises/multiple_blanket.md +++ b/src/exercises/multiple_blanket.md @@ -104,3 +104,75 @@ mod external { } # } ``` + +Template for a workspace: + +```toml +# Cargo.toml +[workspace] +members = ["a", "a1", "a2", "common"] + +[workspace.package] +version = "0.0.1" +edition = "2021" +publish = false + +[package] +name = "solution" +version.workspace = true +edition.workspace = true +publish.workspace = true + +[dependencies] +a.path = "a" +a1.path = "a1" +a2.path = "a2" +common.path = "common" +``` + +```toml +# a/Cargo.toml +[package] +name = "a" +version.workspace = true +edition.workspace = true +publish.workspace = true + +[dependencies] +a1.path = "../a1" +a2.path = "../a2" +common.path = "../common" +``` + +```toml +# a1/Cargo.toml +[package] +name = "a1" +version.workspace = true +edition.workspace = true +publish.workspace = true + +[dependencies] +common.path = "../common" +``` + +```toml +# a2/Cargo.toml +[package] +name = "a2" +version.workspace = true +edition.workspace = true +publish.workspace = true + +[dependencies] +common.path = "../common" +``` + +```toml +# common.Cargo.toml +[package] +name = "common" +version.workspace = true +edition.workspace = true +publish.workspace = true +```