-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
90 lines (64 loc) · 2.7 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
89
90
NAME=TodoClient
FASTLANE=bundle exec fastlane
DC=docker-compose
DC_P=docker-compose -f docker-compose.pact.yml
CARTHAGE_FRAMEWORKS=ls Carthage/Build/iOS/*.framework | grep "\.framework" | cut -d "/" -f 4 | cut -d "." -f 1 | xargs -I '{}'
CARTHAGE_ARCHIVES=ls PreBuiltFrameworks/*.zip | grep "\.zip" | cut -d "/" -f 2 | cut -d "." -f 1 | xargs -I '{}'
.DEFAULT_GOAL := help
stop: ## Stop all Docker Containers
$(DC) stop
$(DC_P) stop
clean: carthage_clean stop ## Clean all Docker Volumes, Networks, Orphan containers
$(DC) down --rmi local --remove-orphans -v
$(DC) rm -f -v
$(DC_P) down --rmi local --remove-orphans -v
$(DC_P) rm -f -v
setup: ## install required tools
brew install git-lfs carthage
git lfs install
git lfs pull
brew install carthage
brew install --HEAD swiftlint
xcode_tidy_project: ## uniqify+sort+synx, pre-do the pre-commit
xunique -us TodoClient.xcodeproj
synx -p -q TodoClient.xcodeproj
setup_precommit: ## install the precommit hook
echo "make xcode_tidy_project lint" > .git/hooks/pre-commit
install_bundle: ## install gems
bundle install
install_carthage: ## install carthage frameworks
carthage bootstrap --platform iOS --no-use-binaries
install: install_bundle install_carthage ## Install Gems, Carthage
carthage_clean: ## clean up all Carthage directories
rm -rf Carthage
carthage_update: ## update carthage packages
carthage update --platform iOS --no-use-binaries
carthage_archive: carthage_update ## update and archive carthage packages
rm -rf PreBuiltFrameworks/*.zip
$(CARTHAGE_FRAMEWORKS) carthage archive '{}' --output PreBuiltFrameworks/
carthage_track: carthage_archive ## track and commit carthage frameworks
git lfs track PreBuiltFrameworks/*.zip
git add .gitattributes
git commit -m "Tracking Prebuilt Frameworks"
git add PreBuiltFrameworks/*.zip
git commit -m "Adding Prebuild Framworks"
carthage_extract: carthage_clean ## extract from carthage archives
$(CARTHAGE_ARCHIVES) unzip PreBuiltFrameworks/'{}'.framework.zip
carthage_copy: ## copy carthage frameworks
$(CARTHAGE_FRAMEWORKS) env SCRIPT_INPUT_FILE_0=Carthage/build/iOS/'{}'.framework SCRIPT_INPUT_FILE_COUNT=1 carthage copy-frameworks
lint: ## Run Lint
$(FASTLANE) lint
start_mock: stop ## Run the Pact Mock Service
$(DC) up -d
test_local: start_mock
$(FASTLANE) test_local
test: ## Run all Unit Tests
$(FASTLANE) test
contract_tests: start_mock ## Run all Contract Tests
$(FASTLANE) contract_tests
pact_publish: stop ## Publish Pacts to the Broker
$(DC_P) run pact_broker_client
pact_verify: stop ## Verify Pact with the Provider
$(DC_P) run pact_broker_proxy
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'