1
- CONFIG = debug
2
- PLATFORM = iOS
1
+ CONFIG = Debug
2
+
3
+ DERIVED_DATA_PATH = ~/.derivedData/$(CONFIG )
4
+
3
5
PLATFORM_IOS = iOS Simulator,id=$(call udid_for,iOS,iPhone \d\+ Pro [^M])
4
6
PLATFORM_MACOS = macOS
5
7
PLATFORM_MAC_CATALYST = macOS,variant=Mac Catalyst
6
8
PLATFORM_TVOS = tvOS Simulator,id=$(call udid_for,tvOS,TV)
7
9
PLATFORM_VISIONOS = visionOS Simulator,id=$(call udid_for,visionOS,Vision)
8
10
PLATFORM_WATCHOS = watchOS Simulator,id=$(call udid_for,watchOS,Watch)
9
11
12
+
13
+ PLATFORM = IOS
14
+ DESTINATION = platform="$(PLATFORM_$(PLATFORM ) ) "
15
+
16
+ SCHEME = Supabase
17
+
18
+ WORKSPACE = Supabase.xcworkspace
19
+
20
+ XCODEBUILD_ARGUMENT = test
21
+
22
+ XCODEBUILD_FLAGS = \
23
+ -configuration $(CONFIG ) \
24
+ -derivedDataPath $(DERIVED_DATA_PATH ) \
25
+ -destination $(DESTINATION ) \
26
+ -scheme "$(SCHEME ) " \
27
+ -skipMacroValidation \
28
+ -workspace $(WORKSPACE )
29
+
30
+ XCODEBUILD_COMMAND = xcodebuild $(XCODEBUILD_ARGUMENT ) $(XCODEBUILD_FLAGS )
31
+
32
+ ifneq ($(strip $(shell which xcbeautify) ) ,)
33
+ XCODEBUILD = set -o pipefail && $(XCODEBUILD_COMMAND) | xcbeautify --quiet
34
+ else
35
+ XCODEBUILD = $(XCODEBUILD_COMMAND)
36
+ endif
37
+
38
+ TEST_RUNNER_CI = $(CI )
39
+
10
40
export SECRETS
11
41
define SECRETS
12
42
enum DotEnv {
@@ -16,110 +46,17 @@ enum DotEnv {
16
46
}
17
47
endef
18
48
19
- default : test-all
20
-
21
- test-all :
22
- $(MAKE ) CONFIG=debug test-library
23
- $(MAKE ) CONFIG=release test-library
24
-
25
49
xcodebuild :
26
- if test " $( PLATFORM) " = " iOS" ; \
27
- then xcodebuild $(COMMAND ) \
28
- -skipMacroValidation \
29
- -configuration $(CONFIG ) \
30
- -workspace Supabase.xcworkspace \
31
- -scheme Supabase \
32
- -destination platform=" $( PLATFORM_IOS) " \
33
- -derivedDataPath ~ /.derivedData/$(CONFIG ) | xcpretty; \
34
- elif test " $( PLATFORM) " = " macOS" ; \
35
- then xcodebuild $(COMMAND ) \
36
- -skipMacroValidation \
37
- -configuration $(CONFIG ) \
38
- -workspace Supabase.xcworkspace \
39
- -scheme Supabase \
40
- -destination platform=" $( PLATFORM_MACOS) " \
41
- -derivedDataPath ~ /.derivedData/$(CONFIG ) | xcpretty; \
42
- elif test " $( PLATFORM) " = " tvOS" ; \
43
- then xcodebuild $(COMMAND ) \
44
- -skipMacroValidation \
45
- -configuration $(CONFIG ) \
46
- -workspace Supabase.xcworkspace \
47
- -scheme Supabase \
48
- -destination platform=" $( PLATFORM_TVOS) " \
49
- -derivedDataPath ~ /.derivedData/$(CONFIG ) | xcpretty; \
50
- elif test " $( PLATFORM) " = " watchOS" ; \
51
- then xcodebuild $(COMMAND ) \
52
- -skipMacroValidation \
53
- -configuration $(CONFIG ) \
54
- -workspace Supabase.xcworkspace \
55
- -scheme Supabase \
56
- -destination platform=" $( PLATFORM_WATCHOS) " \
57
- -derivedDataPath ~ /.derivedData/$(CONFIG ) | xcpretty; \
58
- elif test " $( PLATFORM) " = " visionOS" ; \
59
- then xcodebuild $(COMMAND ) \
60
- -skipMacroValidation \
61
- -configuration $(CONFIG ) \
62
- -workspace Supabase.xcworkspace \
63
- -scheme Supabase \
64
- -destination platform=" $( PLATFORM_VISIONOS) " \
65
- -derivedDataPath ~ /.derivedData/$(CONFIG ) | xcpretty; \
66
- elif test " $( PLATFORM) " = " macCatalyst" ; \
67
- then xcodebuild $(COMMAND ) \
68
- -skipMacroValidation \
69
- -configuration $(CONFIG ) \
70
- -workspace Supabase.xcworkspace \
71
- -scheme Supabase \
72
- -destination platform=" $( PLATFORM_MAC_CATALYST) " \
73
- -derivedDataPath ~ /.derivedData/$(CONFIG ) | xcpretty; \
74
- else exit 1; \
75
- fi ;
50
+ $(XCODEBUILD )
76
51
77
52
load-env :
78
53
@. ./scripts/load_env.sh
79
54
80
55
dot-env :
81
56
@echo " $$ SECRETS" > Tests/IntegrationTests/DotEnv.swift
82
57
83
-
84
- build-all-platforms :
85
- for platform in " iOS" " macOS" " macOS,variant=Mac Catalyst" " tvOS" " visionOS" " watchOS" ; do \
86
- xcodebuild \
87
- -skipMacroValidation \
88
- -configuration " $( CONFIG) " \
89
- -workspace Supabase.xcworkspace \
90
- -scheme " $( SCHEME) " \
91
- -testPlan AllTests \
92
- -destination platform=" $$ platform" | xcpretty || exit 1; \
93
- done
94
-
95
- test-auth :
96
- $(MAKE ) SCHEME=Auth test-library
97
-
98
- test-functions :
99
- $(MAKE ) SCHEME=Functions test-library
100
-
101
- test-postgrest :
102
- $(MAKE ) SCHEME=PostgREST test-library
103
-
104
- test-realtime :
105
- $(MAKE ) SCHEME=Realtime test-library
106
-
107
- test-storage :
108
- $(MAKE ) SCHEME=Storage test-library
109
-
110
58
test-integration : dot-env
111
- set -o pipefail && \
112
- xcodebuild test \
113
- -skipMacroValidation \
114
- -workspace Supabase.xcworkspace \
115
- -scheme Supabase \
116
- -testPlan Integration \
117
- -destination platform=" $( PLATFORM_IOS) " | xcpretty
118
-
119
-
120
- test-linux :
121
- docker build -t supabase-swift .
122
- docker run supabase-swift
59
+ $(MAKE ) TEST_PLAN=Integration xcodebuild
123
60
124
61
build-for-library-evolution :
125
62
swift build \
@@ -141,19 +78,10 @@ test-docs:
141
78
|| (echo " xcodebuild docbuild failed:\n\n$( DOC_WARNINGS) " | tr ' \1' ' \n' \
142
79
&& exit 1)
143
80
144
- build-example :
145
- xcodebuild build \
146
- -skipMacroValidation \
147
- -workspace Supabase.xcworkspace \
148
- -scheme " $( SCHEME) " \
149
- -destination platform=" $( PLATFORM_IOS) " \
150
- -derivedDataPath ~ /.derivedData | xcpretty;
151
-
152
-
153
81
format :
154
82
@swift format -i -r --ignore-unparsable-files .
155
83
156
- .PHONY : test- library test-linux build-example
84
+ .PHONY : build-for- library-evolution format xcodebuild test-docs test-integration
157
85
158
86
define udid_for
159
87
$(shell xcrun simctl list devices available '$(1 ) ' | grep '$(2 ) ' | sort -r | head -1 | awk -F '[() ]' '{ print $$(NF-3 ) }')
0 commit comments