@@ -164,6 +164,53 @@ void main() {
164
164
]));
165
165
});
166
166
167
+ test ('building for iOS with CocoaPods on master channel' , () async {
168
+ mockPlatform.isMacOS = true ;
169
+ mockPlatform.environment['CHANNEL' ] = 'master' ;
170
+
171
+ final RepositoryPackage plugin = createFakePlugin ('plugin' , packagesDir,
172
+ platformSupport: < String , PlatformDetails > {
173
+ platformIOS: const PlatformDetails (PlatformSupport .inline),
174
+ });
175
+
176
+ final Directory pluginExampleDirectory = getExampleDir (plugin);
177
+
178
+ final List <String > output = await runCapturingPrint (runner, < String > [
179
+ 'build-examples' ,
180
+ '--ios' ,
181
+ '--enable-experiment=exp1' ,
182
+ '--no-swift-package-manager' ,
183
+ ]);
184
+
185
+ expect (
186
+ output,
187
+ containsAllInOrder (< String > [
188
+ '\n BUILDING plugin/example for iOS' ,
189
+ ]),
190
+ );
191
+
192
+ expect (
193
+ processRunner.recordedCalls,
194
+ orderedEquals (< ProcessCall > [
195
+ ProcessCall (
196
+ getFlutterCommand (mockPlatform),
197
+ const < String > ['config' , '--no-enable-swift-package-manager' ],
198
+ null ,
199
+ ),
200
+ ProcessCall (
201
+ getFlutterCommand (mockPlatform),
202
+ const < String > [
203
+ 'build' ,
204
+ 'ios' ,
205
+ '--no-codesign' ,
206
+ '--enable-experiment=exp1'
207
+ ],
208
+ pluginExampleDirectory.path,
209
+ ),
210
+ ]),
211
+ );
212
+ });
213
+
167
214
test ('building for iOS with Swift Package Manager on master channel' ,
168
215
() async {
169
216
mockPlatform.isMacOS = true ;
@@ -212,6 +259,50 @@ void main() {
212
259
);
213
260
});
214
261
262
+ test (
263
+ 'building for iOS with CocoaPods on stable channel does not disable SPM' ,
264
+ () async {
265
+ mockPlatform.isMacOS = true ;
266
+ mockPlatform.environment['CHANNEL' ] = 'stable' ;
267
+
268
+ final RepositoryPackage plugin = createFakePlugin ('plugin' , packagesDir,
269
+ platformSupport: < String , PlatformDetails > {
270
+ platformIOS: const PlatformDetails (PlatformSupport .inline),
271
+ });
272
+
273
+ final Directory pluginExampleDirectory = getExampleDir (plugin);
274
+
275
+ final List <String > output = await runCapturingPrint (runner, < String > [
276
+ 'build-examples' ,
277
+ '--ios' ,
278
+ '--enable-experiment=exp1' ,
279
+ '--no-swift-package-manager' ,
280
+ ]);
281
+
282
+ expect (
283
+ output,
284
+ containsAllInOrder (< String > [
285
+ '\n BUILDING plugin/example for iOS' ,
286
+ ]),
287
+ );
288
+
289
+ expect (
290
+ processRunner.recordedCalls,
291
+ orderedEquals (< ProcessCall > [
292
+ ProcessCall (
293
+ getFlutterCommand (mockPlatform),
294
+ const < String > [
295
+ 'build' ,
296
+ 'ios' ,
297
+ '--no-codesign' ,
298
+ '--enable-experiment=exp1'
299
+ ],
300
+ pluginExampleDirectory.path,
301
+ ),
302
+ ]),
303
+ );
304
+ });
305
+
215
306
test (
216
307
'building for iOS with Swift Package Manager on stable channel does not enable SPM' ,
217
308
() async {
@@ -353,6 +444,48 @@ void main() {
353
444
]));
354
445
});
355
446
447
+ test ('building for macOS with CocoaPods on master channel' , () async {
448
+ mockPlatform.isMacOS = true ;
449
+ mockPlatform.environment['CHANNEL' ] = 'master' ;
450
+
451
+ final RepositoryPackage plugin = createFakePlugin ('plugin' , packagesDir,
452
+ platformSupport: < String , PlatformDetails > {
453
+ platformMacOS: const PlatformDetails (PlatformSupport .inline),
454
+ });
455
+
456
+ final Directory pluginExampleDirectory = getExampleDir (plugin);
457
+
458
+ final List <String > output = await runCapturingPrint (runner,
459
+ < String > ['build-examples' , '--macos' , '--no-swift-package-manager' ]);
460
+
461
+ expect (
462
+ output,
463
+ containsAllInOrder (< String > [
464
+ '\n BUILDING plugin/example for macOS' ,
465
+ ]),
466
+ );
467
+
468
+ expect (
469
+ processRunner.recordedCalls,
470
+ orderedEquals (< ProcessCall > [
471
+ ProcessCall (
472
+ getFlutterCommand (mockPlatform),
473
+ const < String > ['config' , '--no-enable-swift-package-manager' ],
474
+ null ,
475
+ ),
476
+ ProcessCall (
477
+ getFlutterCommand (mockPlatform),
478
+ const < String > [
479
+ 'build' ,
480
+ 'macos' ,
481
+ ],
482
+ pluginExampleDirectory.path,
483
+ ),
484
+ ]),
485
+ );
486
+ });
487
+
488
+
356
489
test ('building for macOS with Swift Package Manager on master channel' ,
357
490
() async {
358
491
mockPlatform.isMacOS = true ;
@@ -395,6 +528,44 @@ void main() {
395
528
);
396
529
});
397
530
531
+ test (
532
+ 'building for macOS with CocoaPods on stable channel does not disable SPM' ,
533
+ () async {
534
+ mockPlatform.isMacOS = true ;
535
+ mockPlatform.environment['CHANNEL' ] = 'stable' ;
536
+
537
+ final RepositoryPackage plugin = createFakePlugin ('plugin' , packagesDir,
538
+ platformSupport: < String , PlatformDetails > {
539
+ platformMacOS: const PlatformDetails (PlatformSupport .inline),
540
+ });
541
+
542
+ final Directory pluginExampleDirectory = getExampleDir (plugin);
543
+
544
+ final List <String > output = await runCapturingPrint (runner,
545
+ < String > ['build-examples' , '--macos' , '--no-swift-package-manager' ]);
546
+
547
+ expect (
548
+ output,
549
+ containsAllInOrder (< String > [
550
+ '\n BUILDING plugin/example for macOS' ,
551
+ ]),
552
+ );
553
+
554
+ expect (
555
+ processRunner.recordedCalls,
556
+ orderedEquals (< ProcessCall > [
557
+ ProcessCall (
558
+ getFlutterCommand (mockPlatform),
559
+ const < String > [
560
+ 'build' ,
561
+ 'macos' ,
562
+ ],
563
+ pluginExampleDirectory.path,
564
+ ),
565
+ ]),
566
+ );
567
+ });
568
+
398
569
test (
399
570
'building for macOS with Swift Package Manager on stable channel does not enable SPM' ,
400
571
() async {
0 commit comments