diff --git a/.rnr/bin/rnr-linux-amd64 b/.rnr/bin/rnr-linux-amd64 new file mode 100644 index 0000000..d44ffea Binary files /dev/null and b/.rnr/bin/rnr-linux-amd64 differ diff --git a/.rnr/bin/rnr-macos-amd64 b/.rnr/bin/rnr-macos-amd64 new file mode 100644 index 0000000..e750215 Binary files /dev/null and b/.rnr/bin/rnr-macos-amd64 differ diff --git a/.rnr/bin/rnr-macos-arm64 b/.rnr/bin/rnr-macos-arm64 new file mode 100644 index 0000000..24b8e66 Binary files /dev/null and b/.rnr/bin/rnr-macos-arm64 differ diff --git a/.rnr/bin/rnr-windows-amd64.exe b/.rnr/bin/rnr-windows-amd64.exe new file mode 100644 index 0000000..737c280 Binary files /dev/null and b/.rnr/bin/rnr-windows-amd64.exe differ diff --git a/.rnr/bin/rnr-windows-arm64.exe b/.rnr/bin/rnr-windows-arm64.exe new file mode 100644 index 0000000..b82d578 Binary files /dev/null and b/.rnr/bin/rnr-windows-arm64.exe differ diff --git a/.rnr/config.yaml b/.rnr/config.yaml new file mode 100644 index 0000000..3f6f69f --- /dev/null +++ b/.rnr/config.yaml @@ -0,0 +1,7 @@ +version: 0.1.0 +platforms: +- linux-amd64 +- macos-amd64 +- macos-arm64 +- windows-amd64 +- windows-arm64 diff --git a/rnr b/rnr new file mode 100644 index 0000000..9d8c731 --- /dev/null +++ b/rnr @@ -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" "$@" diff --git a/rnr.cmd b/rnr.cmd new file mode 100644 index 0000000..8fdfa66 --- /dev/null +++ b/rnr.cmd @@ -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%" %* diff --git a/rnr.yaml b/rnr.yaml new file mode 100644 index 0000000..3b12624 --- /dev/null +++ b/rnr.yaml @@ -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