Makefile (2554B)
1 # The sources are edited here (a Linux host); Swift and Xcode run on a Mac reachable over SSH. 2 # CHUNGA is the SSH host, REMOTE the directory on the Mac (relative to the home directory). 3 # RemoraKit (a separate repository) is expected next to this one, here (KIT) and on the Mac 4 # (REMOTE_KIT): project.yml refers to it as ../remora-kit. 5 CHUNGA ?= chunga 6 REMOTE ?= src/perso/open-remora 7 KIT ?= ../remora-kit 8 REMOTE_KIT ?= $(dir $(REMOTE))remora-kit 9 RSYNC = rsync -a --delete --exclude .git --exclude '*.xcodeproj' --exclude build --exclude .build 10 11 .PHONY: sync test-deco 12 13 sync: 14 $(RSYNC) ./ $(CHUNGA):$(REMOTE)/ 15 $(RSYNC) $(KIT)/ $(CHUNGA):$(REMOTE_KIT)/ 16 17 # RemoraKit tests: decompression engine, dive logic and shared formatting (Swift package, on macOS) 18 test-deco: sync 19 ssh $(CHUNGA) 'cd $(REMOTE_KIT) && swift test 2>&1' 20 21 WATCH_DEST ?= generic/platform=watchOS Simulator 22 23 .PHONY: project build-watch build-phone 24 project: sync 25 ssh $(CHUNGA) 'cd $(REMOTE) && xcodegen -q' 26 27 build-watch: project 28 ssh $(CHUNGA) 'cd $(REMOTE) && xcodebuild -quiet -scheme OpenRemoraWatch -destination "$(WATCH_DEST)" -derivedDataPath build CODE_SIGNING_ALLOWED=NO build' 29 30 PHONE_DEST ?= generic/platform=iOS Simulator 31 32 # iPhone app (with its widget extension and the embedded watch app), unsigned, for the simulator. 33 build-phone: project 34 ssh $(CHUNGA) 'cd $(REMOTE) && xcodebuild -quiet -scheme OpenRemora -destination "$(PHONE_DEST)" -derivedDataPath build CODE_SIGNING_ALLOWED=NO build' 35 36 # Signed archive for TestFlight (automatic signing, personal API key on the Mac). BUILD=n sets the build number. 37 BUILD ?= $(shell date +%Y%m%d%H%M) 38 AUTH = -allowProvisioningUpdates -authenticationKeyPath $$PERSO_ASC_KEY_PATH -authenticationKeyID $$PERSO_ASC_KEY_ID -authenticationKeyIssuerID $$PERSO_ASC_ISSUER_ID 39 40 .PHONY: archive upload 41 archive: project 42 ssh $(CHUNGA) 'source ~/.zshrc_build && security unlock-keychain -p "$$(cat ~/.keyring_secret)" ~/Library/Keychains/login.keychain-db && cd $(REMOTE) && rm -rf build/OpenRemora.xcarchive build/ipa && xcodebuild -quiet -scheme OpenRemora -configuration Release -destination "generic/platform=iOS" -archivePath build/OpenRemora.xcarchive CURRENT_PROJECT_VERSION=$(BUILD) $(AUTH) archive && PATH=/usr/bin:$$PATH xcodebuild -quiet -exportArchive -archivePath build/OpenRemora.xcarchive -exportOptionsPlist tools/ExportOptions.plist -exportPath build/ipa $(AUTH) && ls -la build/ipa' 43 44 # Uploads the archived IPA to TestFlight (the App Store Connect record must exist). 45 upload: 46 ssh $(CHUNGA) 'cd $(REMOTE) && zsh tools/upload.sh'