build: 🛠 Improve Justfile help output

Enter `just` to see a list of available commands
with explanations.

Added `just ci` step.
Added `just fmt-check`.
Removed unnecessary kernel file removals.
Moved sdeject task and added `just device-eject`.
This commit is contained in:
Berkus Decker 2021-12-21 02:17:08 +02:00
parent cc4170200f
commit b26d61cb67
4 changed files with 47 additions and 21 deletions

View File

@ -1,62 +1,80 @@
_default:
@just --list
# Build and run kernel in QEMU with serial port emulation
zellij: zellij:
# Build and run kernel in QEMU with serial port emulation
cargo make zellij-config cargo make zellij-config
zellij --layout-path emulation/layout.zellij zellij --layout-path emulation/layout.zellij
# Build and run kernel in QEMU
qemu: qemu:
# Build and run kernel in QEMU
cargo make qemu cargo make qemu
# Build and run kernel in QEMU with GDB port enabled
qemu-gdb: qemu-gdb:
# Build and run kernel in QEMU with GDB port enabled
cargo make qemu-gdb cargo make qemu-gdb
# Build and write kernel to an SD Card
device: device:
# Build and write kernel to an SD Card
cargo make sdcard cargo make sdcard
# Build and write kernel to an SD Card, then eject the SD Card volume
device-eject:
cargo make sdeject
# Build default hw kernel
build: build:
# Build default hw kernel
cargo make build cargo make build
# Clean project
clean: clean:
# Clean project
cargo make clean cargo make clean
rm -f kernel8 kernel8.img
# Run clippy checks
clippy: clippy:
# Run clippy checks # TODO: use cargo-hack
cargo make clippy cargo make clippy
env CLIPPY_FEATURES=noserial cargo make clippy
env CLIPPY_FEATURES=qemu cargo make clippy
env CLIPPY_FEATURES=noserial,qemu cargo make clippy
env CLIPPY_FEATURES=jtag cargo make clippy
env CLIPPY_FEATURES=noserial,jtag cargo make clippy
# Run tests in QEMU
test: test:
# Run tests in QEMU
cargo make test cargo make test
alias disasm := hopper alias disasm := hopper
# Build and disassemble kernel
hopper: hopper:
# Build and disassemble kernel
cargo make hopper cargo make hopper
alias ocd := openocd alias ocd := openocd
# Start openocd (by default connected via JTAG to a target device)
openocd: openocd:
# Start openocd (by default connected via JTAG to a target device)
cargo make openocd cargo make openocd
# Build and run kernel in GDB using openocd or QEMU as target (gdb port 5555)
gdb: gdb:
# Build and run kernel in GDB using openocd or QEMU as target (gdb port 5555)
cargo make gdb cargo make gdb
# Build and print all symbols in the kernel
nm: nm:
# Build and print all symbols in the kernel
cargo make nm cargo make nm
# Check formatting
fmt-check:
cargo fmt -- --check
# Run `cargo expand` on nucleus
expand: expand:
# Run `cargo expand` on modules
cargo make expand -- nucleus cargo make expand -- nucleus
# Generate and open documentation
doc: doc:
# Generate and open documentation
cargo make docs-flow cargo make docs-flow
# Run CI tasks
ci: clean build test clippy fmt-check

View File

@ -77,3 +77,9 @@ dependencies = ["kernel-binary"]
[tasks.modules] [tasks.modules]
command = "cargo" command = "cargo"
args = ["modules", "tree"] args = ["modules", "tree"]
[tasks.sdeject]
dependencies = ["sdcard"]
script = [
"diskutil unmount ${VOLUME}"
]

View File

@ -94,6 +94,14 @@ You need to have [Hopper](https://hopperapp.com) and hopperv4 cli helper install
just disasm just disasm
``` ```
### To see other available commands
```
just
```
It will list all just commands with their short descriptions.
## Development flow ## Development flow
`mainline`, `develop` and `released` branches: `mainline`, `develop` and `released` branches:

View File

@ -122,12 +122,6 @@ script = [
''' '''
] ]
[tasks.sdeject]
dependencies = ["sdcard"]
script = [
"diskutil unmount ${VOLUME}"
]
[tasks.clippy] [tasks.clippy]
env = { "TARGET_FEATURES" = { value = "--features=${CLIPPY_FEATURES}", condition = { env_set = ["CLIPPY_FEATURES"] } } } env = { "TARGET_FEATURES" = { value = "--features=${CLIPPY_FEATURES}", condition = { env_set = ["CLIPPY_FEATURES"] } } }
command = "cargo" command = "cargo"