session-ios/Makefile

46 lines
1.2 KiB
Makefile
Raw Normal View History

2016-10-05 23:19:23 +02:00
# Make sure we're failing even though we pipe to xcpretty
2016-10-10 20:48:35 +02:00
SHELL=/bin/bash -o pipefail -o errexit
2016-10-05 23:19:23 +02:00
# iPhone6, iOS10
DEVICE_UUID:=$(shell xcrun instruments -s | grep -o "iPhone 6 (10.0) \[.*\]" | grep -o "\[.*\]" | sed "s/^\[\(.*\)\]$$/\1/")
BUILD_DESTINATION = platform=iOS Simulator,id=${DEVICE_UUID}
2016-10-05 23:19:23 +02:00
WORKING_DIR = ./
2016-10-10 20:48:35 +02:00
SCHEME = Signal
XCODE_BUILD = xcrun xcodebuild -workspace $(SCHEME).xcworkspace -scheme $(SCHEME) -sdk iphonesimulator
.PHONY: build test retest clean
2016-10-05 23:19:23 +02:00
default: test
ci: build_dependencies test
2016-10-10 20:48:35 +02:00
build_dependencies:
2016-10-05 23:19:23 +02:00
cd $(WORKING_DIR) && \
git submodule update --init
2016-10-10 20:48:35 +02:00
pod install
carthage build --platform iOS
2016-10-10 20:48:35 +02:00
build: build_dependencies
2016-10-10 20:48:35 +02:00
cd $(WORKING_DIR) && \
$(XCODE_BUILD) build | xcpretty
2016-10-05 23:19:23 +02:00
test: optional_early_start_simulator
2016-10-05 23:19:23 +02:00
cd $(WORKING_DIR) && \
2016-10-10 20:48:35 +02:00
$(XCODE_BUILD) \
-destination '${BUILD_DESTINATION}' \
test | xcpretty
2016-10-05 23:19:23 +02:00
2016-10-10 20:48:35 +02:00
clean:
cd $(WORKING_DIR) && \
$(XCODE_BUILD) \
clean | xcpretty
2016-10-05 23:19:23 +02:00
optional_early_start_simulator:
ifdef EARLY_START_SIMULATOR
echo "Waiting for simulator to start to help with testing timeouts" &&\
xcrun instruments -w '${DEVICE_UUID}' || true # xcrun can return irrelevant non-zeroes.
else
echo "Not waiting for simulator."
endif