Skip to content

Commit

Permalink
🔧 (Cargo.toml): Optimize the structure of dependencies and feature flags
Browse files Browse the repository at this point in the history
优化依赖与功能标志的结构
  • Loading branch information
czy-29 committed Sep 27, 2024
1 parent b0b79f3 commit 0ac6065
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ tokio = { version = "1.40.0", features = [] }
# Universal optional dependencies
# 通用可选依赖
tracing = { version = "0.1.40", optional = true }
tracing-subscriber = { version = "0.3.18", optional = true }

# Kernel dependencies
# 内核依赖
Expand All @@ -48,22 +49,23 @@ hyper-util = { version = "0.1.9", features = ["tokio", "server-auto", "server-gr
# All dependencies required for each demo Gadgets and Kernel binary
# 各演示Gadget及Kernel二进制需要的所有依赖项
nu-ansi-term = { version = "0.50.1", optional = true }
tracing-subscriber = { version = "0.3.18", features = ["chrono"], optional = true }

[build-dependencies]
version_check = "0.9.5"

[features]
tracing = ["dep:tracing"]
kernel = ["tokio/net", "dep:http-body-util", "dep:hyper", "dep:hyper-util"]

tracing = ["dep:tracing"]
tracing-subscriber = ["dep:tracing-subscriber"]

# The feature set required for all binaries
# 所有二进制都需要的特性集合
bin = ["tracing", "tokio/rt-multi-thread", "tokio/macros", "dep:nu-ansi-term", "dep:tracing-subscriber"]
bin = ["tracing", "tokio/rt-multi-thread", "tokio/macros"]

# Feature that needs to be enabled for binary `opk` (OpenPlugin Kernel)
# 二进制`opk`(OpenPlugin Kernel)需要启用的特性
opk = ["kernel", "bin"]
opk = ["kernel", "tracing-subscriber/chrono", "dep:nu-ansi-term", "bin"]

[[bin]]
name = "opk"
Expand Down

0 comments on commit 0ac6065

Please sign in to comment.