Files
eng-pad/Makefile
Kyle Isom 8f41c41589 Add Makefile with build, test, run, and devrun targets
Makefile wraps Gradle commands and adds emulator/device launch targets:
- run: builds, starts DC-1 emulator if needed, installs and launches
- devrun: builds, installs and launches on connected USB device
- Updated CLAUDE.md and DESIGN.md source trees

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 14:14:08 -07:00

49 lines
1.2 KiB
Makefile

ANDROID_HOME ?= $(HOME)/Library/Android/sdk
ADB := $(ANDROID_HOME)/platform-tools/adb
EMULATOR := $(ANDROID_HOME)/emulator/emulator
AVD ?= DC-1
PACKAGE := net.metacircular.engpad
ACTIVITY := $(PACKAGE).MainActivity
.PHONY: build test lint clean run devrun all
# Build everything (compile + test + lint)
all: lint test build
# Compile debug and release APKs
build:
./gradlew build
# Run unit tests
test:
./gradlew test
# Run a single test class: make test-one CLASS=net.metacircular.engpad.data.StrokeBlobTest
test-one:
./gradlew test --tests "$(CLASS)"
# Run Android lint
lint:
./gradlew lint
# Clean build artifacts
clean:
./gradlew clean
# Install and launch on the Android emulator.
# Starts the emulator if it isn't already running.
run: build
@if ! $(ADB) devices | grep -q emulator; then \
echo "Starting emulator ($(AVD))..."; \
$(EMULATOR) -avd $(AVD) -no-snapshot-load &>/dev/null & \
$(ADB) wait-for-device; \
echo "Emulator ready."; \
fi
./gradlew installDebug
$(ADB) -e shell am start -n $(PACKAGE)/$(ACTIVITY)
# Install and launch on a connected USB device.
devrun: build
./gradlew installDebug
$(ADB) -d shell am start -n $(PACKAGE)/$(ACTIVITY)