-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
86 lines (67 loc) · 1.93 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
# Verify env variable is defined.
define is_null
$(if $(strip $($1)),,$(warning "$1" ENV variable is null! "$2"))
endef
# Exits if var isn't defined.
define assert_env_variable
$(if $(strip $($1)),,$(error "$1" ENV variable is required! "$2"))
endef
RUBY := $(shell command -v ruby 2>/dev/null)
HOMEBREW := $(shell command -v brew 2>/dev/null)
BUNDLER := $(shell command -v bundle 2>/dev/null)
JAZZY := $(shell command -v jazzy)
VERSION = v0.0.8
PROJECT_NAME = MobileCI
.PHONY: help
help:
@echo "Please use \`make <command>' where <command> is one of"
@echo " setup to setup the project and install missing dependencies, if needed."
@echo " update to update dependencies."
@echo " test to run tests."
@echo " lint_format to run swift lint and format."
default: setup
version:
Scripts/update_makefile.sh
Scripts/update_changelog.sh
.PHONY: setup
setup:
$(MAKE) verify_system
$(MAKE) install_gems
$(MAKE) install_ios_dependencies
verify_system:
$(eval $(call assert_env_variable,RUBY))
$(eval $(call assert_env_variable,BUNDLER))
$(eval $(call assert_env_variable,HOMEBREW))
install_gems:
bundle check || bundle install --without=documentation
install_ios_dependencies:
brew install blender/homebrew-tap/rome
bundle exec fastlane carthage_ci
update:
bundle exec fastlane do_cart_update
test:
bundle exec fastlane test_iphone_pro
lint:
bundle exec pod lib lint
lint_format: format swiftlint
.PHONY: format
format:
@swiftformat ./Sources/$(PROJECT_NAME) ./Tests --config .swiftformat
.PHONY: swiftlint
swiftlint:
# file_header
@swiftlint swiftlint --fix Sources/$(PROJECT_NAME)/**/**
.PHONY: docs
docs:
$(info Generating docs...)
ifdef JAZZY
$(JAZZY) \
--clean \
--author 'Kevin Morton' \
--author_url https://github.com/kevnm67 \
--github_url https://github.com/kevnm67/MobileCI \
--output docs/ \
else
@echo Jazzy is missing... failed to install docs
@exit 1
endif