@@ -554,6 +554,80 @@ void main() {
554
554
XcodeProjectInterpreter : () => FakeXcodeProjectInterpreterWithBuildSettings (version: Version (15 , 4 , null )),
555
555
});
556
556
557
+ testUsingContext ('ipa build accepts "enterprise" export method when on Xcode versions <= 15.3' , () async {
558
+ final BuildCommand command = BuildCommand (
559
+ artifacts: artifacts,
560
+ androidSdk: FakeAndroidSdk (),
561
+ buildSystem: TestBuildSystem .all (BuildResult (success: true )),
562
+ logger: logger,
563
+ fileSystem: fileSystem,
564
+ processUtils: processUtils,
565
+ osUtils: FakeOperatingSystemUtils (),
566
+ );
567
+ fakeProcessManager.addCommands (< FakeCommand > [
568
+ xattrCommand,
569
+ setUpFakeXcodeBuildHandler (),
570
+ exportArchiveCommand (exportOptionsPlist: _exportOptionsPlist),
571
+ ]);
572
+ createMinimalMockProjectFiles ();
573
+ await createTestCommandRunner (command).run (
574
+ const < String > ['build' , 'ipa' ,'--export-method' , 'enterprise' , '--no-pub' ]
575
+ );
576
+ expect (logger.statusText, contains ('Building enterprise IPA' ));
577
+ }, overrides: < Type , Generator > {
578
+ FileSystem : () => fileSystem,
579
+ Logger : () => logger,
580
+ ProcessManager : () => fakeProcessManager,
581
+ Platform : () => macosPlatform,
582
+ XcodeProjectInterpreter : () => FakeXcodeProjectInterpreterWithBuildSettings (version: Version (15 , 3 , null )),
583
+ });
584
+
585
+ testUsingContext ('ipa build accepts "enterprise" export method when on Xcode versions > 15.3' , () async {
586
+ final File cachedExportOptionsPlist = fileSystem.file ('/CachedExportOptions.plist' );
587
+ final BuildCommand command = BuildCommand (
588
+ artifacts: artifacts,
589
+ androidSdk: FakeAndroidSdk (),
590
+ buildSystem: TestBuildSystem .all (BuildResult (success: true )),
591
+ logger: logger,
592
+ fileSystem: fileSystem,
593
+ processUtils: processUtils,
594
+ osUtils: FakeOperatingSystemUtils (),
595
+ );
596
+ fakeProcessManager.addCommands (< FakeCommand > [
597
+ xattrCommand,
598
+ setUpFakeXcodeBuildHandler (),
599
+ exportArchiveCommand (exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist),
600
+ ]);
601
+ createMinimalMockProjectFiles ();
602
+ await createTestCommandRunner (command).run (
603
+ const < String > ['build' , 'ipa' ,'--export-method' , 'enterprise' , '--no-pub' ]
604
+ );
605
+
606
+ const String expectedIpaPlistContents = '''
607
+ <?xml version="1.0" encoding="UTF-8"?>
608
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
609
+ <plist version="1.0">
610
+ <dict>
611
+ <key>method</key>
612
+ <string>enterprise</string>
613
+ <key>uploadBitcode</key>
614
+ <false/>
615
+ </dict>
616
+ </plist>
617
+ ''' ;
618
+
619
+ final String actualIpaPlistContents = fileSystem.file (cachedExportOptionsPlist).readAsStringSync ();
620
+
621
+ expect (actualIpaPlistContents, expectedIpaPlistContents);
622
+ expect (logger.statusText, contains ('Building enterprise IPA' ));
623
+ }, overrides: < Type , Generator > {
624
+ FileSystem : () => fileSystem,
625
+ Logger : () => logger,
626
+ ProcessManager : () => fakeProcessManager,
627
+ Platform : () => macosPlatform,
628
+ XcodeProjectInterpreter : () => FakeXcodeProjectInterpreterWithBuildSettings (version: Version (15 , 4 , null )),
629
+ });
630
+
557
631
testUsingContext ('ipa build accepts legacy methods when on Xcode versions <= 15.3' , () async {
558
632
final BuildCommand command = BuildCommand (
559
633
artifacts: artifacts,
0 commit comments