Add deprecation warning for "flutter create --ios-language" (#155867)
The Objective-C `flutter create --ios-language objc` template will be removed in https://github.com/flutter/flutter/issues/148586. Add a deprecation warning when this flag is passed. Add an additional warning when Objective-C is specified requesting the user's use-case. Do not show the warning when creating the module, as Swift is not supported for it yet https://github.com/flutter/flutter/issues/23955  Part of https://github.com/flutter/flutter/issues/148586
This commit is contained in:
@@ -1686,6 +1686,36 @@ void main() {
|
||||
expect(displayName, 'My Project');
|
||||
});
|
||||
|
||||
testUsingContext('should not show --ios-language deprecation warning issue for Swift', () async {
|
||||
Cache.flutterRoot = '../..';
|
||||
|
||||
final CreateCommand command = CreateCommand();
|
||||
final CommandRunner<void> runner = createTestCommandRunner(command);
|
||||
|
||||
await runner.run(<String>['create', '--no-pub', '--ios-language=swift', projectDir.path]);
|
||||
expect(logger.warningText, contains('The "ios-language" option is deprecated and will be removed in a future Flutter release.'));
|
||||
expect(logger.warningText, isNot(contains('https://github.com/flutter/flutter/issues/148586')));
|
||||
|
||||
}, overrides: <Type, Generator>{
|
||||
FeatureFlags: () => TestFeatureFlags(),
|
||||
Logger: () => logger,
|
||||
});
|
||||
|
||||
testUsingContext('should show --ios-language deprecation warning issue for Objective-C', () async {
|
||||
Cache.flutterRoot = '../..';
|
||||
|
||||
final CreateCommand command = CreateCommand();
|
||||
final CommandRunner<void> runner = createTestCommandRunner(command);
|
||||
|
||||
await runner.run(<String>['create', '--no-pub', '--ios-language=objc', projectDir.path]);
|
||||
expect(logger.warningText, contains('The "ios-language" option is deprecated and will be removed in a future Flutter release.'));
|
||||
expect(logger.warningText, contains('https://github.com/flutter/flutter/issues/148586'));
|
||||
|
||||
}, overrides: <Type, Generator>{
|
||||
FeatureFlags: () => TestFeatureFlags(),
|
||||
Logger: () => logger,
|
||||
});
|
||||
|
||||
testUsingContext('has correct content and formatting with macOS app template', () async {
|
||||
Cache.flutterRoot = '../..';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user