-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
68 lines (58 loc) · 1.52 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
XCODE = /usr/bin/xcodebuild -verbose
PRODUCT = InstallerApp2ISO
BUNDLE = $(PRODUCT).app
SCHEME = $(PRODUCT)
PROJECT = $(PRODUCT)
SCHEME = $(PRODUCT)
SRC = $(PRODUCT)
DIR = ${CURDIR}
ARCHIVE = $(DIR)/archive/$(SCHEME).xcarchive
EXPORT = $(DIR)/archive/export
NOTARIZED = $(DIR)/archive/export/$(BUNDLE)
all: debug release
debug:
$(XCODE) -project $(PROJECT).xcodeproj \
-alltargets \
-configuration Debug \
CONFIGURATION_BUILD_DIR=$(DIR)/build/Debug
release: clean
$(XCODE) -project $(PROJECT).xcodeproj \
-alltargets \
-configuration Release \
CONFIGURATION_BUILD_DIR=$(DIR)/build/Release
$(ARCHIVE): clean
$(XCODE) -project $(PROJECT).xcodeproj \
-scheme $(SCHEME) \
-archivePath $(ARCHIVE) \
archive
$(EXPORT): $(ARCHIVE)
$(XCODE) \
-exportArchive \
-archivePath $(ARCHIVE) \
-exportPath $(EXPORT) \
-exportOptionsPlist $(DIR)/$(SRC)/ExportOptions.plist
$(NOTARIZED): $(EXPORT)
rm -rf $(NOTARIZED)
while true; do \
date; \
$(XCODE) \
-exportNotarizedApp \
-archivePath $(ARCHIVE) \
-exportPath $(EXPORT); \
if [ $$? -eq 0 ]; then \
echo "Notarize complete for:" $(NOTARIZED); \
break; \
fi; \
echo wait 10s...; \
sleep 10; \
done
test -e $(NOTARIZED) && $(XCRUN) stapler staple $(NOTARIZED)
notarized: $(NOTARIZED)
publish: notarized
sh scripts/publish.sh $(NOTARIZED)
clean:
# $(XCODE) -project $(PROJECT).xcodeproj -alltargets -configuration Debug clean
# $(XCODE) -project $(PROJECT).xcodeproj -alltargets -configuration Release clean
rm -rf archive
rm -rf build
rm -rf Publish