-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
88 lines (71 loc) · 3.28 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
EDITOR=vim
WORKSPACE = ClickerApp.xcworkspace
SCHEME = ClickerApp
CONFIGURATION = Debug
APP_NAME = ClickerApp
APP_PLIST = App/Info.plist
PLIST_BUDDY = /usr/libexec/PlistBuddy
BUNDLE_VERSION = $(shell $(PLIST_BUDDY) -c "Print CFBundleVersion" $(APP_PLIST))
GIT_COMMIT = $(shell git log -n1 --format='%h')
DEVICE_HOST = "platform=iOS Simulator,OS=9.2,name=iPhone 6s"
BUNDLER := $(shell command -v bundler 2>/dev/null)
all: check bundle drive
drive:
bundle exec fastlane test
check: BUNDLER-exists
BUNDLER-exists: ; @which bundler > /dev/null
HELP_FUNC = \
%help; \
while(<>) { \
if(/^([a-z0-9_-]+):.*\#\#(?:@(\w+))?\s(.*)$$/) { \
push(@{$$help{$$2}}, [$$1, $$3]); \
} \
}; \
print "usage: make [target]\n\n"; \
for ( sort keys %help ) { \
print "$$_:\n"; \
printf(" %-20s %s\n", $$_->[0], $$_->[1]) for @{$$help{$$_}}; \
print "\n"; \
}
help: ## This help dialog.
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/:/'`); \
printf '\033[33m'; \
printf "%-30s %s\n" "Action" "Description" ; \
printf "%-30s %s\n" "------" "------------" ; \
for help_line in $${help_lines[@]}; do \
IFS=$$':' ; \
help_split=($$help_line) ; \
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
printf '\033[36m'; \
printf "%-30s %s" $$help_command ; \
printf '\033[0m'; \
printf "%s\n" $$help_info; \
done
bootstrap: check phony_bootstrap ## Bootstraps the project so it's ready to be compiled
phony_bootstrap: bundle pod
bundle: check phony_bundle ## Retrieves all the GEMS listed on the Gemfile and installs the resulting bundle at \033[35m`./.vendor`
phony_bundle:
bundle install --path="./.vendor"
synx: check phony_synx ## Executes the synx gem to make the Xcode files/groups architecture match in the file system
phony_synx:
bundle exec synx ClickerApp.xcodeproj
pod: check phony_pod ## Executes the bundled gem \033[35m`cocoapods` \033[0mcommand \033[35m`pod install`. \033[0mInstalls missings pods to the Workspace
phony_pod:
bundle exec pod install
deintegrate: check phony_deintegrate ## Runs \033[35m`bundle exec pod deintegrate`\033[0m on every project of the workspace (sans the Pods projects)
phony_deintegrate:
bundle exec pod deintegrate ClickerApp.xcodeproj
clean_cache: check phony_cc ## Runs \033[35mbundle exec pod cache clean --all\033[0m to clean any pods cache.
phony_cc:
bundle exec pod cache clean --all
build: check phony_build ## Builds the project.
phony_build:
set -o pipefail && xcodebuild -workspace '$(WORKSPACE)' -scheme '$(SCHEME)' -configuration '$(CONFIGURATION)' -sdk iphonesimulator -destination $(DEVICE_HOST) build | bundle exec xcpretty -c
clean: check phony_clean ## Cleans the project (deletes derived data). Forces next build to be a «cold» build.
phony_clean:
xcodebuild -workspace '$(WORKSPACE)' -scheme '$(SCHEME)' -configuration '$(CONFIGURATION)' clean | xcpretty -c
test: check phony_test ## Runs the test suite on the project.
phony_test:
set -o pipefail && xcodebuild -verbose -workspace '$(WORKSPACE)' -scheme '$(SCHEME)' -configuration '$(CONFIGURATION)' test -sdk iphonesimulator -destination $(DEVICE_HOST) | xcpretty -c