-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (65 loc) · 2.17 KB
/
Makefile
File metadata and controls
79 lines (65 loc) · 2.17 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
# 変数
PRODUCT_NAME := UhooiPicBook
WORKSPACE_NAME := ${PRODUCT_NAME}.xcworkspace
SCHEME_NAME := ${PRODUCT_NAME}
UI_TESTS_TARGET_NAME := ${PRODUCT_NAME}UITests
TEST_SDK := iphonesimulator
TEST_CONFIGURATION := Debug
TEST_PLATFORM := iOS Simulator
TEST_DEVICE ?= iPhone 11 Pro Max
TEST_OS ?= 13.6
TEST_DESTINATION := 'platform=${TEST_PLATFORM},name=${TEST_DEVICE},OS=${TEST_OS}'
.DEFAULT_GOAL := help
# 処理
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?# .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":[^#]*? #| #"}; {printf "%-26s%s\n", $$1 $$3, $$2}'
.PHONY: setup
setup: # 開発環境の構築
$(MAKE) install-bundler
$(MAKE) install-mint
$(MAKE) install-carthage
$(MAKE) generate-xcodeproj
$(MAKE) open
.PHONY: install-bundler
install-bundler: # Bundlerで管理しているライブラリのインストール
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
.PHONY: install-mint
install-mint: # Mintで管理しているライブラリのインストール
mint bootstrap
.PHONY: install-cocoapods
install-cocoapods: # CocoaPodsで管理しているライブラリのインストールとワークスペースの生成
bundle exec pod install
.PHONY: install-carthage
install-carthage: # Carthageで管理しているライブラリのインストール
mint run carthage carthage bootstrap --platform iOS --cache-builds
.PHONY: generate-xcodeproj
generate-xcodeproj: # プロジェクトの生成
mint run xcodegen xcodegen generate
$(MAKE) install-cocoapods # プロジェクトの生成後にワークスペースを生成する
.PHONY: open
open: # ワークスペースをXcodeで開く
open ./${WORKSPACE_NAME}
.PHONY: build-debug
build-debug: # デバッグビルド
set -o pipefail \
&& xcodebuild \
-sdk ${TEST_SDK} \
-configuration ${TEST_CONFIGURATION} \
-workspace ${WORKSPACE_NAME} \
-scheme ${SCHEME_NAME} \
build \
| bundle exec xcpretty
.PHONY: test
test: # 単体テスト
set -o pipefail \
&& xcodebuild \
-sdk ${TEST_SDK} \
-configuration ${TEST_CONFIGURATION} \
-workspace ${WORKSPACE_NAME} \
-scheme ${SCHEME_NAME} \
-destination ${TEST_DESTINATION} \
-skip-testing:${UI_TESTS_TARGET_NAME} \
clean test \
| bundle exec xcpretty --report html