forked from DataDog/dd-sdk-ios-apollo-interceptor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
96 lines (78 loc) · 2.92 KB
/
Makefile
File metadata and controls
96 lines (78 loc) · 2.92 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
all: env-check repo-setup templates
.PHONY: env-check lint license-check templates clean test spm-build set-ci-secret help \
smoke-test smoke-test-ios smoke-test-ios-all \
release-publish-podspecs bump
REPO_ROOT := $(PWD)
include tools/utils/common.mk
# Default ENV for setting up the repo
DEFAULT_ENV := dev
# Test env for running iOS tests in local:
DEFAULT_IOS_OS := latest
DEFAULT_IOS_PLATFORM := iOS Simulator
DEFAULT_IOS_DEVICE := iPhone 15 Pro
env-check:
@$(ECHO_TITLE) "make env-check"
./tools/env-check.sh
repo-setup:
@:$(eval ENV ?= $(DEFAULT_ENV))
@$(ECHO_TITLE) "make repo-setup ENV='$(ENV)'"
./tools/repo-setup/repo-setup.sh --env "$(ENV)"
lint:
@$(ECHO_TITLE) "make lint"
./tools/lint/run-linter.sh
license-check:
@$(ECHO_TITLE) "make license-check"
./tools/license/check-license.sh
templates:
@$(ECHO_TITLE) "make templates"
./tools/xcode-templates/install-xcode-templates.sh
test:
@$(ECHO_TITLE) "make test"
swift test
spm-build:
@$(ECHO_TITLE) "make spm-build"
swift build
clean:
@$(ECHO_TITLE) "make clean"
./tools/clean.sh --derived-data --pods --xcconfigs
# Set or update CI secrets
set-ci-secret:
@$(ECHO_TITLE) "make set-ci-secret"
@./tools/secrets/set-secret.sh
# Run smoke tests
smoke-test:
@$(call require_param,TEST_DIRECTORY)
@$(call require_param,OS)
@$(call require_param,PLATFORM)
@$(call require_param,DEVICE)
@$(ECHO_TITLE) "make smoke-test TEST_DIRECTORY='$(TEST_DIRECTORY)' OS='$(OS)' PLATFORM='$(PLATFORM)' DEVICE='$(DEVICE)'"
./tools/smoke-test.sh --test-directory "$(TEST_DIRECTORY)" --os "$(OS)" --platform "$(PLATFORM)" --device "$(DEVICE)"
# Run smoke tests for specified TEST_DIRECTORY using iOS Simulator
smoke-test-ios:
@$(call require_param,TEST_DIRECTORY)
@:$(eval OS ?= $(DEFAULT_IOS_OS))
@:$(eval PLATFORM ?= $(DEFAULT_IOS_PLATFORM))
@:$(eval DEVICE ?= $(DEFAULT_IOS_DEVICE))
@$(MAKE) smoke-test TEST_DIRECTORY="$(TEST_DIRECTORY)" OS="$(OS)" PLATFORM="$(PLATFORM)" DEVICE="$(DEVICE)"
# Run all smoke tests using iOS Simulator
smoke-test-ios-all:
@$(MAKE) smoke-test-ios TEST_DIRECTORY="SmokeTests/spm"
@$(MAKE) smoke-test-ios TEST_DIRECTORY="SmokeTests/cocoapods"
# ┌──────────────┐
# │ SDK release: │
# └──────────────┘
# Publish Cocoapods podspecs to trunk
release-publish-podspecs:
@$(call require_param,ARTIFACTS_PATH)
@:$(eval DRY_RUN ?= 1)
@$(ECHO_TITLE) "make release-publish-podspecs ARTIFACTS_PATH='$(ARTIFACTS_PATH)' DRY_RUN='$(DRY_RUN)'"
DRY_RUN=$(DRY_RUN) ./tools/release/publish-podspec.sh \
--artifacts-path "$(ARTIFACTS_PATH)" \
--podspec-name "DatadogApollo.podspec"
bump:
@read -p "Enter version number: " version; \
echo "// GENERATED FILE: Do not edit directly\n\ninternal let __sdkVersion = \"$$version\"" > Sources/DatadogApollo/Versioning.swift; \
./tools/podspec_bump_version.sh $$version; \
git add . ; \
git commit -m "Bumped version to $$version"; \
echo Bumped version to $$version