-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
58 lines (45 loc) · 1.64 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
#
# Makefile for Frickbits.
#
# This relies on several additional tools (xctool).
#
# To install xctool:
# brew install -v --HEAD xctool
#
WORKSPACE=FRICKbits.xcworkspace
SCHEME=FRICKbits
XCTOOL=xctool -workspace $(WORKSPACE) -scheme $(SCHEME)
BUILD_DIR=build
CURRENT_DIR=$(shell pwd)
TESTFLIGHT_API_TOKEN_FILE=.testflight_api_token
TESTFLIGHT_API_TOKEN=$(shell cat $(HOME)/$(TESTFLIGHT_API_TOKEN_FILE) 2>/dev/null)
TESTFLIGHT_TEAM_TOKEN=
TESTFLIGHT_DISTRIBUTION_LIST=Alpha Testers
all: build
archive:
@mkdir -p $(BUILD_DIR)
# TODO: we're using Debug configuration so Tweaks appears in the TestFlight build
$(XCTOOL) archive -archivePath $(BUILD_DIR)/$(SCHEME) -configuration Debug
build:
$(XCTOOL) build
clean:
@rm -rf $(BUILD_DIR)
$(XCTOOL) clean
ipa: archive
@zip -r $(BUILD_DIR)/$(SCHEME).app.dSYM.zip $(BUILD_DIR)/$(SCHEME).xcarchive/dSYMs/$(SCHEME).app.dSYM
xcrun -sdk iphoneos PackageApplication -v $(BUILD_DIR)/$(SCHEME).xcarchive/Products/Applications/$(SCHEME).app -o $(CURRENT_DIR)/$(BUILD_DIR)/$(SCHEME).ipa
test:
$(XCTOOL) test -sdk iphonesimulator
testflight: verify_testflight_dotfile ipa
@$(eval TEMPFILE := $(shell mktemp -t build_notes))
@vi $(TEMPFILE)
curl http://testflightapp.com/api/builds.json \
-F file=@$(BUILD_DIR)/$(SCHEME).ipa \
-F dsym=@$(BUILD_DIR)/$(SCHEME).app.dSYM.zip \
-F api_token='$(TESTFLIGHT_API_TOKEN)' \
-F team_token='$(TESTFLIGHT_TEAM_TOKEN)' \
-F distribution_lists='$(TESTFLIGHT_DISTRIBUTION_LIST)' \
-F notify=True \
-F notes=@$(TEMPFILE)
verify_testflight_dotfile:
@test -f $(HOME)/$(TESTFLIGHT_API_TOKEN_FILE) || { echo "$(HOME)/$(TESTFLIGHT_API_TOKEN_FILE) does not exist. Exiting."; exit 1; }