-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathMakefile
67 lines (51 loc) · 1.31 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Rules
# =====
#
# make test - Run all tests but performance tests
# make distclean - Restore repository to a pristine state
default: test
# Configuration
# =============
GIT := $(shell command -v git)
POD := $(shell command -v pod)
XCRUN := $(shell command -v xcrun)
SWIFT = $(shell $(XCRUN) --find swift 2> /dev/null)
# Used to determine if xcpretty is available
XCPRETTY_PATH := $(shell command -v xcpretty 2> /dev/null)
# Tests
# =====
# If xcpretty is available, use it for xcodebuild output
XCPRETTY =
ifdef XCPRETTY_PATH
XCPRETTY = | xcpretty -c
# On Travis-CI, use xcpretty-travis-formatter
ifeq ($(TRAVIS),true)
XCPRETTY += -f `xcpretty-travis-formatter`
endif
endif
# Avoid the "No output has been received in the last 10m0s" error on Travis:
COCOAPODS_EXTRA_TIME =
ifeq ($(TRAVIS),true)
COCOAPODS_EXTRA_TIME = --verbose
endif
test: test_SPM test_install
test_install: test_CocoaPodsLint
test_SPM:
$(SWIFT) package clean
$(SWIFT) build
$(SWIFT) build -c release
set -o pipefail && $(SWIFT) test $(XCPRETTY)
test_CocoaPodsLint:
ifdef POD
$(POD) repo update
$(POD) lib lint --allow-warnings $(COCOAPODS_EXTRA_TIME)
else
@echo CocoaPods must be installed for test_CocoaPodsLint
@exit 1
endif
# Cleanup
# =======
distclean:
$(GIT) reset --hard
$(GIT) clean -dffx .
.PHONY: distclean test