Repository: flutter/flutter
File: packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart (Dart)

Code before:
        <key>uploadBitcode</key>
        <false/>
    </dict>
</plist>
''';

      final String actualIpaPlistContents = fileSystem
          .file(cachedExportOptionsPlist)
          .readAsStringSync();
      expect(actualIpaPlistContents, expectedIpaPlistContents);

      expect(logger.statusText, contains('build/ios/archive/Runner.xcarchive'));
      expect(logger.statusText, contains('Building release-testing IPA'));
      expect(logger.statusText, contains(RegExp(r'Built IPA to build/ios/ipa \(\d+\.\d+MB\)')));
      // Don't instruct how to upload to the App Store.
      expect(logger.statusText, isNot(contains('To upload')));
      expect(fakeProcessManager, hasNoRemainingExpectations);
    },
    overrides: <Type, Generator>{
      FileSystem: () => fileSystem,
      Logger: () => logger,
      ProcessManager: () => fakeProcessManager,
      Pub: ThrowingPub.new,
      Platform: () => macosPlatform,
      XcodeProjectInterpreter: () =>
          FakeXcodeProjectInterpreterWithBuildSettings(version: Version(16, null, null)),
      Artifacts: () => Artifacts.test(),
    },
  );

  testUsingContext(
    'ipa build invokes xcodebuild and archives for enterprise distribution',
    () async {
      final File cachedExportOptionsPlist = fileSystem.file('/CachedExportOptions.plist');
      final command = BuildCommand(
        androidSdk: FakeAndroidSdk(),
        buildSystem: TestBuildSystem.all(BuildResult(success: true)),
        logger: logger,
        fileSystem: fileSystem,
        osUtils: FakeOperatingSystemUtils(),
      );
      fakeProcessManager.addCommands(<FakeCommand>[
        xattrCommand,
        setUpFakeXcodeBuildHandler(),
        exportArchiveCommand(
          exportOptionsPlist: _exportOptionsPlist,
          cachePlist: cachedExportOptionsPlist,
        ),
      ]);
      createMinimalMockProjectFiles();


Review comment (suggestion):
```suggestion
          XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
```

Looks like this test is specifically testing the `ad-hoc` method is used. The opposite is already tested in `ipa build uses new "release-testing" export method when on Xcode versions > 15.3`.

Code after:
    </dict>
</plist>
''';

      final String actualIpaPlistContents = fileSystem
          .file(cachedExportOptionsPlist)
          .readAsStringSync();
      expect(actualIpaPlistContents, expectedIpaPlistContents);

      expect(logger.statusText, contains('build/ios/archive/Runner.xcarchive'));
      expect(logger.statusText, contains('Building ad-hoc IPA'));
      expect(logger.statusText, contains(RegExp(r'Built IPA to build/ios/ipa \(\d+\.\d+MB\)')));
      // Don't instruct how to upload to the App Store.
      expect(logger.statusText, isNot(contains('To upload')));
      expect(fakeProcessManager, hasNoRemainingExpectations);
    },
    overrides: <Type, Generator>{
      FileSystem: () => fileSystem,
      Logger: () => logger,
      ProcessManager: () => fakeProcessManager,
      Pub: ThrowingPub.new,
      Platform: () => macosPlatform,
      XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(),
      Artifacts: () => Artifacts.test(),
    },
  );

  testUsingContext(
    'ipa build invokes xcodebuild and archives for enterprise distribution',
    () async {
      final File cachedExportOptionsPlist = fileSystem.file('/CachedExportOptions.plist');
      final command = BuildCommand(
        androidSdk: FakeAndroidSdk(),
        buildSystem: TestBuildSystem.all(BuildResult(success: true)),
        logger: logger,
        fileSystem: fileSystem,
        osUtils: FakeOperatingSystemUtils(),
      );
      fakeProcessManager.addCommands(<FakeCommand>[
        xattrCommand,
        setUpFakeXcodeBuildHandler(),
        exportArchiveCommand(
          exportOptionsPlist: _exportOptionsPlist,
          cachePlist: cachedExportOptionsPlist,
        ),
      ]);
      createMinimalMockProjectFiles();

      await createTestCommandRunner(
        command,
      ).run(const <String>['build', 'ipa', '--no-pub', '--export-method', 'enterprise']);