-
Notifications
You must be signed in to change notification settings - Fork 19
/
melos.yaml
610 lines (531 loc) · 20.8 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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
name: Fediverse
packages:
- packages/**
scripts:
tuneup:init:
run: |
flutter pub global activate tuneup
description: |
Activate tuneup tool
tuneup:check:
run: |
flutter pub global run melos exec -c 1 --fail-fast --ignore="*example*" -- \
flutter pub global run tuneup check
description: |
Quickly checks for dart analyzing errors
tuneup:stats:
run: |
flutter pub global run melos exec --ignore="*example*" -- \
flutter pub global run tuneup stats
description: |
Display packages code/fiels stats
analyze:
run: |
flutter pub global run melos exec -c 1 --ignore="*example*" -- \
flutter analyze --fatal-infos .
description: |
Format code all lints from analysis_options.yaml
analyze:find_unused_files:
run: |
flutter pub global run melos exec -c 1 --ignore="*example*" -- \
flutter pub run dart_code_metrics:metrics check-unused-files lib
description: |
Find all unused files
format:
run: |
flutter pub global run melos exec -c 5 --ignore="*example*" -- \
flutter format .
description: |
Format code
format:check:
run: |
flutter pub global run melos exec -c 5 --ignore="*example*" -- \
flutter format --set-exit-if-changed --dry-run .
description: |
Check is code properly formatted
build:release:
run: |
flutter pub global run melos run --no-select build:android:appbundle:prod && \
flutter pub global run melos run --no-select build:ios:release:prod
description: |
Build prod Flavor: Android AppBundle & iOS IPA
select-package:
scope: "*_app"
build:ios:release:dev:
run: |
flutter pub global run melos exec -c 1 -- \
flutter build ios --simulator --flavor dev
description: |
Build ios for simulator. Flavor: dev
select-package:
scope: "*_app"
build:ios:release:prod:
run: |
flutter pub global run melos exec -c 1 -- \
flutter build ios --simulator --flavor prod
description: |
Build ios for simulator. Flavor: prod
select-package:
scope: "*_app"
build:ios:simulator:dev:
run: |
flutter pub global run melos exec -c 1 -- \
flutter build ios --simulator --flavor dev
description: |
Build ios for simulator. Flavor: dev
select-package:
scope: "*_app"
build:ios:simulator:prod:
run: |
flutter pub global run melos exec -c 1 -- \
flutter build ios --simulator --flavor prod
description: |
Build ios for simulator. Flavor: prod
select-package:
scope: "*_app"
build:android:appbundle:dev:
run: |
flutter pub global run melos exec -c 1 -- \
flutter build appbundle --flavor dev
description: |
Build Android appbundle. Flavor: dev
select-package:
scope: "*_app"
build:android:appbundle:prod:
run: |
flutter pub global run melos exec -c 1 -- \
flutter build appbundle --flavor prod
description: |
Build Android appbundle. Flavor: prod
select-package:
scope: "*_app"
build:android:appbundle:bundletool:init:
run: |
wget https://github.com/google/bundletool/releases/download/1.8.1/bundletool-all-1.8.1.jar && \
mv bundletool-all-1.8.1.jar bundletool-all.jar
description: |
Download bundletool
build:android:appbundle:prod:build_apks:
run: |
flutter pub global run melos exec -c 1 -- \
java -jar ../../bundletool-all.jar build-apks --overwrite --bundle=build/app/outputs/bundle/prodRelease/app-prod-release.aab --output=build/app/outputs/bundle/prodRelease/app-prod-release.apks
description: |
Build apks after appbundle:prod
select-package:
file-exists:
- build/app/outputs/bundle/prodRelease/app-prod-release.aab
build:android:appbundle:prod:install_apks:
run: |
flutter pub global run melos exec -c 1 -- \
java -jar ../../bundletool-all.jar install-apks --apks=build/app/outputs/bundle/prodRelease/app-prod-release.apks
description: |
Install apks after prod:build_apks to connected devices
select-package:
file-exists:
- build/app/outputs/bundle/prodRelease/app-prod-release.apks
build:android:appbundle:dev:build_apks:
run: |
flutter pub global run melos exec -c 1 -- \
java -jar ../../bundletool-all.jar build-apks --overwrite --bundle=build/app/outputs/bundle/devRelease/app-dev-release.aab --output=build/app/outputs/bundle/devRelease/app-dev-release.apks
description: |
Build apks after appbundle:dev
select-package:
file-exists:
- build/app/outputs/bundle/devRelease/app-dev-release.aab
build:android:appbundle:dev:install_apks:
run: |
flutter pub global run melos exec -c 1 -- \
java -jar ../../bundletool-all.jar install-apks --apks=build/app/outputs/bundle/devRelease/app-dev-release.apks
description: |
Install apks after dev:build_apks to connected devices
select-package:
file-exists:
- build/app/outputs/bundle/devRelease/app-dev-release.apks
build:android:apk:dev:
run: |
flutter pub global run melos exec -c 1 -- \
flutter build apk --split-per-abi --flavor dev
description: |
Build Android Apk --split-per-abi. Flavor: dev
select-package:
scope: "*_app"
build:android:apk:prod:
run: |
flutter pub global run melos exec -c 1 -- \
flutter build apk --split-per-abi --flavor prod
description: |
Build Android Apk --split-per-abi. Flavor: prod
select-package:
scope: "*_app"
generate:
run: |
flutter pub global run melos run generate:intl --no-select && \
flutter pub global run melos run generate:build_runner --no-select
description: |
Build all generated files
generate:intl:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
flutter pub global run intl_utils:generate
description: Generate code for localization
select-package:
dir-exists: lib/l10n
generate:build_runner:
run: |
flutter pub global run melos exec -c 1 --fail-fast --depends-on="build_runner" -- \
"flutter pub run build_runner build --delete-conflicting-outputs"
description: Generate all code via build_runner tasks(moor, freezed, json, etc)
test:unit:
run: flutter pub global run melos exec -c 1 --fail-fast -- \
flutter test
description: Run Flutter tests for a specific package in this project.
select-package:
dir-exists: test
test:unit:coverage:
run: |
flutter pub global run melos exec -c 1 --fail-fast flutter test --coverage && \
flutter pub global run melos run --no-select test:coverage:remove_unnecessary
description: |
Run Flutter tests with coverage for a specific package in this project.
select-package:
dir-exists: test
test:unit:coverage:full:
run: |
flutter pub global run melos run --no-select test:coverage:generate_helper && \
flutter pub global run melos run --no-select test:unit:coverage
description: |
Run Flutter tests with coverage for a specific package in this project with hack for full coverage
select-package:
dir-exists: test
test:unit:coverage:helper:
run: |
flutter pub global run melos run --no-select test:coverage:generate_helper && \
flutter pub global run melos exec -- \
flutter test --coverage --no-pub test/coverage_helper_test.dart && \
flutter pub global run melos run --no-select test:coverage:remove_unnecessary
description: |
Run only coverage helper Flutter tests
select-package:
dir-exists: test
test:coverage:init:
run: |
flutter pub global activate remove_from_coverage
description: Init coverage tools
test:coverage:remove_unnecessary:
run: |
flutter pub global run melos exec -c 5 --fail-fast -- \
"flutter pub global run remove_from_coverage:remove_from_coverage -f coverage/lcov.info -r '\.g\.dart$' -r '\.freezed\.dart$' -r 'mock_helper\.dart$'"
description: |
Removes all the unnecessary(generated, mock, etc) files from the coverage report.
select-package:
dir-exists: coverage
test:coverage:generate_helper:
run: |
flutter pub global run melos exec -c 5 --fail-fast -- \
$MELOS_ROOT_PATH/tools/coverage_generate_helper.sh
description: Generate file to get full coverage report.
select-package:
dir-exists: test
test:integration:
run: |
melos run test:integration:android --no-select && \
melos run test:integration:ios --no-select
description: |
Run all integration tests for all package example apps on Android and iOS simulators. Skips if no tests available.
- Requires running Android and iOS simulators.
test:integration:android:
run: |
melos exec -c 1 --fail-fast -- \
flutter drive --no-pub --driver=test_driver/integration_test.dart --target=integration_test/main_test.dart -d sdk
description: |
Run integration tests for a single package on an Android emulator.
- Run with `--no-select` to run for all applicable packages.
- Requires launching an Android emulator prior to execution.
select-package:
file-exists:
- integration_test/main_test.dart
test:integration:ios:
run: |
melos exec -c 1 --fail-fast -- \
flutter drive --no-pub --driver=test_driver/integration_test.dart --target=integration_test/main_test.dart -d iPhone
description: |
Run integration tests for a single package on an iOS simulator.
- Run with `--no-select` to run for all applicable packages.
- Requires launching an iOS simulator prior to execution.
select-package:
file-exists:
- integration_test/main_test.dart
clean:
run: |
flutter pub global run melos run clean:flutter --no-select && \
flutter pub global run melos run clean:build --no-select && \
flutter pub global run melos run clean:android --no-select && \
flutter pub global run melos run clean:ios --no-select
description: |
Clear all possible things
clean:flutter:
run: |
flutter pub global run melos exec -c 1 flutter clean
description: |
Base flutter clean
clean:build:
run: |
flutter pub global run melos exec -c 5 --fail-fast -- \
rm -rf ./build
description: |
Delete build folder
clean:ios:
run: flutter pub global run melos exec -c 5 --fail-fast -- \
rm -rf /ios/.symlinks ./ios/Pods ./ios/Podfile.lock
description: |
Clean ios Pods
clean:android:
run: |
flutter pub global run melos exec -c 5 --fail-fast -- \
rm -rf ./android/.gradle
description: |
Clean android gradle
test:driver:screenshots:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
flutter driver --no-pub --target=test_driver/screenshots.dart --flavor fluttertest
description: Run test driver to iterate over screens used for screenshots as test(dev purpose)
select-package:
dir-exists: test_driver
file-exist: test_driver/screenshots.dart
screenshots:init:
run: |
flutter pub global activate -sgit https://github.com/xal/screenshots.git
# flutter pub global activate --source path ../screenshots
description: Activate required version of screenshots tool
select-package:
dir-exists: test_driver
screenshots:make:dev:
run: |
flutter pub global run melos exec -c 1 --fail-fast --depends-on="screenshots" -- \
flutter pub global run screenshots:main --flavor fluttertest -b false --config=screenshots_dev.yaml
description: Run screenshots tool to generate screenshots via screenshots_dev.yaml config (dev purposes)
select-package:
dir-exists:
- test_driver
file-exists:
- screenshots_dev.yaml
- test_driver/screenshots.dart
screenshots:
run: |
melos run screenshots:make --no-select && \
melos run screenshots:cleanup --no-select
description: Run screenshots tool to generate screenshots on all platforms & cleanUp
screenshots:make:
run: |
melos run screenshots:make:android --no-select && \
melos run screenshots:make:ios --no-select
description: Run screenshots tool to generate screenshots on all platforms
screenshots:make:android:
run: |
flutter pub global run melos exec -c 1 --fail-fast --depends-on="screenshots" -- \
flutter pub global run screenshots:main --flavor fluttertest -b false --config=screenshots_android.yaml
description: Run screenshots tool to generate screenshots via screenshots_android.yaml config
select-package:
dir-exists:
- test_driver
file-exists:
- screenshots_android.yaml
- test_driver/screenshots.dart
screenshots:make:ios:
run: |
flutter pub global run melos exec -c 1 --fail-fast --depends-on="screenshots" -- \
flutter pub global run screenshots:main --flavor fluttertest -b false --config=screenshots_ios.yaml
description: Run screenshots tool to generate screenshots via screenshots_ios.yaml config
select-package:
dir-exists:
- test_driver
file-exists:
- screenshots_ios.yaml
- test_driver/screenshots.dart
screenshots:cleanup:
run: |
melos run screenshots:cleanup:android --no-select && \
melos run screenshots:cleanup:ios --no-select
description: Remove unnecessary screenshots files which block frameit step on all platforms
screenshots:cleanup:android:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_ios.sh -- \
find android/fastlane/metadata/android -type d -name "unframed_images" -exec rm -rf {} \;
description: Remove unnecessary screenshots files which block frameit step for android
select-package:
dir-exists: android/fastlane/metadata/android
screenshots:cleanup:ios:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_ios.sh -- \
rm -rf ./ios/fastlane/unframed_screenshots
description: Remove unnecessary screenshots files which block frameit step for ios
select-package:
dir-exists: ios/fastlane/unframed_screenshots
fastlane:init:
run: |
melos run fastlane:init:android --no-select && \
melos run fastlane:init:ios --no-select
description: Exec bundle for fastlane tools on all platforms
fastlane:init:android:
run: |
flutter pub global run melos exec -c 1 -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_android.sh -- \
bundle install
description: Exec bundle for fastlane tools in android folder
select-package:
dir-exists: android/fastlane
fastlane:init:ios:
run: |
flutter pub global run melos exec -c 1 -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_ios.sh -- \
bundle install
description: Exec bundle for fastlane tools in ios folder
select-package:
dir-exists: ios/fastlane
fastlane:frameit:
run: |
melos run fastlane:frameit:make --no-select && \
melos run fastlane:frameit:cleanup --no-select
description: Exec fastlane frameit for screenshots on all platforms & clean up
fastlane:frameit:make:
run: |
melos run fastlane:frameit:make:android --no-select && \
melos run fastlane:frameit:make:ios --no-select
description: Exec fastlane frameit for screenshots on all platforms
fastlane:frameit:make:android:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_android.sh -- \
bundle exec fastlane screenshots_frameit
description: Exec fastlane frameit for screenshots on android
select-package:
file-exists: android/fastlane/metadata/android/Framefile.json
fastlane:frameit:make:ios:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_ios.sh -- \
bundle exec fastlane screenshots_frameit
description: Exec fastlane frameit for screenshots on ios
select-package:
file-exists: ios/fastlane/screenshots/Framefile.json
fastlane:frameit:cleanup:
run: |
melos run fastlane:frameit:cleanup:android --no-select && \
melos run fastlane:frameit:cleanup:ios --no-select
description: Remove unnecessary frameit screenshots files which block uploading metadata to stores
fastlane:frameit:cleanup:android:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_android.sh -- \
find ./ -type f -name "*.png" ! -name '*framed*' -exec rm -rf {} \;
description: Remove unnecessary frameit screenshots files which block uploading metadata to PlayStore
select-package:
dir-exists: android/fastlane
fastlane:frameit:cleanup:ios:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_ios.sh -- \
find ./ -type f -name "*.png" ! -name '*framed*' -exec rm -rf {} \;
description: Remove unnecessary frameit screenshots files which block uploading metadata to AppStore
select-package:
dir-exists: ios/fastlane
fastlane:frameit:metadata:
run: |
melos run fastlane:frameit:metadata:text --no-select && \
melos run fastlane:frameit:metadata:screenshtos --no-select
description: Upload all metadata to stores
fastlane:frameit:metadata:text:
run: |
melos run fastlane:frameit:metadata:text:android --no-select && \
melos run fastlane:frameit:metadata:text:ios --no-select
description: Upload text metadata to stores
fastlane:metadata:text:android:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_ios.sh -- \
bundle exec fastlane update_metadata
description: Upload text metadata to PlayStore
select-package:
dir-exists: ios/fastlane
fastlane:metadata:text:ios:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_android.sh -- \
bundle exec fastlane update_metadata
description: Upload text metadata to AppStore
select-package:
dir-exists: ios/fastlane
fastlane:frameit:metadata:screenshots:
run: |
melos run fastlane:frameit:metadata:screenshots:android --no-select && \
melos run fastlane:frameit:metadata:screenshots:ios --no-select
description: Upload screenshots metadata to stores
fastlane:metadata:screenshots:android:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_android.sh -- \
bundle exec fastlane update_screenshots
description: Upload screenshots metadata to PlayStore
select-package:
dir-exists: ios/fastlane
fastlane:metadata:screenshots:ios:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
$MELOS_ROOT_PATH/tools/fastlane_dir_exec_ios.sh -- \
bundle exec fastlane update_screenshots
description: Upload screenshots metadata to AppStore
select-package:
dir-exists: ios/fastlane
pub:packages:cache:upgrade:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
flutter packages upgrade
description: |
Update packages cache to update git dependencies.
Don't forget to increase version number in updated packages
pub:get:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
flutter pub get
description: |
Usually you want to use melos bootstrap.
Workaround to run build_runner(requires pub get)
pub:upgrade:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
flutter pub upgrade
description: |
Automatically upgrade package versions
pub:outdated:
run: |
flutter pub global run melos exec -c 1 --fail-fast -- \
flutter pub outdated
description: |
Checks new versions to update
build:examples:ios:
run: flutter pub global run melos exec -c 4 --fail-fast --scope="*example*,sample_app" -- \
flutter build ios --simulator
build:examples:release:ios:
run: flutter pub global run melos exec -c 4 --fail-fast --scope="*example*,sample_app" -- \
flutter build ios --no-codesign
build:examples:android:
run: flutter pub global run melos exec -c 4 --fail-fast --scope="*example*,sample_app" -- \
flutter build apk --debug --verbose
build:examples:release:android:
run: flutter pub global run melos exec -c 4 --fail-fast --scope="*example*,sample_app" -- \
flutter build apk --verbose
pub:publish:dry-run:
run: |
flutter pub global run melos exec -c 5 --no-private -- \
pub publish --dry-run
description: |
Dry-run publish packages to pub dev
pub:publish:
run: |
flutter pub global run melos exec -c 5 --no-private -- \
pub publish
description: |
Publish packages to pub dev