-
Notifications
You must be signed in to change notification settings - Fork 20
/
Makefile
107 lines (79 loc) · 4.48 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
CURRENT_DIR := $(shell pwd)
CARTHAGE_MIN_VERSION = 0.38.0
CARTHAGE_BUILD_DIR := $(CURRENT_DIR)/Carthage/Build
PRODUCTS_DIR := $(CURRENT_DIR)/Products
VERSION ?= $(shell git describe --tags $(git rev-list --tags='v*' --max-count=1) --abbrev=0)
MARKETING_VERSION := $(shell echo "${VERSION}" | perl -nle 'print $$v if ($$v)=/([0-9]+([.][0-9]+)+)/')
build products ios: dependencies
$(CURRENT_DIR)/scripts/build.sh
carthage-min-version:
# Test minimal Carthage version.
# 1. Build a string "0.39.1\n0.38.0" (one value is actual version, second one – minimal)
# 2. Sort string with `sort -V` to apply SemVer sorting algo
# 3. Get the first (minimal) version with `head -n1`
# 4. Compare minimal version from the list with the required minimal.
# Fail if actual version is lower than min requirement
@test $(shell echo "$(shell carthage version)\n${CARTHAGE_MIN_VERSION}" | sort -V | head -n1) = ${CARTHAGE_MIN_VERSION}
dependencies deps: carthage-min-version
XCODE_XCCONFIG_FILE="${CURRENT_DIR}/scripts/carthage-support.xcconfig" carthage bootstrap --use-xcframeworks --cache-builds --use-netrc
scripts/generate_sdk_version_swift.sh
dependencies-update deps-update: carthage-min-version
XCODE_XCCONFIG_FILE="${CURRENT_DIR}/scripts/carthage-support.xcconfig" carthage update --use-xcframeworks --cache-builds --use-netrc
scripts/generate_sdk_version_swift.sh
offline:
aws s3 cp s3://vng-temp/HERE/luxembourg.tgz - | tar -xz -C Sources/Demo/offline/
ci-dev-test: dependencies
fastlane scan --scheme "Demo" --device "iPhone 15" --result_bundle "true" --testplan "CI-dev" --output_directory "output"
ci-full-test: dependencies
fastlane scan --scheme "Demo" --device "iPhone 15" --result_bundle "true" --testplan "Demo" --output_directory "output"
test: dependencies
xcodebuild -scheme MapboxSearchUI -destination platform\=iOS\ Simulator,name\=iPhone\ 15 clean test
xctest: dependencies
xcodebuild -scheme MapboxSearch -destination platform\=iOS\ Simulator,name\=iPhone\ 15 clean test
codecov:
scripts/coverage/gather_coverage.sh "^MapboxSearch$$" coverage
scripts/coverage/upload_codecov.sh coverage/MapboxSearch.framework.coverage.txt
generate-docs: dependencies
VERSION="${VERSION}" $(CURRENT_DIR)/scripts/generate_docs.sh
release-docs: generate-docs
git worktree add documentation-production publisher-production
cp -r docs/MapboxSearch/ "documentation-production/core/${VERSION}"
cp -r docs/MapboxSearchUI/ "documentation-production/ui/${VERSION}"
git -C documentation-production add "core/${VERSION}" "ui/${VERSION}"
git -C documentation-production config user.email "[email protected]"
git -C documentation-production config user.name "Release SDK bot"
git -C documentation-production commit -m "[bot] Release ${VERSION} documentation"
git -C documentation-production push
git worktree remove documentation-production --force
generate-maki:
$(CURRENT_DIR)/scripts/generate_maki.sh
internal-release: dependencies
$(CURRENT_DIR)/scripts/release_version.sh
validate-spm-build:
$(CURRENT_DIR)/scripts/build_spm_sample.sh
clean:
-rm -rf $(CARTHAGE_BUILD_DIR) $(PRODUCTS_DIR) $(CURRENT_DIR)/docs $(CURRENT_DIR)/jazzy-theme
pristine:
git reset --hard && git clean -dfx && git submodule foreach "git reset --hard && git clean -dfx"
lint:
pod lib lint MapboxSearch.podspec
pod lib lint MapboxSearchUI.podspec --include-podspecs=MapboxSearch.podspec
# This target send local podspecs to the official CocoaPods repository
push-trunk:
pod trunk push MapboxSearch.podspec
pod trunk push MapboxSearchUI.podspec --synchronous
update-registry: check-aws
aws s3 cp $(CURRENT_DIR)/Products/MapboxSearch.zip s3://mapbox-api-downloads-production/v2/search-sdk/releases/ios/$(VERSION:v%=%)/packages/MapboxSearch.zip
aws s3 cp $(CURRENT_DIR)/Products/MapboxSearchUI.zip s3://mapbox-api-downloads-production/v2/search-sdk/releases/ios/$(VERSION:v%=%)/packages/MapboxSearchUI.zip
list-registry-latest: check-aws
aws s3 ls s3://mapbox-api-downloads-production/v2/search-sdk/releases/ios/$(VERSION:v%=%)/packages/
check-aws:
@aws s3 ls s3://mapbox-api-downloads-production &>/dev/null
git-versions:
@echo "Tag version: ${VERSION}"
@echo "Marketing version: ${MARKETING_VERSION}"
git-version:
@echo "${VERSION}"
.PHONY: git-version git-versions check-aws update-registry push-trunk lint pristine clean internal-release generate-maki
.PHONY: generate-docs xctest test ci-full-test ci-dev-test dependencies products build validate-spm-build
.PHONY: deps-update deps ios carthage-min-version codecov list-registry-latest