@@ -10,10 +10,11 @@ PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,tvOS,TV)
10
10
PLATFORM_VISIONOS = visionOS Simulator,id=$(call udid_for,visionOS,Vision)
11
11
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,watchOS,Watch)
12
12
13
-
14
13
PLATFORM = IOS
15
14
DESTINATION = platform="$(PLATFORM_$(PLATFORM ) ) "
16
15
16
+ PLATFORM_ID = $(shell echo "$(DESTINATION ) " | sed -E "s/.+,id=(.+) /\1/")
17
+
17
18
SCHEME = Supabase
18
19
19
20
WORKSPACE = Supabase.xcworkspace
@@ -26,19 +27,25 @@ XCODEBUILD_FLAGS = \
26
27
-destination $(DESTINATION ) \
27
28
-scheme "$(SCHEME ) " \
28
29
-skipMacroValidation \
29
- -workspace $(WORKSPACE ) \
30
+ -workspace $(WORKSPACE )
30
31
31
32
XCODEBUILD_COMMAND = xcodebuild $(XCODEBUILD_ARGUMENT ) $(XCODEBUILD_FLAGS )
32
33
33
34
ifneq ($(strip $(shell which xcbeautify) ) ,)
34
- XCODEBUILD = set -o pipefail && $(XCODEBUILD_COMMAND) | xcbeautify --quiet
35
+ XCODEBUILD = set -o pipefail && $(XCODEBUILD_COMMAND) | xcbeautify
35
36
else
36
37
XCODEBUILD = $(XCODEBUILD_COMMAND)
37
38
endif
38
39
39
40
TEST_RUNNER_CI = $(CI )
40
41
41
- xcodebuild :
42
+ warm-simulator :
43
+ @test " $( PLATFORM_ID) " ! = " " \
44
+ && xcrun simctl boot $(PLATFORM_ID ) \
45
+ && open -a Simulator --args -CurrentDeviceUDID $(PLATFORM_ID ) \
46
+ || exit 0
47
+
48
+ xcodebuild : warm-simulator
42
49
$(XCODEBUILD )
43
50
44
51
test-integration :
@@ -48,6 +55,7 @@ test-integration:
48
55
49
56
build-for-library-evolution :
50
57
swift build \
58
+ -q \
51
59
-c release \
52
60
--target Supabase \
53
61
-Xswiftc -emit-module-interface \
@@ -67,31 +75,18 @@ test-docs:
67
75
&& exit 1)
68
76
69
77
format :
70
- @swift format -i -r --ignore-unparsable-files .
71
-
72
-
73
- test-linux :
74
- docker run \
75
- --rm \
76
- -v " $( PWD) :$( PWD) " \
77
- -w " $( PWD) " \
78
- swift:5.10 \
79
- bash -c ' swift test -c $(CONFIG)'
80
-
81
- build-linux :
82
- docker run \
83
- --rm \
84
- -v " $( PWD) :$( PWD) " \
85
- -w " $( PWD) " \
86
- swift:5.9 \
87
- bash -c ' swift build -c $(CONFIG)'
78
+ find . \
79
+ -path ' */Documentation/docc' -prune -o \
80
+ -name ' *.swift' \
81
+ -not -path ' */.*' -print0 \
82
+ | xargs -0 xcrun swift-format --ignore-unparsable-files --in-place
88
83
89
- .PHONY : build-for-library-evolution format xcodebuild test-docs test-integration
84
+ .PHONY : build-for-library-evolution format warm-simulator xcodebuild test-docs test-integration
90
85
91
86
.PHONY : coverage
92
87
coverage :
93
88
@DERIVED_DATA_PATH=$(DERIVED_DATA_PATH ) ./scripts/generate-coverage.sh
94
89
95
90
define udid_for
96
- $(shell xcrun simctl list devices available '$(1 ) ' | grep ' $( 2 ) ' | sort -r | head -1 | awk -F '[() ]' '{ print $$( NF-3 ) } ')
97
- endef
91
+ $(shell xcrun simctl list --json devices available '$(1 ) ' | jq -r '[.devices|to_entries|sort_by(.key) |reverse|.[].value|select(length > 0)|.[0]][0].udid ')
92
+ endef
0 commit comments