This repository was archived by the owner on May 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
96 lines (76 loc) · 2.91 KB
/
Copy pathmakefile
File metadata and controls
96 lines (76 loc) · 2.91 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
# Keys
PROJECT = Trace
WORKSPACE = $(PROJECT).xcworkspace
TRACESCHEME = $(PROJECT)
TRACETESTSCHEME = iOSDemo
TRACEINTERNALSCHEME = $(PROJECT)Internal
# Compete
LastGitTagVersion := $(shell git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=0`)
# Commands
# Open project
open:
@open $(WORKSPACE)
@echo "Opening Trace.workspace"
# Update project dependency
update:
@pod update
@bundler update
# Build SDK and internal
build:
xcodebuild "-workspace" $(WORKSPACE) "-scheme" $(TRACEINTERNALSCHEME) "clean" "build" | xcpretty
xcodebuild "-workspace" $(WORKSPACE) "-scheme" $(TRACESCHEME) "clean" "build" | xcpretty
# Run all tests
test:
xcodebuild "-workspace" $(WORKSPACE) "-scheme" $(TRACESCHEME) "test" | xcpretty
xcodebuild "-workspace" $(WORKSPACE) "-scheme" $(TRACETESTSCHEME) "test" | xcpretty
xcodebuild "-workspace" $(WORKSPACE) "-scheme" $(TRACEINTERNALSCHEME) "test" | xcpretty
# Deploy new version of Trace SDK
publish version:
@echo "MakeFile"
@echo "Starting publish step"
# Validation
ifeq ($(strip $(version)),)
@echo "Error must provide a non-empty version number i.e make publish version=1.7.11"
exit 1
endif
ifndef version
@echo "Error must provide a version number i.e make publish version=1.7.11"
exit 1
endif
ifeq ($(version), $(LastGitTagVersion))
@echo "Error duplicate version number $(LastGitTagVersion), check git tags"
exit 1
endif
@echo "\nLast git tag version: $(LastGitTagVersion)"
# Bump pod version and tag number
@sed -i '' 's/$(LastGitTagVersion)/$(version)/' BitriseTrace.podspec.json
@echo "\n'BitriseTrace.podspec.json' version updated from $(LastGitTagVersion) to $(version)"
@git --no-pager diff --minimal BitriseTrace.podspec.json
# Bump Constants.swift file
@echo "\n'Trace/Constants.swift' version updated from $(LastGitTagVersion) to $(version)"
@sed -i '' 's/$(LastGitTagVersion)/$(version)/' Trace/Constants.swift
@git --no-pager diff --minimal Trace/Constants.swift
# Bump Xcode project file
@echo "\n'Trace.xcodeproj/project.pbxproj' version updated from $(LastGitTagVersion) to $(version)"
@sed -i '' 's/$(LastGitTagVersion)/$(version)/' Trace.xcodeproj/project.pbxproj
@git --no-pager diff --minimal Trace.xcodeproj/project.pbxproj
# Bump Package.swift
@echo "\n'Package.swift' version updated from $(LastGitTagVersion) to $(version)"
@sed -i '' 's/$(LastGitTagVersion)/$(version)/' Package.swift
@git --no-pager diff --minimal Package.swift
# Bump README.md
@echo "\n'README.md' version updated from $(LastGitTagVersion) to $(version)"
@sed -i '' 's/$(LastGitTagVersion)/$(version)/' README.md
@git --no-pager diff --minimal README.md
# Show final changes
@echo "\nFinal changes to be commited"
@git --no-pager status --porcelain
# Commit/Tag changes and push
@git add --all
@git commit -m "Bumped version to $(version)"
@git tag $(version)
@git push
@sleep 3
@git push --tags
@echo "\nPushed changed to remote repo"
@echo "\n\nComplete"