Skip to content

Commit 9e68689

Browse files
authored
feat(cli): add rnr.yaml for project development tasks (#47)
* feat(cli): add rnr.yaml for project development tasks Adds task definitions for: - fmt: Format code with rustfmt - clippy: Run clippy lints - test: Run all tests - check: Run fmt, clippy, and tests (pre-commit validation) - build: Build release binary - dogfood-{platform}: Build and install to .rnr/bin for specific platform - dogfood-all: Build and install for all platforms * chore(cli): initialize rnr with all platforms Adds .rnr directory with binaries for all platforms and wrapper scripts for dogfooding during development.
1 parent 84e0fae commit 9e68689

9 files changed

Lines changed: 118 additions & 0 deletions

File tree

.rnr/bin/rnr-linux-amd64

2.56 MB
Binary file not shown.

.rnr/bin/rnr-macos-amd64

2.18 MB
Binary file not shown.

.rnr/bin/rnr-macos-arm64

1.88 MB
Binary file not shown.

.rnr/bin/rnr-windows-amd64.exe

2.17 MB
Binary file not shown.

.rnr/bin/rnr-windows-arm64.exe

1.92 MB
Binary file not shown.

.rnr/config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 0.1.0
2+
platforms:
3+
- linux-amd64
4+
- macos-amd64
5+
- macos-arm64
6+
- windows-amd64
7+
- windows-arm64

rnr

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# Detect OS
5+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
6+
EXT=""
7+
case "$OS" in
8+
linux*) OS="linux" ;;
9+
darwin*) OS="macos" ;;
10+
mingw*|msys*|cygwin*) OS="windows"; EXT=".exe" ;;
11+
*) echo "Error: Unsupported OS: $OS" >&2; exit 1 ;;
12+
esac
13+
14+
# Detect architecture
15+
ARCH=$(uname -m)
16+
case "$ARCH" in
17+
x86_64|amd64) ARCH="amd64" ;;
18+
arm64|aarch64) ARCH="arm64" ;;
19+
*) echo "Error: Unsupported architecture: $ARCH" >&2; exit 1 ;;
20+
esac
21+
22+
BINARY="$(dirname "$0")/.rnr/bin/rnr-${OS}-${ARCH}${EXT}"
23+
24+
if [ ! -f "$BINARY" ]; then
25+
echo "Error: rnr is not configured for ${OS}-${ARCH}." >&2
26+
echo "Run 'rnr init --add-platform ${OS}-${ARCH}' to add support." >&2
27+
exit 1
28+
fi
29+
30+
exec "$BINARY" "$@"

rnr.cmd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@echo off
2+
setlocal
3+
4+
:: Detect architecture
5+
if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
6+
set "ARCH=arm64"
7+
) else (
8+
set "ARCH=amd64"
9+
)
10+
11+
set "BINARY=%~dp0.rnr\bin\rnr-windows-%ARCH%.exe"
12+
13+
if not exist "%BINARY%" (
14+
echo Error: rnr is not configured for windows-%ARCH%. >&2
15+
echo Run 'rnr init --add-platform windows-%ARCH%' to add support. >&2
16+
exit /b 1
17+
)
18+
19+
"%BINARY%" %*

rnr.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# rnr task definitions for rnr.cli development
2+
# Run ./rnr --list to see available tasks
3+
4+
# Code formatting
5+
fmt:
6+
description: Format code with rustfmt
7+
cmd: cargo fmt
8+
9+
# Linting
10+
clippy:
11+
description: Run clippy lints
12+
cmd: cargo clippy -- -D warnings
13+
14+
# Testing
15+
test:
16+
description: Run all tests
17+
cmd: cargo test
18+
19+
# Full validation (run before commits)
20+
check:
21+
description: Run fmt, clippy, and tests
22+
steps:
23+
- task: fmt
24+
- task: clippy
25+
- task: test
26+
27+
# Build
28+
build:
29+
description: Build release binary
30+
cmd: cargo build --release
31+
32+
# Dogfooding - build and update local rnr binary
33+
# Use the task matching your platform, or dogfood-all for all platforms
34+
dogfood-windows-amd64:
35+
description: Build and install to .rnr/bin (Windows x64)
36+
cmd: cargo build --release && copy /Y target\release\rnr.exe .rnr\bin\rnr-windows-amd64.exe
37+
38+
dogfood-windows-arm64:
39+
description: Build and install to .rnr/bin (Windows ARM64)
40+
cmd: cargo build --release && copy /Y target\release\rnr.exe .rnr\bin\rnr-windows-arm64.exe
41+
42+
dogfood-linux-amd64:
43+
description: Build and install to .rnr/bin (Linux x64)
44+
cmd: cargo build --release && cp target/release/rnr .rnr/bin/rnr-linux-amd64
45+
46+
dogfood-macos-amd64:
47+
description: Build and install to .rnr/bin (macOS x64)
48+
cmd: cargo build --release && cp target/release/rnr .rnr/bin/rnr-macos-amd64
49+
50+
dogfood-macos-arm64:
51+
description: Build and install to .rnr/bin (macOS ARM64)
52+
cmd: cargo build --release && cp target/release/rnr .rnr/bin/rnr-macos-arm64
53+
54+
# Build and install for all configured platforms
55+
dogfood-all:
56+
description: Build and install to .rnr/bin for all platforms
57+
steps:
58+
- task: dogfood-windows-amd64
59+
- task: dogfood-windows-arm64
60+
- task: dogfood-linux-amd64
61+
- task: dogfood-macos-amd64
62+
- task: dogfood-macos-arm64

0 commit comments

Comments
 (0)