From 36673180617584e2efc720ab3a4408b9ab169661 Mon Sep 17 00:00:00 2001 From: c0repwn3r Date: Wed, 12 Apr 2023 11:46:38 -0400 Subject: [PATCH] remove justfile, add documentation on how to build --- BUILDING.md | 26 ++++++++++++++++++++++++++ justfile | 50 -------------------------------------------------- 2 files changed, 26 insertions(+), 50 deletions(-) create mode 100644 BUILDING.md delete mode 100644 justfile diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 0000000000000000000000000000000000000000..546b3866d641195b36d1037ab8b8847fbe648706 --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,26 @@ +# Building StarKingdoms + +StarKingdoms uses a small script called Spacetime as a build tool. Internally, it regenerates and runs a build.ninja file for compilation. + +## Dependencies + +For compilation, you will need the following tools installed: +- rust/cargo +- ninja +- inkscape +- sheep (see below) +- wasm-pack (see below - must be installed in a specific way) + +`sheep` and `wasm-pack` can be installed with the build-command `install_tooling`. Other tools will need to be installed with your distribution's package manager. +`wasm-pack` *must* be installed with `install_tooling`, otherwise the build will crash. + +If you get a `sheep: command not found` error, or the same with wasm-pack, add `$HOME/.cargo/bin/` to your `PATH`. + +## Running build commands + +Build commands are ran with the `st` shell script. Run `./st ` to run a build. +`st` can be run from any directory - you could run `../../st run-server` from `server/src/`, and it would still properly build and run the server. + +## Available build commands + +Run the build-command `help` to view a list of all build-commands. \ No newline at end of file diff --git a/justfile b/justfile deleted file mode 100644 index 2834fc454576b326a69471d0306f9a54bbaa1571..0000000000000000000000000000000000000000 --- a/justfile +++ /dev/null @@ -1,50 +0,0 @@ -run_server: - cargo run --bin starkingdoms-server - -run_http: build_client_bundle - cd web && python3 -m http.server - -run_http_prod: build_client_bundle_prod - cd web && python3 -m http.server - -build_client_bundle: build_assets - rm -rf web/dist - RUST_BACKTRACE=1 wasm-pack build --target web client - cp -r client/pkg web/dist - -build_client_bundle_prod: build_assets - rm -rf web/dist - RUST_BACKTRACE=1 wasm-pack build --target web client --no-default-features --features textures-fast - cp -r client/pkg web/dist - -install_tooling: - cargo install wasm-pack --no-default-features - cargo install sheep_cli - -clean: - rm -rf target - rm -rf client/pkg - rm -rf web/dist - -build_assets: build_assets_full build_assets_375 build_assets_125 - -build_assets_full: - mkdir -p assets/final/full - inkscape -w 512 -h 512 assets/svg/*.svg --export-type "png" - inkscape -w 2048 -h 2048 assets/svg/earth.svg --export-type "png" # Earth is a different size than all other sprites - mv assets/svg/*.png assets/final/full/ - sheep pack assets/final/full/*.png -f amethyst_named -o assets/dist/spritesheet-full - -build_assets_375: - mkdir -p assets/final/375 - inkscape -w 192 -h 192 assets/svg/*.svg --export-type "png" - inkscape -w 768 -h 768 assets/svg/earth.svg --export-type "png" # Earth is a different size than all other sprites - mv assets/svg/*.png assets/final/375 - sheep pack assets/final/375/*.png -f amethyst_named -o assets/dist/spritesheet-375 - -build_assets_125: - mkdir -p assets/final/125 - inkscape -w 64 -h 64 assets/svg/*.svg --export-type "png" - inkscape -w 256 -h 256 assets/svg/earth.svg --export-type "png" # Earth is a different size than all other sprites - mv assets/svg/*.png assets/final/125 - sheep pack assets/final/125/*.png -f amethyst_named -o assets/dist/spritesheet-125 \ No newline at end of file