First step of workspace splitting

This commit is contained in:
Dandaedre 2025-02-08 17:58:57 +01:00
parent 02d92e4a99
commit 95fb8b6a06
17 changed files with 60 additions and 35 deletions

View File

@ -1,32 +1,12 @@
# cargo-features = ["codegen-backend"]
[package]
name = "ravenous-tools"
version = "0.1.4"
edition = "2021"
[workspace]
members = [
"ravenous-tools",
"tablegen",
]
resolver = "3"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.86"
charts-rs = { version = "0.3.11" }
clap = { version = "4.5.7", features = ["derive"] }
console = "0.15.8"
csv = "1.3.0"
debug_print = "1.0.0"
dynfmt = { version = "0.1.5", features = ["curly"] }
glob = "0.3.1"
indexmap = "2.2.6"
indicatif = "0.17.8"
logos = "0.14.0"
phf = { version = "0.11.2", features = ["macros"] }
regex = "1.10.5"
regex_static = "0.1.1"
ron = "0.8.1"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.117"
tokio = { version = "1.38.0", features = ["full"] }
toml = "0.8.14"
[profile.dev]
debug = 0
# codegen-backend = "cranelift"

26
ravenous-tools/Cargo.toml Normal file
View File

@ -0,0 +1,26 @@
# cargo-features = ["codegen-backend"]
[package]
name = "ravenous-tools"
version = "0.1.4"
edition = "2024"
[dependencies]
anyhow = "1.0.86"
charts-rs = { version = "0.3.11" }
clap = { version = "4.5.7", features = ["derive"] }
console = "0.15.8"
csv = "1.3.0"
debug_print = "1.0.0"
dynfmt = { version = "0.1.5", features = ["curly"] }
glob = "0.3.1"
indexmap = "2.2.6"
indicatif = "0.17.8"
logos = "0.14.0"
phf = { version = "0.11.2", features = ["macros"] }
regex = "1.10.5"
regex_static = "0.1.1"
ron = "0.8.1"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.117"
tokio = { version = "1.38.0", features = ["full"] }
toml = "0.8.14"

View File

@ -1,7 +1,7 @@
//! Export graphs
use charts_rs::{get_or_try_init_fonts, RadarChart, RadarIndicator, Series};
use charts_rs::{Box, Color};
use charts_rs::{RadarChart, RadarIndicator, Series, get_or_try_init_fonts};
use glob::glob;
use serde::{Deserialize, Serialize};
use std::io::Read;
@ -114,7 +114,7 @@ fn del_graphs(args: &GraphConfig) -> Result<()> {
/// Generate the graph and save it
fn gen_graph(args: &GraphConfig) -> Result<()> {
// Import CSV
let data = include_bytes!("../data/lmroman8-regular.ttf") as &[u8];
let data = include_bytes!("../../data/lmroman8-regular.ttf") as &[u8];
get_or_try_init_fonts(Some(vec![data])).unwrap();
let csv = import_csv(args)?;

View File

@ -3,7 +3,6 @@
//! This program is meant as a helper for the ravenous project.
//!
// #![allow(dead_code)]
#![warn(missing_docs)]
#![warn(clippy::missing_docs_in_private_items)]
mod graphs;
@ -26,10 +25,10 @@ use std::{
use anyhow::{Context, Result};
use clap::{Args, Parser, Subcommand};
use graphs::{make_graphs, GraphConfig};
use makepdf::{make_pdf, MakeConfig};
use graphs::{GraphConfig, make_graphs};
use makepdf::{MakeConfig, make_pdf};
use serde::Deserialize;
use stats::{stat_solver, StatConfig};
use stats::{StatConfig, stat_solver};
use table_structs::Craft;
use tablegen::table_gen;
@ -63,8 +62,8 @@ struct ConfigArgs {
/// Wether to write the config to file, or just show it
#[arg(short, long, default_value_t = false)]
write: bool,
/// Wether to overwrite the file if it exists
/// Wether to overwrite the file if it exists
#[arg(short, long, default_value_t = false)]
force: bool,
@ -97,7 +96,7 @@ struct Classes {
fn main() -> Result<()> {
let args = ParserCLIArgs::parse();
let config_str = &fs::read_to_string("helper_config.toml")
.unwrap_or(include_str!("../helper_config.toml").to_string());
.unwrap_or(include_str!("../../helper_config.toml").to_string());
let config: Config = toml::from_str(config_str).expect("Coudln't read the config file");
match args.command {
Commands::Tablegen(args) => table_gen(&args, &config),

View File

@ -90,6 +90,7 @@ pub(super) fn make_file(args: &MakeConfig) -> BuilderParseResult {
}
}
/// Execute an external git command
macro_rules! exec_cmd {
($cmd:expr, $args:expr) => {
{

View File

@ -254,7 +254,6 @@ pub(super) enum LineType {
//TODO: Fix name collection
// #[regex(r"(\)+ )?\(\./[A-z/]+\.tex", |lex| lex.slice().split("(").next().unwrap_or("").to_string())]
// #[regex(r"(\)+ )?(\[\w+\])?\(\./[A-z/]+\.tex", |lex| lex.slice().split("(").next().unwrap_or("").to_string())]
// #[regex(r"[\) ]*\(\./[A-z/]+\.tex", |lex| lex.slice().split("(").nth(1).unwrap_or("").to_string())]
// #[regex(r"[\) ]*(\[[0-9]+\] )?\(\./[A-z/-_]+\.tex", |lex| lex.slice().split("(").nth(1).unwrap_or("").to_string())]
// #[regex(r"[\) 0-9\[\]]*\(\./[A-z/-_]+\.tex", |lex| lex.slice().split("(").nth(1).unwrap_or("").to_string())]

6
tablegen/Cargo.toml Normal file
View File

@ -0,0 +1,6 @@
[package]
name = "tablegen"
version = "0.1.0"
edition = "2024"
[dependencies]

14
tablegen/src/lib.rs Normal file
View File

@ -0,0 +1,14 @@
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}