map-tool: roblox, source optional features

This commit is contained in:
2026-03-02 10:15:22 -08:00
parent ab09e384d3
commit 74bd6d0e84
3 changed files with 54 additions and 18 deletions

View File

@@ -6,8 +6,33 @@ edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = ["cli"]
cli = ["dep:clap", "tokio/macros", "tokio/rt-multi-thread", "tokio/fs", "dep:futures"]
default = ["cli","source","roblox"]
roblox = [
"dep:strafesnet_rbx_loader",
"dep:rbx_asset",
"dep:rbx_binary",
"dep:rbx_dom_weak",
"dep:rbx_reflection_database",
"dep:rbx_xml",
"dep:rbxassetid",
]
source = [
"dep:strafesnet_bsp_loader",
"dep:vbsp",
"dep:vbsp-entities-css",
"dep:vmdl",
"dep:vmt-parser",
"dep:vpk",
"dep:vtf",
"tokio/sync",
]
cli = [
"dep:clap",
"dep:futures",
"tokio/macros",
"tokio/rt-multi-thread",
"tokio/fs",
]
[lib]
name = "map_tool"
@@ -17,30 +42,35 @@ name = "map-tool"
required-features = ["cli"]
[dependencies]
strafesnet_deferred_loader.workspace = true
strafesnet_snf.workspace = true
anyhow = "1.0.75"
clap = { version = "4.4.2", features = ["derive"], optional = true }
flate2 = "1.0.27"
futures = { version = "0.3.31", optional = true }
image = "0.25.2"
image_dds = "0.7.1"
rbx_asset = { version = "0.5.0", registry = "strafesnet" }
rbx_binary = "2.0.1"
rbx_dom_weak = "4.1.0"
rbx_reflection_database = "2.0.2"
rbx_xml = "2.0.1"
rbxassetid = { version = "0.1.0", registry = "strafesnet" }
strafesnet_bsp_loader.workspace = true
strafesnet_deferred_loader.workspace = true
strafesnet_rbx_loader.workspace = true
strafesnet_snf.workspace = true
thiserror = "2.0.11"
tokio = { version = "1.43.0", features = ["time"] }
vbsp = "0.9.1"
vbsp-entities-css = "0.6.0"
vmdl = "0.2.0"
vmt-parser = "0.2.0"
vpk = "0.3.0"
vtf = "0.3.0"
# roblox
strafesnet_rbx_loader = { workspace = true, optional = true }
rbx_asset = { version = "0.5.0", registry = "strafesnet", optional = true }
rbx_binary = { version = "2.0.1", optional = true }
rbx_dom_weak = { version = "4.1.0", optional = true }
rbx_reflection_database = { version = "2.0.2", optional = true }
rbx_xml = { version = "2.0.1", optional = true }
rbxassetid = { version = "0.1.0", registry = "strafesnet", optional = true }
# source
strafesnet_bsp_loader = { workspace = true, optional = true }
vbsp = { version = "0.9.1", optional = true }
vbsp-entities-css = { version = "0.6.0", optional = true }
vmdl = { version = "0.2.0", optional = true }
vmt-parser = { version = "0.2.0", optional = true }
vpk = { version = "0.3.0", optional = true }
vtf = { version = "0.3.0", optional = true }
#[profile.release]
#lto = true

View File

@@ -1,2 +1,4 @@
#[cfg(feature="roblox")]
pub mod roblox;
#[cfg(feature="source")]
pub mod source;

View File

@@ -12,8 +12,10 @@ struct Cli{
#[derive(Subcommand)]
enum Commands{
#[command(flatten)]
#[cfg(feature="roblox")]
Roblox(map_tool::roblox::Commands),
#[command(flatten)]
#[cfg(feature="source")]
Source(map_tool::source::Commands),
}
@@ -21,7 +23,9 @@ enum Commands{
async fn main()->AResult<()>{
let cli=Cli::parse();
match cli.command{
#[cfg(feature="roblox")]
Commands::Roblox(commands)=>commands.run().await,
#[cfg(feature="source")]
Commands::Source(commands)=>commands.run().await,
}
}