forked from contentful/contentful.objc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (46 loc) · 1.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
__SIM_ID=`xcrun simctl list|egrep -m 1 '$(SIM_NAME) \([^(]*\) \([^(]*\)$$'|sed -e 's/.* (\(.*\)) (.*)/\1/'`
SIM_NAME=iPhone 4s
SIM_ID=$(shell echo $(__SIM_ID))
ifeq ($(strip $(SIM_ID)),)
$(error Could not find $(SIM_NAME) simulator)
endif
WORKSPACE=ContentfulSDK.xcworkspace
.PHONY: all clean doc example example-static pod really-clean static-lib test
clean:
rm -rf build Examples/UFO/build Examples/*.zip compile_commands.json .gutter.json
rm -rf Examples/UFO/Distribution/ContentfulDeliveryAPI.framework
really-clean: clean
rm -rf Pods $(HOME)/Library/Developer/Xcode/DerivedData/*
all: test example-static
pod:
bundle exec pod install
xcversion select 7.3
xcrun bitcode_strip -r Pods/Realm/core/librealm-ios.a -o Pods/Realm/core/librealm-ios.a
example:
set -o pipefail && xcodebuild clean build -workspace $(WORKSPACE) \
-scheme ContentfulDeliveryAPI \
-sdk iphonesimulator -destination 'id=$(SIM_ID)'| xcpretty -c
set -o pipefail && xcodebuild clean build -workspace $(WORKSPACE) \
-scheme 'UFO Example' \
-sdk iphonesimulator -destination 'id=$(SIM_ID)'| xcpretty -c
example-static: static-lib
cd Examples/UFO; set -o pipefail && xcodebuild clean build \
-sdk iphonesimulator -destination 'id=$(SIM_ID)'| xcpretty -c
static-lib:
bundle exec pod repo update >/dev/null
bundle exec pod package ContentfulDeliveryAPI.podspec
@cd Examples/UFO/Distribution; ./update.sh
cd Examples; ./ship_it.sh
rm -rf ContentfulDeliveryAPI-*/
test: example
@osascript -e 'tell app "iOS Simulator" to quit'
@osascript -e 'tell app "Simulator" to quit'
bundle exec pod lib coverage
lint:
set -o pipefail && xcodebuild clean build -workspace $(WORKSPACE) -dry-run \
-scheme ContentfulDeliveryAPI \
-sdk iphonesimulator -destination 'id=$(SIM_ID)' clean build| \
xcpretty -r json-compilation-database -o compile_commands.json
oclint-json-compilation-database
doc:
bundle exec pod lib docstats