mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Fiddle around with the build script to try and speed it up
This commit is contained in:
parent
a32bb2125b
commit
3143d89359
36
justfile
36
justfile
|
@ -1,10 +1,20 @@
|
||||||
export CARGO_TARGET_DIR := env_var_or_default('CARGO_TARGET_DIR', justfile_directory() + "/target")
|
export CARGO_TARGET_DIR := env_var_or_default('CARGO_TARGET_DIR', justfile_directory() + "/target")
|
||||||
export RUSTFLAGS := "-D warnings -D clippy::all"
|
|
||||||
|
|
||||||
build: build-roms
|
build: build-roms
|
||||||
|
|
||||||
|
build-debug:
|
||||||
|
just _all-crates _build-debug
|
||||||
|
build-release:
|
||||||
|
just _build-release agb
|
||||||
|
clippy:
|
||||||
|
just _all-crates _clippy
|
||||||
|
|
||||||
test:
|
test:
|
||||||
just _all-crates _test-debug
|
just _test-debug agb
|
||||||
|
just _test-debug agb-fixnum
|
||||||
|
|
||||||
|
test-release:
|
||||||
|
just _test-release agb
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
just _all-crates _clean
|
just _all-crates _clean
|
||||||
|
@ -23,11 +33,7 @@ run-game game:
|
||||||
run-game-debug game:
|
run-game-debug game:
|
||||||
(cd "examples/{{game}}" && cargo run)
|
(cd "examples/{{game}}" && cargo run)
|
||||||
|
|
||||||
ci: && build-roms build-book
|
ci: build-debug clippy test build-release test-release build-roms build-book
|
||||||
just _all-crates _build
|
|
||||||
just _all-crates _test-debug
|
|
||||||
just _all-crates _test-release
|
|
||||||
just _all-crates _clippy
|
|
||||||
|
|
||||||
build-roms:
|
build-roms:
|
||||||
just _build-rom "examples/the-purple-night" "PURPLENIGHT"
|
just _build-rom "examples/the-purple-night" "PURPLENIGHT"
|
||||||
|
@ -55,7 +61,7 @@ _build-rom folder name:
|
||||||
TARGET_FOLDER="${CARGO_TARGET_DIR:-$GAME_FOLDER/target}"
|
TARGET_FOLDER="${CARGO_TARGET_DIR:-$GAME_FOLDER/target}"
|
||||||
GBA_FILE="$TARGET_FOLDER/$GAME_NAME.gba"
|
GBA_FILE="$TARGET_FOLDER/$GAME_NAME.gba"
|
||||||
|
|
||||||
(cd "$GAME_FOLDER" && cargo build --release --target thumbv4t-none-eabi)
|
(cd "$GAME_FOLDER" && cargo clippy && cargo build --release --target thumbv4t-none-eabi)
|
||||||
|
|
||||||
mkdir -p examples/target/examples
|
mkdir -p examples/target/examples
|
||||||
|
|
||||||
|
@ -65,17 +71,21 @@ _build-rom folder name:
|
||||||
cp -v "$GBA_FILE" "examples/target/examples/$GAME_NAME.gba"
|
cp -v "$GBA_FILE" "examples/target/examples/$GAME_NAME.gba"
|
||||||
|
|
||||||
_all-crates target:
|
_all-crates target:
|
||||||
for CARGO_PROJECT_FILE in agb-*/Cargo.toml agb/Cargo.toml examples/*/Cargo.toml book/games/*/Cargo.toml; do \
|
for CARGO_PROJECT_FILE in agb-*/Cargo.toml agb/Cargo.toml; do \
|
||||||
PROJECT_DIR=$(dirname "$CARGO_PROJECT_FILE"); \
|
PROJECT_DIR=$(dirname "$CARGO_PROJECT_FILE"); \
|
||||||
just "{{target}}" "$PROJECT_DIR" || exit $?; \
|
just "{{target}}" "$PROJECT_DIR" || exit $?; \
|
||||||
done
|
done
|
||||||
|
|
||||||
_build crate:
|
_build-debug crate:
|
||||||
(cd "{{crate}}" && cargo build)
|
(cd "{{crate}}" && cargo build --examples --tests)
|
||||||
|
_build-release crate:
|
||||||
|
(cd "{{crate}}" && cargo build --release --examples --tests)
|
||||||
_test-release crate:
|
_test-release crate:
|
||||||
{{ if crate =~ 'agb.*' { "cd " + crate + " && cargo test --release" } else { "" } }}
|
just _build-release {{crate}}
|
||||||
|
(cd "{{crate}}" && cargo test --release)
|
||||||
_test-debug crate:
|
_test-debug crate:
|
||||||
{{ if crate =~ 'agb.*' { "cd " + crate + " && cargo test" } else { "" } }}
|
just _build-debug {{crate}}
|
||||||
|
(cd "{{crate}}" && cargo test)
|
||||||
_clippy crate:
|
_clippy crate:
|
||||||
{{ if crate =~ 'agb.*' { "cd " + crate + " && cargo clippy" } else { "" } }}
|
{{ if crate =~ 'agb.*' { "cd " + crate + " && cargo clippy" } else { "" } }}
|
||||||
_clean crate:
|
_clean crate:
|
||||||
|
|
Loading…
Reference in a new issue