feat: initialize core, gui-eframe, and tui-ratatui crates and use them in the multibinary

This commit is contained in:
J / Jacob Babich
2024-10-05 23:27:47 -04:00
parent dbccf23a50
commit 18cb5043cf
12 changed files with 96 additions and 6 deletions

23
Cargo.lock generated
View File

@@ -7,6 +7,8 @@ name = "ac-qu-ai-nt"
version = "0.0.7"
dependencies = [
"ac-qu-ai-nt-cli-clap",
"ac-qu-ai-nt-gui-eframe",
"ac-qu-ai-nt-tui-ratatui",
"clap",
"dirs-next",
"tracing-subscriber",
@@ -20,6 +22,27 @@ dependencies = [
"tracing",
]
[[package]]
name = "ac-qu-ai-nt-core"
version = "0.0.1"
dependencies = [
"tracing",
]
[[package]]
name = "ac-qu-ai-nt-gui-eframe"
version = "0.0.1"
dependencies = [
"tracing",
]
[[package]]
name = "ac-qu-ai-nt-tui-ratatui"
version = "0.0.1"
dependencies = [
"tracing",
]
[[package]]
name = "anstream"
version = "0.6.15"

View File

@@ -1,5 +1,5 @@
[workspace]
members = ["cli-clap", "multibinary"]
members = ["core", "cli-clap", "gui-eframe", "tui-ratatui", "multibinary"]
resolver = "2"
[workspace.package]

16
core/Cargo.toml Normal file
View File

@@ -0,0 +1,16 @@
[package]
name = "ac-qu-ai-nt-core"
version = "0.0.1"
edition = "2021"
rust-version = "1.76"
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
[features]
default = ["tracing"]
tracing = ["dep:tracing"]
[dependencies]
tracing = { workspace = true, optional = true }

0
core/src/lib.rs Normal file
View File

16
gui-eframe/Cargo.toml Normal file
View File

@@ -0,0 +1,16 @@
[package]
name = "ac-qu-ai-nt-gui-eframe"
version = "0.0.1"
edition = "2021"
rust-version = "1.76"
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
[features]
default = ["tracing"]
tracing = ["dep:tracing"]
[dependencies]
tracing = { workspace = true, optional = true }

4
gui-eframe/src/lib.rs Normal file
View File

@@ -0,0 +1,4 @@
pub fn main() {
#[cfg(feature = "tracing")]
tracing::info!("Hello from the eframe-based GUI!");
}

1
gui-eframe/src/main.rs Normal file
View File

@@ -0,0 +1 @@
use ac_qu_ai_nt_gui_eframe::main;

View File

@@ -13,13 +13,22 @@ repository = { workspace = true }
default = ["cli-clap", "gui-eframe", "tui-ratatui", "tracing"]
cli-clap = ["dep:ac-qu-ai-nt-cli-clap"]
gui-eframe = []
tui-ratatui = []
gui-eframe = ["dep:ac-qu-ai-nt-gui-eframe"]
tui-ratatui = ["dep:ac-qu-ai-nt-tui-ratatui"]
tracing = ["dep:tracing-subscriber", "ac-qu-ai-nt-cli-clap?/tracing"]
tracing = [
"dep:tracing-subscriber",
"ac-qu-ai-nt-cli-clap?/tracing",
"ac-qu-ai-nt-gui-eframe?/tracing",
"ac-qu-ai-nt-tui-ratatui?/tracing",
]
[dependencies]
ac-qu-ai-nt-cli-clap = { version = "0.0.5", path = "../cli-clap", optional = true }
ac-qu-ai-nt-gui-eframe = { version = "0.0.1", path = "../gui-eframe", optional = true }
ac-qu-ai-nt-tui-ratatui = { version = "0.0.1", path = "../tui-ratatui", optional = true }
clap = { workspace = true, features = ["derive", "env"] }
dirs-next = "2.0.0"
tracing-subscriber = { version = "0.3.18", optional = true }

View File

@@ -59,8 +59,8 @@ fn main() {
#[cfg(feature = "cli-clap")]
Command::CliClap => ac_qu_ai_nt_cli_clap::main(),
#[cfg(feature = "gui-eframe")]
Command::GuiEframe => todo!(),
Command::GuiEframe => ac_qu_ai_nt_gui_eframe::main(),
#[cfg(feature = "tui-ratatui")]
Command::TuiRatatui => todo!(),
Command::TuiRatatui => ac_qu_ai_nt_tui_ratatui::main(),
}
}

16
tui-ratatui/Cargo.toml Normal file
View File

@@ -0,0 +1,16 @@
[package]
name = "ac-qu-ai-nt-tui-ratatui"
version = "0.0.1"
edition = "2021"
rust-version = "1.76"
authors = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
[features]
default = ["tracing"]
tracing = ["dep:tracing"]
[dependencies]
tracing = { workspace = true, optional = true }

4
tui-ratatui/src/lib.rs Normal file
View File

@@ -0,0 +1,4 @@
pub fn main() {
#[cfg(feature = "tracing")]
tracing::info!("This is from the TUI based on Ratatui.");
}

1
tui-ratatui/src/main.rs Normal file
View File

@@ -0,0 +1 @@
use ac_qu_ai_nt_tui_ratatui::main;