Remove seperate editor and xtask

This commit is contained in:
Chance 2024-12-02 18:57:00 -05:00 committed by BitSyndicate
parent b7d727d9b5
commit 0618d08076
9 changed files with 35 additions and 139 deletions

View file

@ -1,2 +1 @@
[alias] [alias]
xtask = "run --quiet --package xtask --"

View file

@ -1,7 +1,34 @@
[workspace] [workspace]
resolver = "2" resolver = "2"
members = [ members = [
"engine", "engine"
"editor",
"xtask",
] ]
[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

View file

@ -125,20 +125,20 @@ your platform:
**1**. Clone the repository: **1**. Clone the repository:
```ps1 ```bash
git clone https://github.com/Caznix/Zenyx.git git clone https://github.com/Caznix/Zenyx.git
``` ```
**2**. cd into the project directory **2**. cd into the project directory
```PS1 ```bash
cd ./Zenyx cd ./Zenyx
``` ```
**3**. Build the project using the xtask: **3**. Build the project
```ps1 ```bash
cargo xtask run core # also use editor for editor, or engine for both cargo run
``` ```
### macOS ### macOS

View file

@ -1,5 +0,0 @@
[package]
name = "editor"
version = "0.1.0"
edition = "2021"

View file

@ -1,4 +0,0 @@
fn main() {
todo!()
}

View file

@ -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

View file

@ -1,4 +0,0 @@
pub fn build_editor() {
todo!()
}

View file

@ -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();
}

View file

@ -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<Commands>,
}
#[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!()
}
}
}