Remove seperate editor and xtask
This commit is contained in:
parent
1797bc7cda
commit
7b185a94d4
9 changed files with 35 additions and 139 deletions
|
@ -1,2 +1 @@
|
|||
[alias]
|
||||
xtask = "run --quiet --package xtask --"
|
33
Cargo.toml
33
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
|
10
README.md
10
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
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
[package]
|
||||
name = "editor"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
fn main() {
|
||||
todo!()
|
||||
}
|
||||
|
|
@ -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
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
pub fn build_editor() {
|
||||
todo!()
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -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!()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue