diff --git a/Makefile b/Makefile index b4dcf121..f9bd4aef 100644 --- a/Makefile +++ b/Makefile @@ -30,8 +30,6 @@ XCODEBUILD_FLAGS ?= FORMAT_BASE_REF ?= origin/main BUILD_SETTINGS_CACHE := $(CURRENT_MAKEFILE_DIR)/.build_settings_cache.json PBXPROJ_PATH := $(CURRENT_MAKEFILE_DIR)/supacode.xcodeproj/project.pbxproj -XCSIFT := $(shell mise which xcsift 2>/dev/null) -SWIFTLINT := $(shell mise which swiftlint 2>/dev/null) # Release-only analytics/crash credentials. Included from Config/Secrets.env if present, # or overridable from the environment (e.g. CI). Debug builds skip SDK init regardless. @@ -41,7 +39,7 @@ PROWL_POSTHOG_API_KEY ?= PROWL_POSTHOG_HOST ?= .DEFAULT_GOAL := help -.PHONY: build-ghostty-xcframework ensure-ghostty sync-ghostty _record-ghostty-hash build-app _build-app-all-deps build-cli build-cli-release embed-cli-debug embed-cli embed-docs run-app install-dev-build install-release archive export-archive format format-changed format-lint lint check test test-app test-cli-smoke test-cli-integration bump-version bump-and-release log-stream +.PHONY: build-ghostty-xcframework ensure-ghostty sync-ghostty _record-ghostty-hash build-app build-cli build-cli-release embed-cli-debug embed-cli embed-docs run-app install-dev-build install-release archive export-archive format format-changed format-lint lint check test test-app test-cli-smoke test-cli-integration bump-version bump-and-release log-stream help: # Display this help. @-+echo "Run make with one of the following targets:" @@ -110,12 +108,8 @@ embed-docs: # Stage docs/ into Resources for bundling into the app (.app/Content rsync -a --delete --exclude '.sync-meta.json' "$$src/" "$$dst/"; \ echo "embedded docs at $$dst" -build-app: _build-app-all-deps # Build the macOS app (Debug) - bash -o pipefail -c 'xcodebuild -project supacode.xcodeproj -scheme supacode -configuration Debug build -skipMacroValidation -clonedSourcePackagesDirPath $(SPM_CACHE_DIR) SWIFT_COMPILATION_MODE=incremental 2>&1 | $(XCSIFT) -w --format toon' - -.PHONY: _build-app-all-deps -_build-app-all-deps: - @$(MAKE) -j3 ensure-ghostty embed-cli-debug embed-docs +build-app: ensure-ghostty embed-cli-debug embed-docs # Build the macOS app (Debug) + bash -o pipefail -c 'xcodebuild -project supacode.xcodeproj -scheme supacode -configuration Debug build -skipMacroValidation -clonedSourcePackagesDirPath $(SPM_CACHE_DIR) SWIFT_COMPILATION_MODE=incremental 2>&1 | mise exec -- xcsift -w --format toon' sync-cli-version: # Sync app MARKETING_VERSION into ProwlCLIShared/ProwlVersion.swift @version="$$(/usr/bin/awk -F' = ' '/MARKETING_VERSION = [0-9.]*;/{gsub(/;/,"",$$2);print $$2; exit}' \ @@ -322,10 +316,10 @@ install-release: build-ghostty-xcframework # Build Release, sign locally, instal echo "installed $$DST (Release build, locally signed)" archive: build-ghostty-xcframework embed-cli embed-docs # Archive Release build for distribution - bash -o pipefail -c 'xcodebuild -project supacode.xcodeproj -scheme supacode -configuration Release -archivePath build/supacode.xcarchive archive CODE_SIGN_STYLE=Manual DEVELOPMENT_TEAM="$$APPLE_TEAM_ID" CODE_SIGN_IDENTITY="$$DEVELOPER_ID_IDENTITY_SHA" OTHER_CODE_SIGN_FLAGS="--timestamp" PROWL_SENTRY_DSN="$(PROWL_SENTRY_DSN)" PROWL_POSTHOG_API_KEY="$(PROWL_POSTHOG_API_KEY)" PROWL_POSTHOG_HOST="$(PROWL_POSTHOG_HOST)" -skipMacroValidation -clonedSourcePackagesDirPath $(SPM_CACHE_DIR) $(XCODEBUILD_FLAGS) 2>&1 | $(XCSIFT) -qw --format toon' + bash -o pipefail -c 'xcodebuild -project supacode.xcodeproj -scheme supacode -configuration Release -archivePath build/supacode.xcarchive archive CODE_SIGN_STYLE=Manual DEVELOPMENT_TEAM="$$APPLE_TEAM_ID" CODE_SIGN_IDENTITY="$$DEVELOPER_ID_IDENTITY_SHA" OTHER_CODE_SIGN_FLAGS="--timestamp" PROWL_SENTRY_DSN="$(PROWL_SENTRY_DSN)" PROWL_POSTHOG_API_KEY="$(PROWL_POSTHOG_API_KEY)" PROWL_POSTHOG_HOST="$(PROWL_POSTHOG_HOST)" -skipMacroValidation -clonedSourcePackagesDirPath $(SPM_CACHE_DIR) $(XCODEBUILD_FLAGS) 2>&1 | mise exec -- xcsift -qw --format toon' export-archive: # Export xarchive - bash -o pipefail -c 'xcodebuild -exportArchive -archivePath build/supacode.xcarchive -exportPath build/export -exportOptionsPlist build/ExportOptions.plist 2>&1 | $(XCSIFT) -qw --format toon' + bash -o pipefail -c 'xcodebuild -exportArchive -archivePath build/supacode.xcarchive -exportPath build/export -exportOptionsPlist build/ExportOptions.plist 2>&1 | mise exec -- xcsift -qw --format toon' test: ensure-ghostty embed-cli-debug embed-docs test-app @@ -335,7 +329,7 @@ test-app: ensure-ghostty # Run app/unit tests via xcodebuild mkdir -p "$$(dirname "$$result_bundle")"; \ rm -rf "$$result_bundle"; \ set +e; \ - xcodebuild test -project supacode.xcodeproj -scheme supacode -destination "platform=macOS" -resultBundlePath "$$result_bundle" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" -skipMacroValidation -clonedSourcePackagesDirPath $(SPM_CACHE_DIR) SWIFT_COMPILATION_MODE=incremental 2>&1 | $(XCSIFT) -w --format toon; \ + xcodebuild test -project supacode.xcodeproj -scheme supacode -destination "platform=macOS" -resultBundlePath "$$result_bundle" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" -skipMacroValidation -clonedSourcePackagesDirPath $(SPM_CACHE_DIR) SWIFT_COMPILATION_MODE=incremental 2>&1 | mise exec -- xcsift -w --format toon; \ xcodebuild_status=$${PIPESTATUS[0]}; \ set -e; \ if [ "$$xcodebuild_status" -ne 0 ]; then \ @@ -379,7 +373,7 @@ format-lint: # Check Swift formatting without rewriting files swift-format lint --strict --recursive --configuration ./.swift-format.json supacode supacodeTests lint: # Lint code with swiftlint - $(SWIFTLINT) lint --quiet --config .swiftlint.yml + mise exec -- swiftlint lint --quiet --config .swiftlint.yml check: format-changed format-lint lint # Format changed Swift files, then run swift-format lint and SwiftLint