forked from bartoszj/acextract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
133 lines (119 loc) · 2.88 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
.PHONY: \
iphone ipad ios mac tv watch \
assets \
build test \
zip release
define ACTOOL
xcrun actool \
--output-format human-readable-text \
--notices \
--warnings
endef
ASSETS := "Assets.car"
DATA := "acextractTests/data"
all:
# Builad assets
assets: iphone ipad ios mac tv watch
iphone:
# --filter-for-device-model iPhone8,2
# --filter-for-device-os-version 9.3
# --platform iphonesimulator
$(ACTOOL) \
--compress-pngs \
--enable-on-demand-resources YES \
--minimum-deployment-target 9.3 \
--platform iphoneos \
--target-device iphone \
--compile $(PWD) \
Images.xcassets
mv $(ASSETS) $(DATA)/assets_iphone.car
ipad:
# --filter-for-device-model iPhone8,2
# --filter-for-device-os-version 9.3
# --platform iphonesimulator
$(ACTOOL) \
--compress-pngs \
--enable-on-demand-resources YES \
--minimum-deployment-target 9.3 \
--platform iphoneos \
--target-device ipad \
--compile $(PWD) \
Images.xcassets
mv $(ASSETS) $(DATA)/assets_ipad.car
ios:
# --filter-for-device-model iPhone8,2
# --filter-for-device-os-version 9.3
# --platform iphonesimulator
$(ACTOOL) \
--compress-pngs \
--enable-on-demand-resources YES \
--minimum-deployment-target 9.3 \
--platform iphoneos \
--target-device ipad \
--target-device iphone \
--compile $(PWD) \
Images.xcassets
cp $(ASSETS) $(DATA)/assets.car
mv $(ASSETS) $(DATA)/assets_ios.car
mac:
$(ACTOOL) \
--enable-on-demand-resources NO \
--minimum-deployment-target 10.11 \
--platform macosx \
--target-device mac \
--compile $(PWD) \
Images.xcassets
mv $(ASSETS) $(DATA)/assets_mac.car
tv:
# --platform appletvsimulator
# --filter-for-device-model AppleTV5,3
# --filter-for-device-os-version 9.2
$(ACTOOL) \
--compress-pngs \
--enable-on-demand-resources YES \
--minimum-deployment-target 9.2 \
--platform appletvos \
--target-device tv \
--compile $(PWD) \
Images.xcassets
mv $(ASSETS) $(DATA)/assets_tv.car
watch:
# --platform watchsimulator
# --filter-for-device-model iPhone8,2
# --filter-for-device-os-version 9.3
$(ACTOOL) \
--compress-pngs \
--enable-on-demand-resources NO \
--minimum-deployment-target 2.2 \
--platform watchos \
--target-device watch \
--compile $(PWD) \
Images.xcassets
mv $(ASSETS) $(DATA)/assets_watch.car
# Build app
PROJECT := acextract.xcodeproj
SCHEME := acextract
ARCHIVE := acextract.xcarchive
ACEXTRACT_BIN_PATH := $(ARCHIVE)/Products/usr/local/bin/acextract
build:
-rm -r $(ARCHIVE)
xcodebuild \
-project $(PROJECT) \
-scheme $(SCHEME) \
-archivePath $(PWD)/$(ARCHIVE) \
archive | xcpretty -c
-rm $(PWD)/acextract.bin
cp $(ACEXTRACT_BIN_PATH) $(PWD)/acextract.bin
# Run unit tests
test:
xcodebuild \
-project $(PROJECT) \
-scheme $(SCHEME) \
test | xcpretty -c
# Build and prepare ZIP file for release
ZIP := acextract.zip
zip: build
-rm $(ZIP)
zip -j $(ZIP) $(ACEXTRACT_BIN_PATH)
# Release shourtcut
release: test zip