docs: document using just in the codebase
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I56d1de8a88bb28e49e6387a320f318c86a6a6964
This commit is contained in:
parent
7584eb76e1
commit
815f4a4725
1 changed files with 38 additions and 13 deletions
51
README.md
51
README.md
|
|
@ -169,27 +169,44 @@ Entry:
|
||||||
### Building
|
### Building
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Configure
|
# Using just (recommended)
|
||||||
$ cmake -B build
|
$ just build
|
||||||
|
|
||||||
# Build
|
# Or manually with CMake
|
||||||
$ make
|
$ cmake -B build -G Ninja
|
||||||
|
$ cmake --build build
|
||||||
|
|
||||||
# The nix-irc executable will be in the project root
|
# The nix-irc executable will be in build/
|
||||||
$ ./nix-irc --help
|
$ ./build/nix-irc --help
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Available Tasks
|
||||||
|
|
||||||
|
Run `just` to see all available tasks:
|
||||||
|
|
||||||
|
- `just build` - Build all targets
|
||||||
|
- `just test` - Run all tests (unit, compile, integration)
|
||||||
|
- `just bench` - Run performance benchmarks
|
||||||
|
- `just clean` - Clean build artifacts
|
||||||
|
- `just smoke` - Run quick smoke test
|
||||||
|
- `just stats` - Show project statistics
|
||||||
|
|
||||||
|
See `just --list` for the complete list of available commands.
|
||||||
|
|
||||||
### Compiling Nix to IR
|
### Compiling Nix to IR
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Basic compilation
|
# Basic compilation
|
||||||
$ nix-irc input.nix output.nixir
|
$ ./build/nix-irc input.nix output.nixir
|
||||||
|
|
||||||
# With import search paths
|
# With import search paths
|
||||||
$ nix-irc -I ./lib -I /nix/store/... input.nix output.nixir
|
$ ./build/nix-irc -I ./lib -I /nix/store/... input.nix output.nixir
|
||||||
|
|
||||||
# Disable import resolution
|
# Disable import resolution
|
||||||
$ nix-irc --no-imports input.nix output.nixir
|
$ ./build/nix-irc --no-imports input.nix output.nixir
|
||||||
|
|
||||||
|
# Using just
|
||||||
|
$ just compile input.nix output.nixir
|
||||||
```
|
```
|
||||||
|
|
||||||
### Runtime Evaluation (Plugin)
|
### Runtime Evaluation (Plugin)
|
||||||
|
|
@ -212,13 +229,21 @@ $ nix --plugin-files ./nix-ir-plugin.so eval --expr 'builtins.nixIR_info'
|
||||||
### Running Tests
|
### Running Tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Test all sample files
|
# Run all tests
|
||||||
for f in tests/*.nix; do
|
$ just test
|
||||||
./nix-irc "$f" "${f%.nix}.nixir"
|
|
||||||
|
# Run specific test suites
|
||||||
|
$ just test-unit # Unit tests only
|
||||||
|
$ just test-compile # Compilation tests only
|
||||||
|
$ just test-integration # Integration tests only
|
||||||
|
|
||||||
|
# Manually test all fixtures
|
||||||
|
$ for f in tests/fixtures/*.nix; do
|
||||||
|
./build/nix-irc "$f" "${f%.nix}.nixir"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Verify IR format
|
# Verify IR format
|
||||||
$ hexdump -C tests/simple.nixir | head -3
|
$ hexdump -C tests/fixtures/simple.nixir | head -3
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue