From 2ca5b24d0a7d1ea0f1afe760993ffefbbd1bfb96 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Thu, 10 Oct 2024 11:23:50 -0400 Subject: [PATCH] Move dependencies to workspace --- Cargo.toml | 13 +++++++++++++ xtask/Cargo.toml | 4 ++-- {{project-name}}-common/Cargo.toml | 2 +- {{project-name}}-ebpf/Cargo.toml | 5 +++-- {{project-name}}/Cargo.toml | 20 +++++++++++--------- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c03af9e..c9fa5cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,16 @@ [workspace] resolver = "2" members = ["xtask", "{{project-name}}", "{{project-name}}-common"] + +[workspace.dependencies] +aya = { version = "0.13.0", default-features = false } +aya-ebpf = { version = "0.1.1", default-features = false } +aya-log = { version = "0.2.1", default-features = false } +aya-log-ebpf = { version = "0.1.1", default-features = false } + +anyhow = { version = "1", default-features = false } +clap = { version = "4.1", default-features = false } +env_logger = { version = "0.10", default-features = false } +libc = { version = "0.2", default-features = false } +log = { version = "0.4", default-features = false } +tokio = { version = "1.25", default-features = false } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index c4dea5d..8bc59c3 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -4,5 +4,5 @@ version = "0.1.0" edition = "2021" [dependencies] -anyhow = "1" -clap = { version = "4.1", features = ["derive"] } +anyhow = { workspace = true } +clap = { workspace = true, features = ["derive"] } diff --git a/{{project-name}}-common/Cargo.toml b/{{project-name}}-common/Cargo.toml index 153d2ba..713d8fd 100644 --- a/{{project-name}}-common/Cargo.toml +++ b/{{project-name}}-common/Cargo.toml @@ -8,7 +8,7 @@ default = [] user = ["aya"] [dependencies] -aya = { version = "0.13", optional = true } +aya = { workspace = true, optional = true } [lib] path = "src/lib.rs" diff --git a/{{project-name}}-ebpf/Cargo.toml b/{{project-name}}-ebpf/Cargo.toml index 5952771..617ffb3 100644 --- a/{{project-name}}-ebpf/Cargo.toml +++ b/{{project-name}}-ebpf/Cargo.toml @@ -4,10 +4,11 @@ version = "0.1.0" edition = "2021" [dependencies] -aya-ebpf = "0.1.1" -aya-log-ebpf = "0.1.1" {{ project-name }}-common = { path = "../{{ project-name }}-common" } +aya-ebpf = { workspace = true } +aya-log-ebpf = { workspace = true } + [[bin]] name = "{{ project-name }}" path = "src/main.rs" diff --git a/{{project-name}}/Cargo.toml b/{{project-name}}/Cargo.toml index a6d0f66..b4b9669 100644 --- a/{{project-name}}/Cargo.toml +++ b/{{project-name}}/Cargo.toml @@ -5,17 +5,19 @@ edition = "2021" publish = false [dependencies] -aya = "0.13" -aya-log = "0.2" +{{project-name}}-common = { path = "../{{project-name}}-common", features = ["user"] } + +anyhow = { workspace = true } +aya = { workspace = true } +aya-log = { workspace = true } +env_logger = {workspace = true } +libc = { workspace = true } +log = { workspace = true } +tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread", "net", "signal"] } + {% if program_types_with_opts contains program_type -%} -clap = { version = "4.1", features = ["derive"] } +clap = { workspace = true, features = ["derive"] } {% endif -%} -{{project-name}}-common = { path = "../{{project-name}}-common", features = ["user"] } -anyhow = "1" -env_logger = "0.10" -libc = "0.2" -log = "0.4" -tokio = { version = "1.25", features = ["macros", "rt", "rt-multi-thread", "net", "signal"] } [[bin]] name = "{{project-name}}"