forked from aws-amplify/amplify-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
melos.yaml
357 lines (303 loc) · 12.2 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
name: amplify_flutter_repository
packages:
- packages/**
- example/*
- packages/**/example/*
# Generated output of flutter_localizations
ignore:
- synthetic_package
scripts:
setup_tuneup: >
flutter pub global activate tuneup
copy_dummy_config: >
melos exec --scope="*example*,sample_app" -- \
cp -n "\$MELOS_ROOT_PATH"/.circleci/dummy_amplifyconfiguration.dart lib/amplifyconfiguration.dart | true
build:examples:ios: >
melos exec -c 1 --scope="*example*,sample_app" --ignore="*_android*" --fail-fast -- \
flutter build ios --simulator
build:examples:release:ios: >
melos exec -c 1 --scope="*example*" --ignore="*_android*" --fail-fast -- \
flutter build ios --no-codesign
build:examples:android: >
melos exec -c 1 --scope="*example*,sample_app" --ignore="*_ios*" --fail-fast -- \
flutter build apk --debug --verbose
build:examples:release:android: >
melos exec -c 1 --scope="*example*" --ignore="*_ios*" --fail-fast -- \
flutter build apk --verbose
test:unit:flutter:
run: melos exec -c 1 "flutter test"
description: >
Runs flutter unit tests in all plugins and example apps. Manually run only, not in CI
select-package:
dir-exists: test
test:unit:android:
run: |
melos run test:unit:android:plugin amplify_analytics_pinpoint && \
melos run test:unit:android:plugin amplify_api $PWD && \
melos run test:unit:android:plugin amplify_auth_cognito $PWD && \
melos run test:unit:android:plugin amplify_core $PWD && \
melos run test:unit:android:plugin amplify_datastore $PWD && \
melos run test:unit:android:plugin amplify_flutter $PWD && exit 0
test:unit:ios:
run: |
melos run test:unit:ios:plugin amplify_analytics_pinpoint && \
melos run test:unit:ios:plugin amplify_api $PWD && \
melos run test:unit:ios:plugin amplify_auth_cognito $PWD && \
melos run test:unit:ios:plugin amplify_datastore $PWD && \
melos run test:unit:ios:plugin amplify_flutter $PWD && exit 0
test:unit:flutter:plugin:
run: .circleci/test_all_plugins.sh flutter-test $1 $PWD
test:unit:android:plugin:
run: ./.circleci/test_all_plugins.sh android-test $1 $PWD
test:unit:ios:plugin:
run: ./.circleci/test_all_plugins.sh ios-test $1 $PWD
# ANALYTICS
build:examples:ios:amplify_analytics_pinpoint: >
melos exec -c 1 --scope="amplify_analytics_pinpoint_ios_example" --fail-fast -- \
flutter build ios --simulator
build:examples:android:amplify_analytics_pinpoint: >
melos exec -c 1 --scope="amplify_analytics_pinpoint_android_example" --fail-fast -- \
flutter build apk --debug --verbose
lint:android:amplify_analytics_pinpoint:
run: |
melos exec -c 1 --fail-fast -- \
bash "$PWD/build-support/lint_android.sh"
description: >
Lints Android (Kotlin) files against global rules and fails if there are any errors.
select-package:
scope:
- amplify_analytics_pinpoint_android_example
lint:ios:amplify_analytics_pinpoint:
run: |
export AMPLIFY_FLUTTER_ROOT="$PWD" && \
melos exec -c 1 --fail-fast -- \
bash "$AMPLIFY_FLUTTER_ROOT/build-support/lint_ios.sh"
description: >
Lints iOS (Swift) files against global rules and fails if there are any errors.
select-package:
dir-exists: ios
scope:
- amplify_analytics_pinpoint_ios_example
# API
build:examples:ios:amplify_api: >
melos exec -c 1 --scope="amplify_api_ios_example" --fail-fast -- \
flutter build ios --simulator
build:examples:android:amplify_api: >
melos exec -c 1 --scope="amplify_api_android_example" --fail-fast -- \
flutter build apk --debug --verbose
lint:android:amplify_api:
run: |
melos exec -c 1 --fail-fast -- \
bash "$PWD/build-support/lint_android.sh"
description: >
Lints Android (Kotlin) files against global rules and fails if there are any errors.
select-package:
scope:
- amplify_api_android_example
lint:ios:amplify_api:
run: |
export AMPLIFY_FLUTTER_ROOT="$PWD" && \
melos exec -c 1 --fail-fast -- \
bash "$AMPLIFY_FLUTTER_ROOT/build-support/lint_ios.sh"
description: >
Lints iOS (Swift) files against global rules and fails if there are any errors.
select-package:
dir-exists: ios
scope:
- amplify_api_ios_example
# AUTH
build:examples:ios:amplify_auth_cognito: >
melos exec -c 1 --scope="amplify_auth_cognito_ios_example" --fail-fast -- \
flutter build ios --simulator
build:examples:android:amplify_auth_cognito: >
melos exec -c 1 --scope="amplify_auth_cognito_android_example" --fail-fast -- \
flutter build apk --debug --verbose
lint:android:amplify_auth_cognito:
run: |
melos exec -c 1 --fail-fast -- \
bash "$PWD/build-support/lint_android.sh"
description: >
Lints Android (Kotlin) files against global rules and fails if there are any errors.
select-package:
scope:
- amplify_auth_cognito_android_example
# TODO: LINT COGNITO PLUGIN for iOS
lint:ios:amplify_auth_cognito:
run: echo "amplify_auth_cognito does not conform to iOS lint rules"
# CORE
build:examples:ios:amplify_core: >
melos exec -c 1 --scope="amplify_core_example" --fail-fast -- \
flutter build ios --simulator
build:examples:android:amplify_core: >
melos exec -c 1 --scope="amplify_core_example" --fail-fast -- \
flutter build apk --debug --verbose
lint:android:amplify_core:
run: |
melos exec -c 1 --fail-fast -- \
bash "$PWD/build-support/lint_android.sh"
description: >
Lints Android (Kotlin) files against global rules and fails if there are any errors.
select-package:
scope:
- amplify_core_example
lint:ios:amplify_core:
run: |
export AMPLIFY_FLUTTER_ROOT="$PWD" && \
melos exec -c 1 --fail-fast -- \
bash "$AMPLIFY_FLUTTER_ROOT/build-support/lint_ios.sh"
description: >
Lints iOS (Swift) files against global rules and fails if there are any errors.
select-package:
dir-exists: ios
scope:
- amplify_core_example
# DATASTORE
build:examples:ios:amplify_datastore: >
melos exec -c 1 --scope="amplify_datastore_example" --fail-fast -- \
flutter build ios --simulator
build:examples:android:amplify_datastore: >
melos exec -c 1 --scope="amplify_datastore_example" --fail-fast -- \
flutter build apk --debug --verbose
lint:android:amplify_datastore:
run: |
melos exec -c 1 --fail-fast -- \
bash "$PWD/build-support/lint_android.sh"
description: >
Lints Android (Kotlin) files against global rules and fails if there are any errors.
select-package:
scope:
- amplify_datastore_example
# TODO: LINT DATASTORE PLUGIN for iOS
lint:ios:amplify_datastore:
run: echo "amplify_datastore does not conform to iOS lint rules"
# STORAGE
# NOTE the lint is run against the example in amplify_storage_s3 package
# as amplify_storage_s3_android_example doesn't exist now
lint:android:amplify_storage_s3:
run: |
melos exec -c 1 --fail-fast -- \
bash "$PWD/build-support/lint_android.sh"
description: >
Lints Android (Kotlin) files against global rules and fails if there are any errors.
select-package:
scope:
- amplify_storage_s3_example
# TODO: LINT STORAGE PLUGIN for iOS
lint:ios:amplify_storage_s3:
run: echo "amplify_storage_s3 does not have an iOS example App yet"
# AMPLIFY_FLUTTER
build:examples:ios:amplify_flutter: >
melos exec -c 1 --scope="amplify_flutter_ios_example" --fail-fast -- \
flutter build ios --simulator
build:examples:android:amplify_flutter: >
melos exec -c 1 --scope="amplify_flutter_android_example" --fail-fast -- \
flutter build apk --debug --verbose
lint:android:amplify_flutter:
run: |
melos exec -c 1 --fail-fast -- \
bash "$PWD/build-support/lint_android.sh"
description: >
Lints Android (Kotlin) files against global rules and fails if there are any errors.
select-package:
scope:
- amplify_flutter_android_example
lint:ios:amplify_flutter:
run: |
export AMPLIFY_FLUTTER_ROOT="$PWD" && \
melos exec -c 1 --fail-fast -- \
bash "$AMPLIFY_FLUTTER_ROOT/build-support/lint_ios.sh"
description: >
Lints iOS (Swift) files against global rules and fails if there are any errors.
select-package:
dir-exists: ios
scope:
- amplify_flutter_ios_example
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 -- "$MELOS_ROOT_PATH/build-support/integ_test_android.sh" $@
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
scope: "*example*"
ignore: "*ios_example"
test:integration:ios:
run: melos exec -c 1 -- "$MELOS_ROOT_PATH/build-support/integ_test_ios.sh" $@
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
scope: "*example*"
provision_integration_test_resources:
run: melos exec "./tool/provision_integration_test_resources.sh"
description:
Creates and pushes amplify environments necessary to run integration tests in example apps. Runs only on apps with provision script.
- Requires amplify CLI configured and connected to AWS account.
- Will run `amplify push` within example apps.
select-package:
file-exists:
- tool/provision_integration_test_resources.sh
scope: "*example*"
upload:coverage:ios: >
./build-support/codecov.sh -F ios-unit-tests
upload:coverage:flutter: >
./build-support/codecov.sh -F flutter-unit-tests
upload:coverage:android: >
./build-support/codecov.sh -F android-unit-tests
format: >
melos exec -c 1 -- \
flutter format --dry-run --set-exit-if-changed .
analyze:
run: melos exec -c 1 --fail-fast -- \
flutter analyze --no-fatal-infos
description: >
Analyzes all packages and fails if there are any errors.
select-package:
scope:
- amplify_analytics_*
- amplify_api*
- amplify_flutter*
- amplify_core*
copy_dependencies:
run: |
melos exec -c 1 -- \
cp "\$MELOS_ROOT_PATH"/build-support/dependencies.rb ios
description: Updates the iOS build dependencies for each project
select-package:
scope:
- amplify_analytics_pinpoint
- amplify_api
- amplify_flutter
- amplify_core
lint:pub: >
melos exec -c 5 --fail-fast --no-private --ignore="*example*" -- \
flutter pub publish --dry-run
packages:fix: |
melos exec -- \
flutter analyze --no-fatal-infos --no-fatal-warnings &>/dev/null || true
pod:repo-update:
run: melos exec -c 8 --scope="*example*,sample_app" --ignore="*_android_example" "(cd ios && pod repo update)"
description: runs "pod repo update" in all example apps
pod:update-amplify:
run: melos exec -c 8 --ignore="amplify_core_example" --file-exists="./ios/Podfile.lock" "(cd ios && pod update Amplify AWSPluginsCore AmplifyPlugins)"
description: Update amplify pods in projects with a Podfile.lock
pod:update:
run: melos run pod:repo-update && melos run pod:update-amplify
description: Run "pod repo update" and then updates amplify related pods. Intended for use after amplify iOS version has been updated.
postbootstrap: |
melos run copy_dummy_config && \
melos run packages:fix
postclean: >
melos exec -- \
rm -rf ./build ./android/.gradle ./ios/.symlinks ./ios/Pods ./ios/Podfile.lock
dev_dependencies:
pedantic: ^1.9.0