From eba3532386705dce6524f07dafed37dc2e6b0657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Sat, 12 Dec 2020 02:12:00 +0100 Subject: [PATCH] move tools and chat-cli in src/bin and examples --- Cargo.lock | 22 +++---------------- Cargo.toml | 4 ---- chat-cli/Cargo.toml | 12 ---------- client/Cargo.toml | 6 +++++ .../src => client/examples/chat-cli}/main.rs | 2 +- common/Cargo.toml | 10 +++++++++ .../src => common/src/bin/csv_export}/main.rs | 2 +- tools/Cargo.toml | 10 --------- 8 files changed, 21 insertions(+), 47 deletions(-) delete mode 100644 chat-cli/Cargo.toml rename {chat-cli/src => client/examples/chat-cli}/main.rs (98%) rename {tools/src => common/src/bin/csv_export}/main.rs (99%) delete mode 100644 tools/Cargo.toml diff --git a/Cargo.lock b/Cargo.lock index e561af6992..099726f501 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4929,15 +4929,6 @@ dependencies = [ "serde", ] -[[package]] -name = "tools" -version = "0.1.0" -dependencies = [ - "csv", - "structopt", - "veloren-common", -] - [[package]] name = "tracing" version = "0.1.21" @@ -5296,16 +5287,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "veloren-chat-cli" -version = "0.8.0" -dependencies = [ - "tracing", - "tracing-subscriber", - "veloren-client", - "veloren-common", -] - [[package]] name = "veloren-client" version = "0.8.0" @@ -5322,6 +5303,7 @@ dependencies = [ "rayon", "specs", "tracing", + "tracing-subscriber", "uvth 3.1.1", "vek 0.12.0", "veloren-common", @@ -5337,6 +5319,7 @@ dependencies = [ "authc", "criterion", "crossbeam", + "csv", "directories-next", "dot_vox", "enum-iterator", @@ -5361,6 +5344,7 @@ dependencies = [ "specs", "specs-idvs", "spin_sleep", + "structopt", "sum_type", "tracing", "tracy-client", diff --git a/Cargo.toml b/Cargo.toml index 424a20d93e..560ad935cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,14 +5,12 @@ members = [ "common", "common/sys", "client", - "chat-cli", "server", "server-cli", "voxygen", "voxygen/anim", "world", "network", - "tools" ] # default profile for devs, fast to compile, okay enough to run, no debug information @@ -34,8 +32,6 @@ opt-level = 2 opt-level = 2 [profile.dev.package."veloren-client"] opt-level = 2 -[profile.dev.package."veloren-chat-cli"] -opt-level = 2 [profile.dev.package."veloren-server"] opt-level = 2 [profile.dev.package."veloren-server-cli"] diff --git a/chat-cli/Cargo.toml b/chat-cli/Cargo.toml deleted file mode 100644 index 95f06da02d..0000000000 --- a/chat-cli/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "veloren-chat-cli" -version = "0.8.0" -authors = ["Joshua Barretto "] -edition = "2018" - -[dependencies] -client = { package = "veloren-client", path = "../client" } -common = { package = "veloren-common", path = "../common" } - -tracing = { version = "0.1", default-features = false } -tracing-subscriber = { version = "0.2.3", default-features = false, features = ["fmt", "chrono", "ansi", "smallvec"] } diff --git a/client/Cargo.toml b/client/Cargo.toml index b076ad1b2f..d1f4ff721e 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -28,3 +28,9 @@ specs = { git = "https://github.com/amethyst/specs.git", rev = "7a2e348ab2223818 vek = { version = "0.12.0", features = ["serde"] } hashbrown = { version = "0.7.2", features = ["rayon", "serde", "nightly"] } authc = { git = "https://gitlab.com/veloren/auth.git", rev = "b943c85e4a38f5ec60cd18c34c73097640162bfe" } + +[dev-dependencies] +tracing-subscriber = { version = "0.2.3", default-features = false, features = ["fmt", "chrono", "ansi", "smallvec"] } + +[[example]] +name = "chat-cli" \ No newline at end of file diff --git a/chat-cli/src/main.rs b/client/examples/chat-cli/main.rs similarity index 98% rename from chat-cli/src/main.rs rename to client/examples/chat-cli/main.rs index 439a44619e..3ffaa7d5b9 100644 --- a/chat-cli/src/main.rs +++ b/client/examples/chat-cli/main.rs @@ -2,10 +2,10 @@ #![allow(clippy::option_map_unit_fn)] #![deny(clippy::clone_on_ref_ptr)] -use client::{Client, Event}; use common::{clock::Clock, comp}; use std::{io, net::ToSocketAddrs, sync::mpsc, thread, time::Duration}; use tracing::{error, info}; +use veloren_client::{Client, Event}; const TPS: u64 = 10; // Low value is okay, just reading messages. diff --git a/common/Cargo.toml b/common/Cargo.toml index a57ac12db3..e77f8e261d 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -8,6 +8,7 @@ edition = "2018" no-assets = [] tracy = ["tracy-client"] simd = ["vek/platform_intrinsics"] +bin_csv_export = ["csv", "structopt"] default = ["simd"] @@ -53,10 +54,15 @@ serde = { version = "1.0.110", features = ["derive", "rc"] } serde_json = "1.0.50" serde_repr = "0.1.6" +#esv export +csv = { version = "1.1.3", optional = true } +structopt = { version = "0.3.13", optional = true } + # Tracy tracy-client = { version = "0.9.0", optional = true } [dev-dependencies] +#bench criterion = "0.3" [[bench]] @@ -66,3 +72,7 @@ harness = false [[bench]] name = "color_benchmark" harness = false + +[[bin]] +name = "csv_export" +required-features = ["bin_csv_export"] \ No newline at end of file diff --git a/tools/src/main.rs b/common/src/bin/csv_export/main.rs similarity index 99% rename from tools/src/main.rs rename to common/src/bin/csv_export/main.rs index 4252a16206..5e408e78a9 100644 --- a/tools/src/main.rs +++ b/common/src/bin/csv_export/main.rs @@ -3,12 +3,12 @@ use std::error::Error; use structopt::StructOpt; -use common::comp; use comp::item::{ armor::{ArmorKind, Protection}, tool::ToolKind, ItemKind, }; +use veloren_common::comp; #[derive(StructOpt)] struct Cli { diff --git a/tools/Cargo.toml b/tools/Cargo.toml deleted file mode 100644 index 4cde9d623f..0000000000 --- a/tools/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "tools" -version = "0.1.0" -authors = ["Sam "] -edition = "2018" - -[dependencies] -common = { package = "veloren-common", path = "../common" } -csv = "1.1.3" -structopt = "0.3.13" \ No newline at end of file