Fix flutter build ipa --export-method
not accepting enterprise
flag (#153047)
When implementing the fix for https://github.com/flutter/flutter/issues/149369, I missed accounting for the `enterprise` flag for `flutter build ipa` ð¬ Fixes https://github.com/flutter/flutter/issues/153000
This commit is contained in:
parent
b6cd31e6b5
commit
51606f99a4
@ -599,8 +599,6 @@ class BuildIOSArchiveCommand extends _BuildIOSSubCommand {
|
||||
return 'release-testing';
|
||||
case 'development':
|
||||
return 'debugging';
|
||||
default:
|
||||
throwToolExit('Encountered invalid export-method input.');
|
||||
}
|
||||
}
|
||||
return method;
|
||||
|
@ -554,6 +554,80 @@ void main() {
|
||||
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(version: Version(15, 4, null)),
|
||||
});
|
||||
|
||||
testUsingContext('ipa build accepts "enterprise" export method when on Xcode versions <= 15.3', () async {
|
||||
final BuildCommand command = BuildCommand(
|
||||
artifacts: artifacts,
|
||||
androidSdk: FakeAndroidSdk(),
|
||||
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
|
||||
logger: logger,
|
||||
fileSystem: fileSystem,
|
||||
processUtils: processUtils,
|
||||
osUtils: FakeOperatingSystemUtils(),
|
||||
);
|
||||
fakeProcessManager.addCommands(<FakeCommand>[
|
||||
xattrCommand,
|
||||
setUpFakeXcodeBuildHandler(),
|
||||
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist),
|
||||
]);
|
||||
createMinimalMockProjectFiles();
|
||||
await createTestCommandRunner(command).run(
|
||||
const <String>['build', 'ipa','--export-method', 'enterprise', '--no-pub']
|
||||
);
|
||||
expect(logger.statusText, contains('Building enterprise IPA'));
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
Logger: () => logger,
|
||||
ProcessManager: () => fakeProcessManager,
|
||||
Platform: () => macosPlatform,
|
||||
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(version: Version(15, 3, null)),
|
||||
});
|
||||
|
||||
testUsingContext('ipa build accepts "enterprise" export method when on Xcode versions > 15.3', () async {
|
||||
final File cachedExportOptionsPlist = fileSystem.file('/CachedExportOptions.plist');
|
||||
final BuildCommand command = BuildCommand(
|
||||
artifacts: artifacts,
|
||||
androidSdk: FakeAndroidSdk(),
|
||||
buildSystem: TestBuildSystem.all(BuildResult(success: true)),
|
||||
logger: logger,
|
||||
fileSystem: fileSystem,
|
||||
processUtils: processUtils,
|
||||
osUtils: FakeOperatingSystemUtils(),
|
||||
);
|
||||
fakeProcessManager.addCommands(<FakeCommand>[
|
||||
xattrCommand,
|
||||
setUpFakeXcodeBuildHandler(),
|
||||
exportArchiveCommand(exportOptionsPlist: _exportOptionsPlist, cachePlist: cachedExportOptionsPlist),
|
||||
]);
|
||||
createMinimalMockProjectFiles();
|
||||
await createTestCommandRunner(command).run(
|
||||
const <String>['build', 'ipa','--export-method', 'enterprise', '--no-pub']
|
||||
);
|
||||
|
||||
const String expectedIpaPlistContents = '''
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>method</key>
|
||||
<string>enterprise</string>
|
||||
<key>uploadBitcode</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
''';
|
||||
|
||||
final String actualIpaPlistContents = fileSystem.file(cachedExportOptionsPlist).readAsStringSync();
|
||||
|
||||
expect(actualIpaPlistContents, expectedIpaPlistContents);
|
||||
expect(logger.statusText, contains('Building enterprise IPA'));
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fileSystem,
|
||||
Logger: () => logger,
|
||||
ProcessManager: () => fakeProcessManager,
|
||||
Platform: () => macosPlatform,
|
||||
XcodeProjectInterpreter: () => FakeXcodeProjectInterpreterWithBuildSettings(version: Version(15, 4, null)),
|
||||
});
|
||||
|
||||
testUsingContext('ipa build accepts legacy methods when on Xcode versions <= 15.3', () async {
|
||||
final BuildCommand command = BuildCommand(
|
||||
artifacts: artifacts,
|
||||
|
Loading…
x
Reference in New Issue
Block a user