.PHONY: build build-release desktop desktop-build desktop-run clean openapi
build:
cargo build
build-release:
cargo build --release
openapi: build
cargo run -- openapi 2>/dev/null | python3 -m json.tool > desktop/Byokey/openapi.json
cd desktop/Byokey && swift-openapi-generator generate openapi.json \
--config openapi-generator-config.yaml \
--output-directory Generated/
desktop: build openapi
open desktop/Byokey.xcodeproj
desktop-build:
xcodebuild -project desktop/Byokey.xcodeproj -scheme Byokey -configuration Debug build
desktop-run: desktop-build
$(eval BYOKEY_APP := $(shell find ~/Library/Developer/Xcode/DerivedData/Byokey-*/Build/Products/Debug -name '*.app' -maxdepth 1 2>/dev/null | head -1))
@if [ -z "$(BYOKEY_APP)" ]; then \
echo "error: Byokey.app not found in DerivedData — did the build succeed?"; \
exit 1; \
fi
@echo "Launching $(BYOKEY_APP)"
@open "$(BYOKEY_APP)"
clean:
cargo clean