forked from pointfreeco/sqlite-data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.51 KB
/
Makefile
File metadata and controls
55 lines (41 loc) · 1.51 KB
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
CONFIG = Debug
DERIVED_DATA_PATH = ~/.derivedData/$(CONFIG)
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iPhone)
PLATFORM = IOS
DESTINATION = platform="$(PLATFORM_$(PLATFORM))"
SCHEME = Reminders
PLATFORM_ID = $(shell echo "$(DESTINATION)" | sed -E "s/.+,id=(.+)/\1/")
XCODEBUILD_ARGUMENT = test
XCODEBUILD_FLAGS = \
-configuration $(CONFIG) \
-derivedDataPath $(DERIVED_DATA_PATH) \
-destination $(DESTINATION) \
-project Examples/Examples.xcodeproj \
-resultBundlePath TestResults.xcresult \
-scheme "$(SCHEME)" \
-skipMacroValidation
XCODEBUILD_COMMAND = xcodebuild $(XCODEBUILD_ARGUMENT) $(XCODEBUILD_FLAGS)
# NB: Prefer 'xcbeautify --quiet' when this is fixed:
# https://github.com/cpisciotta/xcbeautify/issues/339
ifneq ($(strip $(shell which xcbeautify)),)
XCODEBUILD = set -o pipefail && $(XCODEBUILD_COMMAND) | xcbeautify
else
XCODEBUILD = $(XCODEBUILD_COMMAND)
endif
TEST_RUNNER_CI = $(CI)
warm-simulator:
@test "$(PLATFORM_ID)" != "" \
&& xcrun simctl boot $(PLATFORM_ID) \
&& open -a Simulator --args -CurrentDeviceUDID $(PLATFORM_ID) \
|| exit 0
xcodebuild: warm-simulator
$(XCODEBUILD)
xcodebuild-raw: warm-simulator
$(XCODEBUILD_COMMAND)
format:
swift format . --recursive --in-place
find README.md Sources -name '*.md' -exec sed -i '' -e 's/ *$$//g' {} \;
.PHONY: format warm-simulator xcodebuild xcodebuild-raw
define udid_for
$(shell xcrun simctl list --json devices available '$(1)' | jq -r '[.devices|to_entries|sort_by(.key)|reverse|.[].value|select(length > 0)|.[0]][0].udid')
endef