From 0618d0807663a4f0842b460d2d7c5fbbad005152 Mon Sep 17 00:00:00 2001 From: Caznix Date: Mon, 2 Dec 2024 18:57:00 -0500 Subject: [PATCH] Remove seperate editor and xtask --- .cargo/config.toml | 1 - Cargo.toml | 33 +++++++++++++++++++++--- README.md | 10 ++++---- editor/Cargo.toml | 5 ---- editor/src/main.rs | 4 --- xtask/Cargo.toml | 32 ----------------------- xtask/src/editor.rs | 4 --- xtask/src/engine.rs | 23 ----------------- xtask/src/main.rs | 62 --------------------------------------------- 9 files changed, 35 insertions(+), 139 deletions(-) delete mode 100644 editor/Cargo.toml delete mode 100644 editor/src/main.rs delete mode 100644 xtask/Cargo.toml delete mode 100644 xtask/src/editor.rs delete mode 100644 xtask/src/engine.rs delete mode 100644 xtask/src/main.rs diff --git a/.cargo/config.toml b/.cargo/config.toml index 0c612da..ae0e944 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1 @@ [alias] -xtask = "run --quiet --package xtask --" \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 63ba671..62e0d78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,34 @@ [workspace] resolver = "2" members = [ - "engine", - "editor", - "xtask", + "engine" ] + +[profile.dev] +rpath = false +panic = "abort" +lto = "off" +opt-level = 0 +debug = false +overflow-checks = false +incremental = true +codegen-units = 512 + +strip = "symbols" +debug-assertions = false + +[profile.dev.package."*"] +opt-level = 0 +debug = false +overflow-checks = false +incremental = true +codegen-units = 512 + +strip = "symbols" +debug-assertions = false +[profile.dev.build-override] +opt-level = 0 +debug = false +overflow-checks = false +incremental = true +codegen-units = 512 \ No newline at end of file diff --git a/README.md b/README.md index c3c936b..14ef1e8 100644 --- a/README.md +++ b/README.md @@ -125,20 +125,20 @@ your platform: **1**. Clone the repository: -```ps1 +```bash git clone https://github.com/Caznix/Zenyx.git ``` **2**. cd into the project directory -```PS1 +```bash cd ./Zenyx ``` -**3**. Build the project using the xtask: +**3**. Build the project -```ps1 -cargo xtask run core # also use editor for editor, or engine for both +```bash +cargo run ``` ### macOS diff --git a/editor/Cargo.toml b/editor/Cargo.toml deleted file mode 100644 index b9c38f2..0000000 --- a/editor/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -[package] -name = "editor" -version = "0.1.0" -edition = "2021" - diff --git a/editor/src/main.rs b/editor/src/main.rs deleted file mode 100644 index dcfd9e3..0000000 --- a/editor/src/main.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - todo!() -} - diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml deleted file mode 100644 index 7e4ef1a..0000000 --- a/xtask/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "xtask" -version = "0.1.0" -edition = "2021" - - -[dependencies] -clap = { version = "4.5.20", features = ["derive"] } - -[profile.dev] -rpath = false -panic = "abort" -lto = "off" -opt-level = 0 -debug = false -overflow-checks = false -incremental = true -codegen-units = 256 - -strip = "symbols" -debug-assertions = false - -[profile.dev.package."*"] -opt-level = 0 -debug = false -overflow-checks = false -incremental = true -codegen-units = 256 - -strip = "symbols" -debug-assertions = false - diff --git a/xtask/src/editor.rs b/xtask/src/editor.rs deleted file mode 100644 index 2fb341f..0000000 --- a/xtask/src/editor.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub fn build_editor() { - todo!() -} - diff --git a/xtask/src/engine.rs b/xtask/src/engine.rs deleted file mode 100644 index 4e901f2..0000000 --- a/xtask/src/engine.rs +++ /dev/null @@ -1,23 +0,0 @@ -use std::process::Stdio; - -pub fn build_engine() { - todo!() -} - -pub fn build_core() { - let threads = format!("-j{}", std::thread::available_parallelism().unwrap().get()); - - let mut run = std::process::Command::new("cargo") - .arg("run") - .arg(threads) - .arg("--bin") - .arg("zenyx") - .stdin(Stdio::inherit()) - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .spawn() - .unwrap(); - - run.wait().unwrap(); -} - diff --git a/xtask/src/main.rs b/xtask/src/main.rs deleted file mode 100644 index e3e07c8..0000000 --- a/xtask/src/main.rs +++ /dev/null @@ -1,62 +0,0 @@ -use clap::{CommandFactory, Parser, Subcommand, ValueEnum}; -pub mod editor; -pub mod engine; - -#[derive(Parser)] -#[command(version, about, long_about = None,disable_version_flag = true,disable_help_flag = true)] -struct Cli { - #[arg(short, long)] - release: bool, - #[command(subcommand)] - command: Option, -} - -#[derive(Subcommand)] -enum Commands { - Run { - #[arg()] - task: Task, - }, - Config, -} - -#[derive(Clone, ValueEnum)] -enum Task { - Engine, // Builds both editor and core - Editor, // Builds editor only - Core, // Builds engine core only - Help, -} - -fn main() { - let cli = Cli::parse(); - - if cli.release { - println!("Running in release mode") - } - - match &cli.command { - None => { - Cli::command() - .print_help() - .map_err(|e| { - println!("Could not run Xtask: {e}"); - }) - .unwrap(); - } - Some(Commands::Run { task }) => match task { - Task::Engine => engine::build_engine(), - Task::Editor => todo!("Editor is not being actively worked on"), - Task::Core => { - engine::build_core(); - } - Task::Help => { - println!("The following options are avalible to run"); - todo!() - } - }, - Some(Commands::Config) => { - todo!() - } - } -}