forked from br1sk/brisk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (49 loc) · 1.34 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
SHELL = /bin/bash
CONFIGURATION ?= Debug
XCODEBUILD = xcodebuild \
-workspace Brisk.xcworkspace \
-scheme Brisk \
-configuration $(CONFIGURATION) \
DSTROOT=/
.DEFAULT_GOAL := build
# Developer commands
.PHONY: dependencies
dependencies: ensure_pods
.PHONY: build
build: dependencies
$(XCODEBUILD) build
.PHONY: install
install: CONFIGURATION = Release
install: dependencies
$(XCODEBUILD) clean install
.PHONY: test
test: ensure_pods
$(XCODEBUILD) test
.PHONY: lint
lint: ensure_swiftlint
./swiftlint/swiftlint lint --strict 2> /dev/null
# Internal commands
.PHONY: ensure_pods
ensure_pods:
diff Podfile.lock Pods/Manifest.lock > /dev/null || $(MAKE) install_pods
.PHONY: install_pods
install_pods:
bundle check || bundle install
bundle exec pod install || bundle exec pod install --repo-update
.PHONY: ensure_swiftlint
ensure_swiftlint:
diff <(./swiftlint/swiftlint version) <(cat .swiftlint-version) > /dev/null || $(MAKE) install_swiftlint
.PHONY: install_swiftlint
install_swiftlint:
rm -rf swiftlint
mkdir swiftlint
curl --location --fail \
https://github.com/realm/SwiftLint/releases/download/"$(shell cat .swiftlint-version)"/portable_swiftlint.zip \
--output swiftlint/swiftlint.zip
unzip -d swiftlint swiftlint/swiftlint.zip > /dev/null
.PHONY: ci
ci:
ifndef ACTION
$(error ACTION is not defined)
endif
make $(ACTION)