@@ -71,6 +71,34 @@ commands:
7171 - run :
7272 name : Configure Captain Platform
7373 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+
74102
75103jobs :
76104 danger :
95123 - image : cirrusci/flutter:<<parameters.version>>
96124 steps :
97125 - 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
101128 - run : flutter test --coverage
102129 - run :
103130 working_directory : coverage
@@ -182,7 +209,8 @@ jobs:
182209 - image : cirrusci/flutter
183210 steps :
184211 - checkout
185- - run : flutter pub get
212+ - install_flutter_and_dart_packages :
213+ generate_pigeons : false
186214 - run :
187215 name : Check Format
188216 command : dart format . --set-exit-if-changed
@@ -192,9 +220,8 @@ jobs:
192220 - image : cirrusci/flutter
193221 steps :
194222 - 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
198225 - run :
199226 name : Perform Static Analysis
200227 command : flutter analyze
@@ -204,9 +231,8 @@ jobs:
204231 - image : cirrusci/flutter
205232 steps :
206233 - 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
210236 - run :
211237 name : Check Package Score
212238 command : dart run pana --no-warning --exit-code-threshold 0
0 commit comments