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 @@
zellij: _default:
@just --list
# Build and run kernel in QEMU with serial port emulation # Build and run kernel in QEMU with serial port emulation
zellij:
cargo make zellij-config cargo make zellij-config
zellij --layout-path emulation/layout.zellij zellij --layout-path emulation/layout.zellij
qemu:
# Build and run kernel in QEMU # Build and run kernel in QEMU
qemu:
cargo make qemu cargo make qemu
qemu-gdb:
# Build and run kernel in QEMU with GDB port enabled # Build and run kernel in QEMU with GDB port enabled
qemu-gdb:
cargo make qemu-gdb cargo make qemu-gdb
device:
# Build and write kernel to an SD Card # Build and write kernel to an SD Card
device:
cargo make sdcard cargo make sdcard
build: # Build and write kernel to an SD Card, then eject the SD Card volume
device-eject:
cargo make sdeject
# Build default hw kernel # Build default hw kernel
build:
cargo make build cargo make build
clean:
# Clean project # Clean project
clean:
cargo make clean cargo make clean
rm -f kernel8 kernel8.img
clippy:
# Run clippy checks # Run clippy checks
clippy:
# 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
test:
# Run tests in QEMU # Run tests in QEMU
test:
cargo make test cargo make test
alias disasm := hopper alias disasm := hopper
hopper:
# Build and disassemble kernel # Build and disassemble kernel
hopper:
cargo make hopper cargo make hopper
alias ocd := openocd alias ocd := openocd
openocd:
# Start openocd (by default connected via JTAG to a target device) # Start openocd (by default connected via JTAG to a target device)
openocd:
cargo make openocd cargo make openocd
gdb:
# Build and run kernel in GDB using openocd or QEMU as target (gdb port 5555) # Build and run kernel in GDB using openocd or QEMU as target (gdb port 5555)
gdb:
cargo make gdb cargo make gdb
nm:
# Build and print all symbols in the kernel # Build and print all symbols in the kernel
nm:
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
doc:
# Generate and open documentation # Generate and open documentation
doc:
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"