Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .rnr/bin/rnr-linux-amd64
Binary file not shown.
Binary file added .rnr/bin/rnr-macos-amd64
Binary file not shown.
Binary file added .rnr/bin/rnr-macos-arm64
Binary file not shown.
Binary file added .rnr/bin/rnr-windows-amd64.exe
Binary file not shown.
Binary file added .rnr/bin/rnr-windows-arm64.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions .rnr/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 0.1.0
platforms:
- linux-amd64
- macos-amd64
- macos-arm64
- windows-amd64
- windows-arm64
30 changes: 30 additions & 0 deletions rnr
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
set -e

# Detect OS
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
EXT=""
case "$OS" in
linux*) OS="linux" ;;
darwin*) OS="macos" ;;
mingw*|msys*|cygwin*) OS="windows"; EXT=".exe" ;;
*) echo "Error: Unsupported OS: $OS" >&2; exit 1 ;;
esac

# Detect architecture
ARCH=$(uname -m)
case "$ARCH" in
x86_64|amd64) ARCH="amd64" ;;
arm64|aarch64) ARCH="arm64" ;;
*) echo "Error: Unsupported architecture: $ARCH" >&2; exit 1 ;;
esac

BINARY="$(dirname "$0")/.rnr/bin/rnr-${OS}-${ARCH}${EXT}"

if [ ! -f "$BINARY" ]; then
echo "Error: rnr is not configured for ${OS}-${ARCH}." >&2
echo "Run 'rnr init --add-platform ${OS}-${ARCH}' to add support." >&2
exit 1
fi

exec "$BINARY" "$@"
19 changes: 19 additions & 0 deletions rnr.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@echo off
setlocal

:: Detect architecture
if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
set "ARCH=arm64"
) else (
set "ARCH=amd64"
)

set "BINARY=%~dp0.rnr\bin\rnr-windows-%ARCH%.exe"

if not exist "%BINARY%" (
echo Error: rnr is not configured for windows-%ARCH%. >&2
echo Run 'rnr init --add-platform windows-%ARCH%' to add support. >&2
exit /b 1
)

"%BINARY%" %*
62 changes: 62 additions & 0 deletions rnr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# rnr task definitions for rnr.cli development
# Run ./rnr --list to see available tasks

# Code formatting
fmt:
description: Format code with rustfmt
cmd: cargo fmt

# Linting
clippy:
description: Run clippy lints
cmd: cargo clippy -- -D warnings

# Testing
test:
description: Run all tests
cmd: cargo test

# Full validation (run before commits)
check:
description: Run fmt, clippy, and tests
steps:
- task: fmt
- task: clippy
- task: test

# Build
build:
description: Build release binary
cmd: cargo build --release

# Dogfooding - build and update local rnr binary
# Use the task matching your platform, or dogfood-all for all platforms
dogfood-windows-amd64:
description: Build and install to .rnr/bin (Windows x64)
cmd: cargo build --release && copy /Y target\release\rnr.exe .rnr\bin\rnr-windows-amd64.exe

dogfood-windows-arm64:
description: Build and install to .rnr/bin (Windows ARM64)
cmd: cargo build --release && copy /Y target\release\rnr.exe .rnr\bin\rnr-windows-arm64.exe

dogfood-linux-amd64:
description: Build and install to .rnr/bin (Linux x64)
cmd: cargo build --release && cp target/release/rnr .rnr/bin/rnr-linux-amd64

dogfood-macos-amd64:
description: Build and install to .rnr/bin (macOS x64)
cmd: cargo build --release && cp target/release/rnr .rnr/bin/rnr-macos-amd64

dogfood-macos-arm64:
description: Build and install to .rnr/bin (macOS ARM64)
cmd: cargo build --release && cp target/release/rnr .rnr/bin/rnr-macos-arm64

# Build and install for all configured platforms
dogfood-all:
description: Build and install to .rnr/bin for all platforms
steps:
- task: dogfood-windows-amd64
- task: dogfood-windows-arm64
- task: dogfood-linux-amd64
- task: dogfood-macos-amd64
- task: dogfood-macos-arm64