-
Notifications
You must be signed in to change notification settings - Fork 30
/
melos.yaml
349 lines (307 loc) · 10.6 KB
/
melos.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
name: rudder_sdk_flutter_monorepo
repository: https://github.com/rudderlabs/rudder-sdk-flutter
sdkPath: auto
packages:
- .
- packages/plugins/**
- packages/integrations/**
- packages/example
command:
bootstrap:
usePubspecOverrides: true
# It seems so that running "pub get" in parallel has some issues (like
# https://github.com/dart-lang/pub/issues/3404). Disabling this feature
# makes the CI much more stable.
runPubGetInParallel: false
version:
# Only allow versioning to happen on main branch.
# branch: main
# Generate commit links in package changelogs.
linkToCommits: true
# Additionally build a changelog at the root of the workspace.
workspaceChangelog: true
includeScopes: true
message: |
chore(release): release new package versions
{new_package_versions}
scripts:
setup:
run: |
melos clean && \
melos bootstrap && \
dart run tools/setup_git_hooks.dart
description: Prepare monorepo
setup:ci:
run: |
melos clean && \
melos bootstrap
description: Prepare monorepo in CI runners
postclean:
run: |
rm -rf reports && \
melos exec -c 1 --fail-fast -- \
"flutter clean"
description: Run extra clean steps post melos clean lifecycle
analyze:
run: |
melos exec -c 1 -- \
"flutter pub run dart_code_metrics:metrics ."
melos exec -c 1 -- \
"dart analyze . --no-fatal-warnings"
description: |
Run `dart analyze` and Dart Code Metrics in all packages.
- Note: you can also rely on your IDEs Dart Analysis / Issues window.
analyze:ci:
# We are setting the concurrency to 1 because a higher concurrency can crash
# the analysis server on low performance machines (like GitHub Actions).
# TODO: add this
# dart run dart_code_metrics:metrics analyze . --json-path=reports/code.metrics.report.json && /
run: |
mkdir -p reports && /
dart analyze . --no-fatal-warnings --format json > reports/lint.report.json && /
tail -n +2 "reports/lint.report.json" > "reports/lint.report.tmp.json" && mv "reports/lint.report.tmp.json" "reports/lint.report.json"
description: Run `dart analyze` in all packages and output to json file
format:
run: |
dart fix --apply && \
flutter pub run flutter_plugin_tools format && \
flutter format packages && \
swiftformat .
description: |
Run format for all the packages.
- Requires `flutter_plugin_tools` (`dart pub global activate flutter_plugin_tools`).
- Requires `clang-format` (can be installed via Brew on macOS).
- Requires `swiftformat` (can be installed via Brew on macOS).
test:
run: |
melos exec -c 1 --fail-fast -- \
"flutter test --no-pub --machine --coverage > tests.output"
description: Run `flutter test` for a specific package.
select-package:
dir-exists:
- test
# ignore:
# - '*example*'
build:sdk:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/RudderController.dart"
description: Build the SDK plugin.
select-package:
scope: '*rudder_sdk_flutter'
build:sdk:interface:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_sdk_platform.dart"
description: Build the SDK Interface plugin.
select-package:
scope: '*rudder_sdk_flutter_platform_interface*'
build:sdk:android:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_plugin_android.dart"
description: Build the SDK Android plugin.
select-package:
scope: '*rudder_plugin_android*'
build:sdk:ios:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_plugin_ios.dart"
description: Build the SDK iOS plugin.
select-package:
scope: '*rudder_plugin_ios*'
# build:sdk:web:
# run: |
# melos exec -c 1 --fail-fast -- \
# "flutter build bundle --target=lib/rudder_plugin_web.dart"
# description: Build the SDK Web plugin.
# select-package:
# scope: '*rudder_plugin_web*'
build:sdk:db_encryption:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_plugin_db_encryption.dart"
description: Build the DB Encryption plugin.
select-package:
scope: '*rudder_plugin_db_encryption*'
build:integration:adjust:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_integration_adjust_flutter.dart"
description: Build the Adjust integration plugin.
select-package:
scope: '*rudder_integration_adjust_flutter'
build:integration:amplitude:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_integration_amplitude_flutter.dart"
description: Build the Amplitude integration plugin.
select-package:
scope: '*rudder_integration_amplitude_flutter'
build:integration:appcenter:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_integration_appcenter_flutter.dart"
description: Build the AppCenter integration plugin.
select-package:
scope: '*rudder_integration_appcenter_flutter'
build:integration:appsflyer:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_integration_appsflyer_flutter.dart"
description: Build the AppsFlyer integration plugin.
select-package:
scope: '*rudder_integration_appsflyer_flutter'
build:integration:braze:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_integration_braze_flutter.dart"
description: Build the Braze integration plugin.
select-package:
scope: '*rudder_integration_braze_flutter'
build:integration:firebase:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_integration_firebase_flutter.dart"
description: Build the Firebase integration plugin.
select-package:
scope: '*rudder_integration_firebase_flutter'
build:integration:leanplum:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_integration_leanplum_flutter.dart"
description: Build the Leanplum integration plugin.
select-package:
scope: '*rudder_integration_leanplum_flutter'
build:integration:kochava:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build bundle --target=lib/rudder_integration_kochava_flutter.dart"
description: Build the Kochava integration plugin.
select-package:
scope: '*rudder_integration_kochava_flutter'
build:integration:all:
run: |
melos run build:integration:adjust --no-select && \
melos run build:integration:amplitude --no-select && \
melos run build:integration:appcenter --no-select && \
melos run build:integration:braze --no-select && \
melos run build:integration:firebase --no-select && \
melos run build:integration:leanplum --no-select && \
melos run build:integration:kochava --no-select && \
melos bootstrap
description: Build all the integrations.
build:example:android:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build apk --no-pub"
description: Build a specific example app for Android.
select-package:
dir-exists:
- android
scope: '*rudder_sdk_flutter_example*'
build:example:ios:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build ios --no-codesign --no-pub"
description: Build a specific example app for iOS.
select-package:
dir-exists:
- ios
scope: '*rudder_sdk_flutter_example*'
build:example:web:
run: |
melos exec -c 1 --fail-fast -- \
"flutter build web"
description: Build a specific example app for Web.
select-package:
dir-exists:
- web
scope: '*rudder_sdk_flutter_example*'
run:example:android:
run: |
echo no | avdmanager create avd -n Pixel_6_Pro_API_33 -k "system-images;android-33;google_apis;arm64-v8a" --force &&
melos exec -c 1 --fail-fast -- \
"flutter emulators --launch Pixel_6_Pro_API_33"
&& melos exec -c 1 --fail-fast -- \
"flutter run -d Pixel_6_Pro_API_33"
description: Run a specific example app for Android.
select-package:
dir-exists:
- android
scope: '*rudder_sdk_flutter_example*'
run:example:ios:
run: |
melos exec -c 1 --fail-fast -- \
"flutter emulators"
melos exec -c 1 --fail-fast -- \
"flutter emulators --launch apple_ios_simulator"
melos exec -c 1 --fail-fast -- \
"flutter run"
description: Run a specific example app for iOS.
select-package:
dir-exists:
- ios
scope: '*rudder_sdk_flutter_example*'
run:example:web:
run: |
melos exec -c 1 --fail-fast -- \
"flutter run"
description: Run a specific example app for Web.
select-package:
dir-exists:
- web
scope: '*rudder_sdk_flutter_example*'
build:sdk:all:
run: |
melos run build:sdk --no-select && \
melos run build:sdk:interface --no-select && \
melos run build:sdk:android --no-select && \
melos run build:sdk:ios --no-select && \
melos run build:sdk:db_encryption --no-select && \
melos bootstrap
description: Build all SDK bundles.
build:example:all:
run: |
melos run build:example:ios --no-select && \
melos run build:example:android --no-select && \
melos run build:example:web --no-select && \
melos bootstrap
description: Build all example apps.
build:all:
run: |
melos run build:sdk:all --no-select && \
melos run build:integration:all --no-select && \
melos run build:example:all --no-select && \
melos bootstrap
description: Build all.
test:all:
run: |
melos run test --no-select
description: |
Run all tests available.
lint:all:
run: |
melos run analyze && \
melos run format
description: Run all static analysis checks.
qualitycheck:
run: |
melos run setup && \
melos run lint:all && \
melos run test:all && \
melos run build:all
description: Run all targets generally expected in CI for a full local quality check.
doctor:
run: |
melos exec -c 1 --fail-fast -- \
"flutter doctor -v"
description: Run doctor
combine:coverage:
run: |
melos exec -c 1 -- \
"\$MELOS_ROOT_PATH/scripts/combine_coverage.sh"
flutter:upgrade:
run: |
flutter channel stable && \
flutter upgrade