From a9148a7325b191fe52330d0512daf897c41b2902 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Sat, 21 May 2022 14:20:04 +0300 Subject: [PATCH] readme + license + tweaks for template generator --- template/Cargo.toml | 10 ++++++++++ template/LICENSE | 21 +++++++++++++++++++++ template/README.md | 34 ++++++++++++++++++++++++++++++++++ template/src/main.rs | 4 ++-- 4 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 template/LICENSE create mode 100644 template/README.md diff --git a/template/Cargo.toml b/template/Cargo.toml index 27d5c83ab..491cc267c 100644 --- a/template/Cargo.toml +++ b/template/Cargo.toml @@ -2,6 +2,16 @@ name = "fyrox-template" version = "0.1.0" edition = "2021" +authors = ["Dmitry Stepanov "] +license = "MIT" +description = "Project template generator for Fyrox engine" +keywords = ["fyrox", "game", "project"] +categories = ["game-development"] +include = ["/src/**/*", "/Cargo.toml", "/LICENSE", "/README.md"] +homepage = "https://fyrox.rs" +repository = "https://github.com/FyroxEngine/Fyrox" +readme = "README.md" +rust-version = "1.56" [dependencies] clap = { version="3.1.18", features = ["derive"]} \ No newline at end of file diff --git a/template/LICENSE b/template/LICENSE new file mode 100644 index 000000000..9bcce00dc --- /dev/null +++ b/template/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Dmitry Stepanov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/template/README.md b/template/README.md new file mode 100644 index 000000000..82df8d3db --- /dev/null +++ b/template/README.md @@ -0,0 +1,34 @@ +# Fyrox Engine Project Template Generator + +This tiny utility handles project generation for Fyrox Game Engine. It creates a workspace with three projects: + +- Game - your game project (library) +- Editor - the editor with your game attached as a plugin +- Executor - the "runner" for your game. + +It also populates each project with boilerplate code. The main purpose of the project is to reduce amount of time +that is needed to set up a new project. + +## Usage + +Install it via `cargo` first: + +```shell +cargo install fyrox-template +``` + +Navigate to a folder and call: + +```shell +fyrox-template +``` + +It will create a new folder with `` and it will contain three projects, runnable only two of them: + +- `cargo run --package editor --release` - to run your game inside the editor. +- `cargo run --package executor --release` - to run your game as a standalone project. It will also produce final +binary of your game, that can be shipped to a store. + +## Tips + +There is nothing special in generated project, so you can tweak them as you wish. \ No newline at end of file diff --git a/template/src/main.rs b/template/src/main.rs index 0276f8c03..875bd6472 100644 --- a/template/src/main.rs +++ b/template/src/main.rs @@ -210,7 +210,7 @@ fn main() {{ ); } -fn init_workspace(base_path: &Path, args: &Args) { +fn init_workspace(base_path: &Path) { Command::new("cargo") .args(&["init", "--vcs", "git"]) .arg(base_path) @@ -242,7 +242,7 @@ fn main() { let base_path = Path::new(&args.name); - init_workspace(&base_path, &args); + init_workspace(&base_path); init_game(&base_path, &args); init_editor(&base_path, &args); init_executor(&base_path, &args);