ann-flutter-flavor 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +271 -0
- data/Rakefile +6 -0
- data/ann-flutter-flavor.gemspec +25 -0
- data/lib/ann-flutter-flavor.rb +10 -0
- data/lib/ann_flutter_flavor/version.rb +3 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/actions/ann_compile_build_action.rb +219 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/actions/ann_download_from_app_store_action.rb +183 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/actions/ann_download_from_play_store_action.rb +168 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/actions/ann_emulators_action.rb +180 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/actions/ann_run_tests_action.rb +128 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/actions/ann_setup_action.rb +137 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/actions/ann_upload_to_app_store_action.rb +280 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/actions/ann_upload_to_firebase_action.rb +199 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/actions/ann_upload_to_play_store_action.rb +248 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/helper/lanes_android.rb +120 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/helper/lanes_annai.rb +502 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/helper/lanes_ios.rb +157 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/helper/lanes_setup.rb +161 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/helper/podspec_bridge.rb +153 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/helper/test_integration.rb +346 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/helper/utils_project_config.rb +96 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/helper/utils_spec_loader.rb +363 -0
- data/lib/fastlane/plugin/ann_flutter_flavor/helper/utils_status.rb +115 -0
- data/lib/fastlane/plugin/ann_flutter_flavor.rb +23 -0
- data/plugin_manager.sh +140 -0
- metadata +112 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 41f9a2dd196744c2bd43356c0d3d6060848b77b5d5178bcb9d24ca508b8805d6
|
|
4
|
+
data.tar.gz: 1e7210490f6ddf99410c42ac054620645ccd242099e03c63d3bb3f3af3d5045b
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 75166a442897234f7a64a7a5a8573781d686056e8863e64c1c0345ef00222352111d23880d9b46163174df813e54b85d4650c5c3e6bf54f39eb9e216eb701ef9
|
|
7
|
+
data.tar.gz: 3598147546e2b831c65bb400d40d19941ce281bc134a558b94ca7d5a010c3783c0d9dc153c11ef85b4608f823c311e2c2f15929aab54fad3d67d2682efa6fc19
|
data/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/pkg/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
annai-flutter-flavor (0.1.2)
|
|
5
|
+
fastlane (>= 2.232.2)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
CFPropertyList (3.0.8)
|
|
11
|
+
abbrev (0.1.2)
|
|
12
|
+
addressable (2.8.8)
|
|
13
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
14
|
+
artifactory (3.0.17)
|
|
15
|
+
atomos (0.1.3)
|
|
16
|
+
aws-eventstream (1.4.0)
|
|
17
|
+
aws-partitions (1.1220.0)
|
|
18
|
+
aws-sdk-core (3.242.0)
|
|
19
|
+
aws-eventstream (~> 1, >= 1.3.0)
|
|
20
|
+
aws-partitions (~> 1, >= 1.992.0)
|
|
21
|
+
aws-sigv4 (~> 1.9)
|
|
22
|
+
base64
|
|
23
|
+
bigdecimal
|
|
24
|
+
jmespath (~> 1, >= 1.6.1)
|
|
25
|
+
logger
|
|
26
|
+
aws-sdk-kms (1.122.0)
|
|
27
|
+
aws-sdk-core (~> 3, >= 3.241.4)
|
|
28
|
+
aws-sigv4 (~> 1.5)
|
|
29
|
+
aws-sdk-s3 (1.213.0)
|
|
30
|
+
aws-sdk-core (~> 3, >= 3.241.4)
|
|
31
|
+
aws-sdk-kms (~> 1)
|
|
32
|
+
aws-sigv4 (~> 1.5)
|
|
33
|
+
aws-sigv4 (1.12.1)
|
|
34
|
+
aws-eventstream (~> 1, >= 1.0.2)
|
|
35
|
+
babosa (1.0.4)
|
|
36
|
+
base64 (0.2.0)
|
|
37
|
+
benchmark (0.5.0)
|
|
38
|
+
bigdecimal (4.0.1)
|
|
39
|
+
claide (1.1.0)
|
|
40
|
+
coderay (1.1.3)
|
|
41
|
+
colored (1.2)
|
|
42
|
+
colored2 (3.1.2)
|
|
43
|
+
commander (4.6.0)
|
|
44
|
+
highline (~> 2.0.0)
|
|
45
|
+
csv (3.3.5)
|
|
46
|
+
declarative (0.0.20)
|
|
47
|
+
diff-lcs (1.6.2)
|
|
48
|
+
digest-crc (0.7.0)
|
|
49
|
+
rake (>= 12.0.0, < 14.0.0)
|
|
50
|
+
domain_name (0.6.20240107)
|
|
51
|
+
dotenv (2.8.1)
|
|
52
|
+
emoji_regex (3.2.3)
|
|
53
|
+
excon (0.112.0)
|
|
54
|
+
faraday (1.10.5)
|
|
55
|
+
faraday-em_http (~> 1.0)
|
|
56
|
+
faraday-em_synchrony (~> 1.0)
|
|
57
|
+
faraday-excon (~> 1.1)
|
|
58
|
+
faraday-httpclient (~> 1.0)
|
|
59
|
+
faraday-multipart (~> 1.0)
|
|
60
|
+
faraday-net_http (~> 1.0)
|
|
61
|
+
faraday-net_http_persistent (~> 1.0)
|
|
62
|
+
faraday-patron (~> 1.0)
|
|
63
|
+
faraday-rack (~> 1.0)
|
|
64
|
+
faraday-retry (~> 1.0)
|
|
65
|
+
ruby2_keywords (>= 0.0.4)
|
|
66
|
+
faraday-cookie_jar (0.0.8)
|
|
67
|
+
faraday (>= 0.8.0)
|
|
68
|
+
http-cookie (>= 1.0.0)
|
|
69
|
+
faraday-em_http (1.0.0)
|
|
70
|
+
faraday-em_synchrony (1.0.1)
|
|
71
|
+
faraday-excon (1.1.0)
|
|
72
|
+
faraday-httpclient (1.0.1)
|
|
73
|
+
faraday-multipart (1.2.0)
|
|
74
|
+
multipart-post (~> 2.0)
|
|
75
|
+
faraday-net_http (1.0.2)
|
|
76
|
+
faraday-net_http_persistent (1.2.0)
|
|
77
|
+
faraday-patron (1.0.0)
|
|
78
|
+
faraday-rack (1.0.0)
|
|
79
|
+
faraday-retry (1.0.3)
|
|
80
|
+
faraday_middleware (1.2.1)
|
|
81
|
+
faraday (~> 1.0)
|
|
82
|
+
fastimage (2.4.0)
|
|
83
|
+
fastlane (2.232.2)
|
|
84
|
+
CFPropertyList (>= 2.3, < 4.0.0)
|
|
85
|
+
abbrev (~> 0.1.2)
|
|
86
|
+
addressable (>= 2.8, < 3.0.0)
|
|
87
|
+
artifactory (~> 3.0)
|
|
88
|
+
aws-sdk-s3 (~> 1.197)
|
|
89
|
+
babosa (>= 1.0.3, < 2.0.0)
|
|
90
|
+
base64 (~> 0.2.0)
|
|
91
|
+
benchmark (>= 0.1.0)
|
|
92
|
+
bundler (>= 1.17.3, < 5.0.0)
|
|
93
|
+
colored (~> 1.2)
|
|
94
|
+
commander (~> 4.6)
|
|
95
|
+
csv (~> 3.3)
|
|
96
|
+
dotenv (>= 2.1.1, < 3.0.0)
|
|
97
|
+
emoji_regex (>= 0.1, < 4.0)
|
|
98
|
+
excon (>= 0.71.0, < 1.0.0)
|
|
99
|
+
faraday (~> 1.0)
|
|
100
|
+
faraday-cookie_jar (~> 0.0.6)
|
|
101
|
+
faraday_middleware (~> 1.0)
|
|
102
|
+
fastimage (>= 2.1.0, < 3.0.0)
|
|
103
|
+
fastlane-sirp (>= 1.0.0)
|
|
104
|
+
gh_inspector (>= 1.1.2, < 2.0.0)
|
|
105
|
+
google-apis-androidpublisher_v3 (~> 0.3)
|
|
106
|
+
google-apis-playcustomapp_v1 (~> 0.1)
|
|
107
|
+
google-cloud-env (>= 1.6.0, <= 2.1.1)
|
|
108
|
+
google-cloud-storage (~> 1.31)
|
|
109
|
+
highline (~> 2.0)
|
|
110
|
+
http-cookie (~> 1.0.5)
|
|
111
|
+
json (< 3.0.0)
|
|
112
|
+
jwt (>= 2.1.0, < 3)
|
|
113
|
+
logger (>= 1.6, < 2.0)
|
|
114
|
+
mini_magick (>= 4.9.4, < 5.0.0)
|
|
115
|
+
multipart-post (>= 2.0.0, < 3.0.0)
|
|
116
|
+
mutex_m (~> 0.3.0)
|
|
117
|
+
naturally (~> 2.2)
|
|
118
|
+
nkf (~> 0.2.0)
|
|
119
|
+
optparse (>= 0.1.1, < 1.0.0)
|
|
120
|
+
ostruct (>= 0.1.0)
|
|
121
|
+
plist (>= 3.1.0, < 4.0.0)
|
|
122
|
+
rubyzip (>= 2.0.0, < 3.0.0)
|
|
123
|
+
security (= 0.1.5)
|
|
124
|
+
simctl (~> 1.6.3)
|
|
125
|
+
terminal-notifier (>= 2.0.0, < 3.0.0)
|
|
126
|
+
terminal-table (~> 3)
|
|
127
|
+
tty-screen (>= 0.6.3, < 1.0.0)
|
|
128
|
+
tty-spinner (>= 0.8.0, < 1.0.0)
|
|
129
|
+
word_wrap (~> 1.0.0)
|
|
130
|
+
xcodeproj (>= 1.13.0, < 2.0.0)
|
|
131
|
+
xcpretty (~> 0.4.1)
|
|
132
|
+
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
|
|
133
|
+
fastlane-sirp (1.0.0)
|
|
134
|
+
sysrandom (~> 1.0)
|
|
135
|
+
gh_inspector (1.1.3)
|
|
136
|
+
google-apis-androidpublisher_v3 (0.96.0)
|
|
137
|
+
google-apis-core (>= 0.15.0, < 2.a)
|
|
138
|
+
google-apis-core (0.18.0)
|
|
139
|
+
addressable (~> 2.5, >= 2.5.1)
|
|
140
|
+
googleauth (~> 1.9)
|
|
141
|
+
httpclient (>= 2.8.3, < 3.a)
|
|
142
|
+
mini_mime (~> 1.0)
|
|
143
|
+
mutex_m
|
|
144
|
+
representable (~> 3.0)
|
|
145
|
+
retriable (>= 2.0, < 4.a)
|
|
146
|
+
google-apis-iamcredentials_v1 (0.26.0)
|
|
147
|
+
google-apis-core (>= 0.15.0, < 2.a)
|
|
148
|
+
google-apis-playcustomapp_v1 (0.17.0)
|
|
149
|
+
google-apis-core (>= 0.15.0, < 2.a)
|
|
150
|
+
google-apis-storage_v1 (0.61.0)
|
|
151
|
+
google-apis-core (>= 0.15.0, < 2.a)
|
|
152
|
+
google-cloud-core (1.8.0)
|
|
153
|
+
google-cloud-env (>= 1.0, < 3.a)
|
|
154
|
+
google-cloud-errors (~> 1.0)
|
|
155
|
+
google-cloud-env (2.1.1)
|
|
156
|
+
faraday (>= 1.0, < 3.a)
|
|
157
|
+
google-cloud-errors (1.5.0)
|
|
158
|
+
google-cloud-storage (1.58.0)
|
|
159
|
+
addressable (~> 2.8)
|
|
160
|
+
digest-crc (~> 0.4)
|
|
161
|
+
google-apis-core (>= 0.18, < 2)
|
|
162
|
+
google-apis-iamcredentials_v1 (~> 0.18)
|
|
163
|
+
google-apis-storage_v1 (>= 0.42)
|
|
164
|
+
google-cloud-core (~> 1.6)
|
|
165
|
+
googleauth (~> 1.9)
|
|
166
|
+
mini_mime (~> 1.0)
|
|
167
|
+
googleauth (1.11.2)
|
|
168
|
+
faraday (>= 1.0, < 3.a)
|
|
169
|
+
google-cloud-env (~> 2.1)
|
|
170
|
+
jwt (>= 1.4, < 3.0)
|
|
171
|
+
multi_json (~> 1.11)
|
|
172
|
+
os (>= 0.9, < 2.0)
|
|
173
|
+
signet (>= 0.16, < 2.a)
|
|
174
|
+
highline (2.0.3)
|
|
175
|
+
http-cookie (1.0.8)
|
|
176
|
+
domain_name (~> 0.5)
|
|
177
|
+
httpclient (2.9.0)
|
|
178
|
+
mutex_m
|
|
179
|
+
io-console (0.8.2)
|
|
180
|
+
jmespath (1.6.2)
|
|
181
|
+
json (2.18.1)
|
|
182
|
+
jwt (2.10.2)
|
|
183
|
+
base64
|
|
184
|
+
logger (1.7.0)
|
|
185
|
+
method_source (1.1.0)
|
|
186
|
+
mini_magick (4.13.2)
|
|
187
|
+
mini_mime (1.1.5)
|
|
188
|
+
multi_json (1.19.1)
|
|
189
|
+
multipart-post (2.4.1)
|
|
190
|
+
mutex_m (0.3.0)
|
|
191
|
+
nanaimo (0.4.0)
|
|
192
|
+
naturally (2.3.0)
|
|
193
|
+
nkf (0.2.0)
|
|
194
|
+
optparse (0.8.1)
|
|
195
|
+
os (1.1.4)
|
|
196
|
+
ostruct (0.6.3)
|
|
197
|
+
plist (3.7.2)
|
|
198
|
+
pry (0.16.0)
|
|
199
|
+
coderay (~> 1.1)
|
|
200
|
+
method_source (~> 1.0)
|
|
201
|
+
reline (>= 0.6.0)
|
|
202
|
+
public_suffix (7.0.2)
|
|
203
|
+
rake (13.3.1)
|
|
204
|
+
reline (0.6.3)
|
|
205
|
+
io-console (~> 0.5)
|
|
206
|
+
representable (3.2.0)
|
|
207
|
+
declarative (< 0.1.0)
|
|
208
|
+
trailblazer-option (>= 0.1.1, < 0.2.0)
|
|
209
|
+
uber (< 0.2.0)
|
|
210
|
+
retriable (3.2.1)
|
|
211
|
+
rexml (3.4.4)
|
|
212
|
+
rouge (3.28.0)
|
|
213
|
+
rspec (3.4.0)
|
|
214
|
+
rspec-core (~> 3.4.0)
|
|
215
|
+
rspec-expectations (~> 3.4.0)
|
|
216
|
+
rspec-mocks (~> 3.4.0)
|
|
217
|
+
rspec-core (3.4.4)
|
|
218
|
+
rspec-support (~> 3.4.0)
|
|
219
|
+
rspec-expectations (3.4.0)
|
|
220
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
221
|
+
rspec-support (~> 3.4.0)
|
|
222
|
+
rspec-mocks (3.4.1)
|
|
223
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
224
|
+
rspec-support (~> 3.4.0)
|
|
225
|
+
rspec-support (3.4.1)
|
|
226
|
+
ruby2_keywords (0.0.5)
|
|
227
|
+
rubyzip (2.4.1)
|
|
228
|
+
security (0.1.5)
|
|
229
|
+
signet (0.21.0)
|
|
230
|
+
addressable (~> 2.8)
|
|
231
|
+
faraday (>= 0.17.5, < 3.a)
|
|
232
|
+
jwt (>= 1.5, < 4.0)
|
|
233
|
+
multi_json (~> 1.10)
|
|
234
|
+
simctl (1.6.10)
|
|
235
|
+
CFPropertyList
|
|
236
|
+
naturally
|
|
237
|
+
sysrandom (1.0.5)
|
|
238
|
+
terminal-notifier (2.0.0)
|
|
239
|
+
terminal-table (3.0.2)
|
|
240
|
+
unicode-display_width (>= 1.1.1, < 3)
|
|
241
|
+
trailblazer-option (0.1.2)
|
|
242
|
+
tty-cursor (0.7.1)
|
|
243
|
+
tty-screen (0.8.2)
|
|
244
|
+
tty-spinner (0.9.3)
|
|
245
|
+
tty-cursor (~> 0.7)
|
|
246
|
+
uber (0.1.0)
|
|
247
|
+
unicode-display_width (2.6.0)
|
|
248
|
+
word_wrap (1.0.0)
|
|
249
|
+
xcodeproj (1.27.0)
|
|
250
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
|
251
|
+
atomos (~> 0.1.3)
|
|
252
|
+
claide (>= 1.0.2, < 2.0)
|
|
253
|
+
colored2 (~> 3.1)
|
|
254
|
+
nanaimo (~> 0.4.0)
|
|
255
|
+
rexml (>= 3.3.6, < 4.0)
|
|
256
|
+
xcpretty (0.4.1)
|
|
257
|
+
rouge (~> 3.28.0)
|
|
258
|
+
xcpretty-travis-formatter (1.0.1)
|
|
259
|
+
xcpretty (~> 0.2, >= 0.0.7)
|
|
260
|
+
|
|
261
|
+
PLATFORMS
|
|
262
|
+
arm64-darwin-25
|
|
263
|
+
ruby
|
|
264
|
+
|
|
265
|
+
DEPENDENCIES
|
|
266
|
+
annai-flutter-flavor!
|
|
267
|
+
pry
|
|
268
|
+
rspec (~> 3.4.0)
|
|
269
|
+
|
|
270
|
+
BUNDLED WITH
|
|
271
|
+
2.7.2
|
data/Rakefile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
lib = File.expand_path('lib', __dir__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
|
|
5
|
+
require 'ann_flutter_flavor/version'
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |spec|
|
|
8
|
+
spec.name = "ann-flutter-flavor"
|
|
9
|
+
spec.version = AnnFlutterFlavor::VERSION
|
|
10
|
+
spec.authors = ["ANN Solutions"]
|
|
11
|
+
spec.email = ["support@annaibrands.com"]
|
|
12
|
+
spec.summary = "A fastlane plugin to manage Flutter build flavors and shared setup."
|
|
13
|
+
spec.homepage = "https://github.com/anntech-dev"
|
|
14
|
+
spec.license = "MIT"
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
17
|
+
spec.bindir = "exe"
|
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
19
|
+
spec.require_paths = ["lib"]
|
|
20
|
+
|
|
21
|
+
# Defines the fastlane dependency
|
|
22
|
+
spec.add_dependency "fastlane", ">= 2.232.2"
|
|
23
|
+
spec.add_development_dependency 'pry'
|
|
24
|
+
spec.add_development_dependency 'rspec', '~> 3.4.0'
|
|
25
|
+
end
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file is loaded by require 'annai-flutter-flavor'
|
|
2
|
+
|
|
3
|
+
# Load the version (Good Practice)
|
|
4
|
+
require 'ann_flutter_flavor/version'
|
|
5
|
+
|
|
6
|
+
require 'fastlane'
|
|
7
|
+
|
|
8
|
+
# Load the Fastlane plugin structure (which defines the Plugin class)
|
|
9
|
+
require 'fastlane/plugin/ann_flutter_flavor'
|
|
10
|
+
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
require 'fastlane/action'
|
|
2
|
+
require 'fastlane/plugin/ann_flutter_flavor/helper/lanes_annai'
|
|
3
|
+
require 'fastlane/plugin/ann_flutter_flavor/helper/utils_spec_loader'
|
|
4
|
+
|
|
5
|
+
module Fastlane
|
|
6
|
+
module Actions
|
|
7
|
+
class AnnaiCompileBuildAction < Action
|
|
8
|
+
|
|
9
|
+
def self.run(params)
|
|
10
|
+
platform = params[:platform]
|
|
11
|
+
requested_flavor = params[:flavor]
|
|
12
|
+
requested_clean_build = params[:clean]
|
|
13
|
+
spec_file = params[:spec_file]
|
|
14
|
+
|
|
15
|
+
# 1. Initialize AnnaiLanes
|
|
16
|
+
annai_lanes = FastlaneFlutterFlavor::AnnaiLanes.new(
|
|
17
|
+
lane: self,
|
|
18
|
+
platform: platform, # Pass platform symbol directly
|
|
19
|
+
spec_file: spec_file # Pass optional spec_file
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
# Get the StatusManager instance for logging errors explicitly
|
|
23
|
+
status_manager = annai_lanes.instance_variable_get(:@statusManager)
|
|
24
|
+
|
|
25
|
+
spec_loader = annai_lanes.instance_variable_get(:@specLoader)
|
|
26
|
+
UI.user_error!("Internal Error: AnnaiLanes failed to initialize specLoader.") unless spec_loader
|
|
27
|
+
|
|
28
|
+
# Flag to track if any flavor compilation failed
|
|
29
|
+
any_build_failed = false
|
|
30
|
+
|
|
31
|
+
# 2. Perform clean build if requested
|
|
32
|
+
if requested_clean_build
|
|
33
|
+
UI.header("🧹 Cleaning builds as requested...")
|
|
34
|
+
begin
|
|
35
|
+
annai_lanes.clean_build
|
|
36
|
+
rescue => e
|
|
37
|
+
UI.error("Failed to perform clean build: #{e.message}. Attempting to proceed with compilation.")
|
|
38
|
+
status_manager.logError("All", "annai_clean_build", platform, "Clean build failed: #{e.message}")
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# 3. Get the list of all flavors defined for the platform
|
|
43
|
+
flavors_hash = spec_loader.get_platform_flavors(platform)
|
|
44
|
+
|
|
45
|
+
if flavors_hash.empty?
|
|
46
|
+
UI.important("No flavors found for platform '#{platform}' in the Annai spec. Nothing to build.")
|
|
47
|
+
annai_lanes.finalize
|
|
48
|
+
return
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
all_flavor_names = flavors_hash.keys
|
|
52
|
+
|
|
53
|
+
# 4. Determine which flavors to build
|
|
54
|
+
if requested_flavor && !requested_flavor.to_s.empty?
|
|
55
|
+
requested_flavors = requested_flavor.to_s.split(',').map(&:strip).reject(&:empty?)
|
|
56
|
+
|
|
57
|
+
# Validate all requested flavors
|
|
58
|
+
invalid_flavors = requested_flavors.reject { |f| all_flavor_names.include?(f) }
|
|
59
|
+
|
|
60
|
+
if invalid_flavors.any?
|
|
61
|
+
UI.user_error!("The following requested flavor(s) are not found in the Annai spec for platform '#{platform}': #{invalid_flavors.join(', ')}. Available flavors: #{all_flavor_names.join(', ')}")
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
flavors_to_build = requested_flavors
|
|
65
|
+
|
|
66
|
+
else
|
|
67
|
+
# No specific flavor requested, build all of them
|
|
68
|
+
flavors_to_build = all_flavor_names
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
UI.header("Starting build for #{platform}. Flavors to compile: #{flavors_to_build.join(', ')}")
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# 5. Loop through each flavor and directly call compile_build on AnnaiLanes
|
|
75
|
+
flavors_to_build.each do |flavor_key|
|
|
76
|
+
|
|
77
|
+
flavor = flavor_key.to_s
|
|
78
|
+
|
|
79
|
+
# Use the new getter, which uses the internal spec data
|
|
80
|
+
flavor_main_file = spec_loader.get_main_file(platform, flavor)
|
|
81
|
+
|
|
82
|
+
# Use the main_file provided by the user as a fallback if the spec doesn't define one
|
|
83
|
+
final_main_file = flavor_main_file || params[:main_file]
|
|
84
|
+
|
|
85
|
+
if final_main_file.nil? || final_main_file.empty?
|
|
86
|
+
error_msg = "Could not determine 'main_file' for flavor '#{flavor}' on platform '#{platform}'. Check your Annai spec or provide a default 'main_file'."
|
|
87
|
+
UI.error("❌ #{error_msg}")
|
|
88
|
+
status_manager.logError(flavor, "ann_compile_build_all", platform, error_msg)
|
|
89
|
+
any_build_failed = true
|
|
90
|
+
next
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
UI.message("⚙️ Compiling **#{flavor}** flavor using main file: #{final_main_file}...")
|
|
94
|
+
|
|
95
|
+
begin
|
|
96
|
+
# CRITICAL: Direct call to the AnnaiLanes helper method
|
|
97
|
+
success = annai_lanes.compile_build(
|
|
98
|
+
flavor: flavor,
|
|
99
|
+
sub_command: params[:sub_command],
|
|
100
|
+
build_config: params[:build_config],
|
|
101
|
+
main_file: final_main_file,
|
|
102
|
+
skip_sound_null_safety: params[:skip_sound_null_safety],
|
|
103
|
+
skip_code_sign: params[:skip_code_sign],
|
|
104
|
+
export_options_plist: params[:export_options_plist],
|
|
105
|
+
additional_parameter: params[:additional_parameter],
|
|
106
|
+
platform: platform.to_s # Ensure platform is passed as a string/symbol as expected by the helper
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
if success
|
|
110
|
+
UI.success("🎉 Successfully compiled flavor: #{flavor}")
|
|
111
|
+
else
|
|
112
|
+
# If compile_build returns false (meaning it caught an error and logged it), flag the overall failure.
|
|
113
|
+
raise "Compilation failed for flavor '#{flavor}' (error logged previously)."
|
|
114
|
+
end
|
|
115
|
+
rescue => e
|
|
116
|
+
# Failure handling: Log the error using StatusManager (if not already logged by compile_build) and continue
|
|
117
|
+
if !status_manager.instance_variable_get(:@status).key?([flavor, "compile_build", platform.to_s])
|
|
118
|
+
status_manager.logError(flavor, "ann_compile_build_all", platform, e.message)
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
UI.error("❌ Failed to compile flavor: #{flavor}. Continuing to next flavor...")
|
|
122
|
+
any_build_failed = true
|
|
123
|
+
# Continue to the next flavor
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# 6. Final Reporting and Status Check
|
|
128
|
+
# Finalize calls statusManager.displayStatus to show the comprehensive report
|
|
129
|
+
annai_lanes.finalize
|
|
130
|
+
|
|
131
|
+
if any_build_failed
|
|
132
|
+
# If any build failed, we stop the lane with an error after the summary is displayed.
|
|
133
|
+
UI.user_error!("Compilation failed for one or more flavors. See the Annai Fastlane summary above.")
|
|
134
|
+
else
|
|
135
|
+
UI.success("✅ Successfully compiled all #{flavors_to_build.count} requested flavor(s) for #{platform}!")
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# ----------------------------------------------------
|
|
140
|
+
# Define Parameters
|
|
141
|
+
# ----------------------------------------------------
|
|
142
|
+
def self.available_options
|
|
143
|
+
[
|
|
144
|
+
FastlaneCore::ConfigItem.new(key: :platform,
|
|
145
|
+
description: "The platform (:ios, :android, or :web)",
|
|
146
|
+
is_string: false,
|
|
147
|
+
verify_block: proc do |value|
|
|
148
|
+
UI.user_error!("Platform must be :ios, :android, or :web") unless [:ios, :android, :web].include?(value)
|
|
149
|
+
end),
|
|
150
|
+
|
|
151
|
+
FastlaneCore::ConfigItem.new(key: :spec_file,
|
|
152
|
+
description: "Path to the annai spec configuration file (relative to flutter root). Defaults to standard discovery",
|
|
153
|
+
optional: true,
|
|
154
|
+
default_value: nil),
|
|
155
|
+
|
|
156
|
+
FastlaneCore::ConfigItem.new(key: :clean,
|
|
157
|
+
description: "If true, runs annai_clean_build before compiling all flavors",
|
|
158
|
+
type: Boolean,
|
|
159
|
+
default_value: false),
|
|
160
|
+
|
|
161
|
+
FastlaneCore::ConfigItem.new(key: :flavor,
|
|
162
|
+
description: "The specific flavor(s) to build (comma-separated). If nil, all flavors are built",
|
|
163
|
+
optional: true,
|
|
164
|
+
default_value: nil),
|
|
165
|
+
|
|
166
|
+
# All following options are passed directly to the single build action
|
|
167
|
+
FastlaneCore::ConfigItem.new(key: :sub_command,
|
|
168
|
+
description: "Flutter build subcommand (e.g., appbundle, ipa, web) to use for all flavors",
|
|
169
|
+
# Note: If platform is :web, this should typically be 'web' or similar.
|
|
170
|
+
default_value: "appbundle"),
|
|
171
|
+
FastlaneCore::ConfigItem.new(key: :build_config,
|
|
172
|
+
description: "Build configuration (e.g., debug, profile, release) to use for all flavors",
|
|
173
|
+
default_value: "release"),
|
|
174
|
+
FastlaneCore::ConfigItem.new(key: :main_file,
|
|
175
|
+
description: "Path to the main dart file (used as default for all flavors unless overridden in the Annai spec)",
|
|
176
|
+
default_value: "lib/main.dart"),
|
|
177
|
+
FastlaneCore::ConfigItem.new(key: :skip_sound_null_safety,
|
|
178
|
+
type: Boolean,
|
|
179
|
+
default_value: false),
|
|
180
|
+
FastlaneCore::ConfigItem.new(key: :skip_code_sign,
|
|
181
|
+
type: Boolean,
|
|
182
|
+
default_value: false),
|
|
183
|
+
FastlaneCore::ConfigItem.new(key: :export_options_plist,
|
|
184
|
+
description: "Path to export options plist (iOS only)",
|
|
185
|
+
optional: true,
|
|
186
|
+
default_value: ""),
|
|
187
|
+
FastlaneCore::ConfigItem.new(key: :additional_parameter,
|
|
188
|
+
description: "Additional flutter build parameters",
|
|
189
|
+
optional: true,
|
|
190
|
+
default_value: ""),
|
|
191
|
+
]
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
def self.description
|
|
195
|
+
"Compiles all defined Flutter flavors for a single platform (:ios, :android, or :web) using the Annai spec configuration"
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
def self.is_supported?(platform)
|
|
199
|
+
[:ios, :android, :web].include?(platform)
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
def self.example_code
|
|
203
|
+
'ann_compile_build_all(
|
|
204
|
+
platform: :android,
|
|
205
|
+
spec_file: "config/my_annai.yaml", # Optional custom spec path
|
|
206
|
+
build_config: "release",
|
|
207
|
+
clean: true,
|
|
208
|
+
flavor: "staging,production" # Optional comma-separated list
|
|
209
|
+
)
|
|
210
|
+
ann_compile_build_all(
|
|
211
|
+
platform: :web,
|
|
212
|
+
sub_command: "web", # Specify the web subcommand
|
|
213
|
+
build_config: "release",
|
|
214
|
+
flavor: "test_web"
|
|
215
|
+
)'
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
end
|