This repository has been archived by the owner on Jun 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
158 lines (134 loc) · 3.69 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
.PHONY: check-version \
build \
archive \
check_build_number \
clean \
clean_build \
prerelease \
release \
install \
set_version \
set_build_number \
delete_release \
run \
gh-pages \
deploy \
zip-archive \
header \
uninstall \
publish \
uitest \
test-prompt
PROJECT_NAME=SwiftUISparkleTestApp
SCRIPT_DIR=Build-Versioning-Scripts
INFO_PLIST=$(PROJECT_NAME)/Info.plist
VERSION =
gh-pages:
-git stash
git checkout --orphan gh-pages
git rm -rf .
@echo "#Hello to $(PROJECT_NAME)" >> index.md
git checkout main .gitignore
-git checkout main README.md index.md
git add .
git commit -m "init gh-pages"
git push --set-upstream origin gh-pages
git checkout main
-git stash pop
run:
open /Applications/$(PROJECT_NAME).app
build:
make header HEADER="Building $(PROJECT_NAME) "
xcodebuild clean \
-project $(PROJECT_NAME).xcodeproj \
-configuration Release \
-alltargets
archive: build
@make header HEADER="Archiving $(PROJECT_NAME)"
xcodebuild archive \
-project $(PROJECT_NAME).xcodeproj \
-scheme $(PROJECT_NAME) \
-archivePath Archive/$(PROJECT_NAME).xcarchive
xcodebuild \
-exportArchive \
-archivePath Archive/$(PROJECT_NAME).xcarchive \
-exportPath Product/ \
-exportOptionsPlist exportOptions.plist
install:
@make header HEADER="Installing $(PROJECT_NAME)"
-make uninstall
cp -rf Product/$(PROJECT_NAME).app /Applications/
uninstall:
$(eval CFBundleIdentifier := $(shell /usr/libexec/PlistBuddy \
-c "Print CFBundleIdentifier" \
/Applications/$(PROJECT_NAME).app/Contents/Info.plist))
rm -rf /Applications/$(PROJECT_NAME).app
rm -rf $(HOME)/Library/Containers/$(CFBundleIdentifier)
rm -rf $(HOME)/Library/Containers/$(CFBundleIdentifier).*
rm -rf $(HOME)/Library/Containers/$(CFBundleIdentifier)*
clean:
rm -rf Archive/*
rm -rf Product/*
clean_build:
make clean
make set_version VERSION=0.1.0
make set_build_number BUILD_NUMBER=1
make build
make archive
header:
@echo "\n`tput bold`*** $(HEADER) ***`tput sgr0`\n"
check-version:
ifndef VERSION
$(error VERSION is not set)
endif
check_build_number:
ifndef BUILD_NUMBER
$(error BUILD_NUMBER is not set)
endif
release: check-version
make set_version VERSION=$(VERSION)
$(SCRIPT_DIR)/Increment_Build_Number.sh $(PROJECT_NAME)
zsh $(SCRIPT_DIR)/release.sh $(PROJECT_NAME)
zsh $(SCRIPT_DIR)/publish-app.sh
publish: check-version
@make header HEADER="Publishing $(PROJECT_NAME)"
zsh $(SCRIPT_DIR)/publish-app.sh $(PROJECT_NAME)
deploy: check-version clean
@make header HEADER="Deploying $(PROJECT_NAME)"
make set_version VERSION=$(VERSION)
$(SCRIPT_DIR)/Increment_Build_Number.sh $(PROJECT_NAME)
make archive
make zip-archive
make publish
@make header HEADER="DEPLOY SUCCEEDED"
zip-archive:
@make header HEADER="Creating Zip-Archive for $(PROJECT_NAME)"
zsh $(SCRIPT_DIR)/zip-archive.sh $(PROJECT_NAME)
@make header HEADER="ZIP SUCCEEDED"
set_version: check-version
zsh $(SCRIPT_DIR)/set_version.sh $(VERSION) $(PROJECT_NAME)
set_build_number: check_build_number
zsh $(SCRIPT_DIR)/set_build_number.sh $(BUILD_NUMBER) $(PROJECT_NAME)
delete_release:
-gh release delete "v$(VERSION)" -y
-git push --delete origin "v$(VERSION)"
-git tag -d "v$(VERSION)"
uitest:
make clean
make set_version VERSION=0.1.0
make set_build_number BUILD_NUMBER=1
xcodebuild clean \
-project $(PROJECT_NAME).xcodeproj \
-scheme SwiftUISparkleTestApp \
test
test-prompt:
make clean
rm -rf ~/Library/Containers/de.hainbach.$(PROJECT_NAME)
xcodebuild clean \
-project $(PROJECT_NAME).xcodeproj \
-scheme $(PROJECT_NAME) \
test
wipe-all:
-make clean
-make uninstall
-rm -rf ~/Library/Containers/org.sparkle-project.*