@@ -71,6 +71,34 @@ commands:
71
71
- run :
72
72
name : Configure Captain Platform
73
73
command : echo 'export CAPTAIN_PLATFORM=<<parameters.platform>>' >> $BASH_ENV
74
+ # This runs `flutter pub get` and `dart pub get` if we pass parameter `generate_pigeons` to the job it also runs the following:
75
+ # - `sh ./scripts/pigeon.sh`
76
+ # - `dart run build_runner build --delete-conflicting-outputs`
77
+ install_flutter_and_dart_packages :
78
+ parameters :
79
+ generate_pigeons :
80
+ type : boolean
81
+ steps :
82
+ - run :
83
+ name : Install Flutter Packages
84
+ command : flutter pub get
85
+ - run :
86
+ name : Install Dart Packages
87
+ command : dart pub get
88
+ description : Install Dart Packages (for dart explicit packages)
89
+ - when :
90
+ condition :
91
+ equal :
92
+ - <<parameters.generate_pigeons>>
93
+ - true
94
+ steps :
95
+ - run :
96
+ name : Generate Pigeons
97
+ command : sh ./scripts/pigeon.sh
98
+ - run :
99
+ name : Build Pigeons
100
+ command : dart run build_runner build --delete-conflicting-outputs
101
+
74
102
75
103
jobs :
76
104
danger :
95
123
- image : cirrusci/flutter:<<parameters.version>>
96
124
steps :
97
125
- checkout
98
- - run : flutter pub get
99
- - run : sh ./scripts/pigeon.sh
100
- - run : dart run build_runner build --delete-conflicting-outputs
126
+ - install_flutter_and_dart_packages :
127
+ generate_pigeons : true
101
128
- run : flutter test --coverage
102
129
- run :
103
130
working_directory : coverage
@@ -182,7 +209,8 @@ jobs:
182
209
- image : cirrusci/flutter
183
210
steps :
184
211
- checkout
185
- - run : flutter pub get
212
+ - install_flutter_and_dart_packages :
213
+ generate_pigeons : false
186
214
- run :
187
215
name : Check Format
188
216
command : dart format . --set-exit-if-changed
@@ -192,9 +220,8 @@ jobs:
192
220
- image : cirrusci/flutter
193
221
steps :
194
222
- checkout
195
- - run : flutter pub get
196
- - run : sh ./scripts/pigeon.sh
197
- - run : dart run build_runner build --delete-conflicting-outputs
223
+ - install_flutter_and_dart_packages :
224
+ generate_pigeons : true
198
225
- run :
199
226
name : Perform Static Analysis
200
227
command : flutter analyze
@@ -204,9 +231,8 @@ jobs:
204
231
- image : cirrusci/flutter
205
232
steps :
206
233
- checkout
207
- - run : flutter pub get
208
- - run : sh ./scripts/pigeon.sh
209
- - run : dart run build_runner build --delete-conflicting-outputs
234
+ - install_flutter_and_dart_packages :
235
+ generate_pigeons : true
210
236
- run :
211
237
name : Check Package Score
212
238
command : dart run pana --no-warning --exit-code-threshold 0
0 commit comments