mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
update macOS configuration settings (#45920)
This commit is contained in:
parent
4c4cdbfc2b
commit
3b2042a028
@ -146,22 +146,6 @@ class CreateCommand extends FlutterCommand {
|
|||||||
defaultsTo: true,
|
defaultsTo: true,
|
||||||
help: 'Generate a project using the AndroidX support libraries',
|
help: 'Generate a project using the AndroidX support libraries',
|
||||||
);
|
);
|
||||||
// Deprecated
|
|
||||||
argParser.addFlag(
|
|
||||||
'macos',
|
|
||||||
negatable: true,
|
|
||||||
defaultsTo: false,
|
|
||||||
hide: true,
|
|
||||||
help: 'Include support for building a macOS application',
|
|
||||||
);
|
|
||||||
// Deprecated
|
|
||||||
argParser.addFlag(
|
|
||||||
'web',
|
|
||||||
negatable: true,
|
|
||||||
defaultsTo: false,
|
|
||||||
hide: true,
|
|
||||||
help: 'Deprecated',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -406,7 +390,7 @@ class CreateCommand extends FlutterCommand {
|
|||||||
androidLanguage: stringArg('android-language'),
|
androidLanguage: stringArg('android-language'),
|
||||||
iosLanguage: stringArg('ios-language'),
|
iosLanguage: stringArg('ios-language'),
|
||||||
web: featureFlags.isWebEnabled,
|
web: featureFlags.isWebEnabled,
|
||||||
macos: boolArg('macos'),
|
macos: featureFlags.isMacOSEnabled,
|
||||||
);
|
);
|
||||||
|
|
||||||
final String relativeDirPath = fs.path.relative(projectDirPath);
|
final String relativeDirPath = fs.path.relative(projectDirPath);
|
||||||
|
@ -106,6 +106,10 @@ const Feature flutterMacOSDesktopFeature = Feature(
|
|||||||
available: true,
|
available: true,
|
||||||
enabledByDefault: false,
|
enabledByDefault: false,
|
||||||
),
|
),
|
||||||
|
dev: FeatureChannelSetting(
|
||||||
|
available: true,
|
||||||
|
enabledByDefault: false,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
/// The [Feature] for Linux desktop.
|
/// The [Feature] for Linux desktop.
|
||||||
|
@ -78,19 +78,27 @@ void main() {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
test('flutter web help string', () {
|
test('flutter web help string', () {
|
||||||
expect(flutterWebFeature.generateHelpMessage(), 'Enable or disable Flutter for web. This setting will take effect on the master, dev, and beta channels.');
|
expect(flutterWebFeature.generateHelpMessage(),
|
||||||
|
'Enable or disable Flutter for web. '
|
||||||
|
'This setting will take effect on the master, dev, and beta channels.');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('flutter macOS desktop help string', () {
|
test('flutter macOS desktop help string', () {
|
||||||
expect(flutterMacOSDesktopFeature.generateHelpMessage(), 'Enable or disable Flutter for desktop on macOS. This setting will take effect on the master channel.');
|
expect(flutterMacOSDesktopFeature.generateHelpMessage(),
|
||||||
|
'Enable or disable Flutter for desktop on macOS. '
|
||||||
|
'This setting will take effect on the master and dev channels.');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('flutter Linux desktop help string', () {
|
test('flutter Linux desktop help string', () {
|
||||||
expect(flutterLinuxDesktopFeature.generateHelpMessage(), 'Enable or disable Flutter for desktop on Linux. This setting will take effect on the master channel.');
|
expect(flutterLinuxDesktopFeature.generateHelpMessage(),
|
||||||
|
'Enable or disable Flutter for desktop on Linux. '
|
||||||
|
'This setting will take effect on the master channel.');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('flutter Windows desktop help string', () {
|
test('flutter Windows desktop help string', () {
|
||||||
expect(flutterWindowsDesktopFeature.generateHelpMessage(), 'Enable or disable Flutter for desktop on Windows. This setting will take effect on the master channel.');
|
expect(flutterWindowsDesktopFeature.generateHelpMessage(),
|
||||||
|
'Enable or disable Flutter for desktop on Windows. '
|
||||||
|
'This setting will take effect on the master channel.');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('help string on multiple channels', () {
|
test('help string on multiple channels', () {
|
||||||
@ -217,18 +225,18 @@ void main() {
|
|||||||
expect(featureFlags.isMacOSEnabled, false);
|
expect(featureFlags.isMacOSEnabled, false);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
test('flutter macos desktop not enabled with config on dev', () => testbed.run(() {
|
test('flutter macos desktop enabled with config on dev', () => testbed.run(() {
|
||||||
when(mockFlutterVerion.channel).thenReturn('dev');
|
when(mockFlutterVerion.channel).thenReturn('dev');
|
||||||
when<bool>(mockFlutterConfig.getValue('flutter-desktop-macos') as bool).thenReturn(true);
|
when<bool>(mockFlutterConfig.getValue('enable-macos-desktop') as bool).thenReturn(true);
|
||||||
|
|
||||||
expect(featureFlags.isMacOSEnabled, false);
|
expect(featureFlags.isMacOSEnabled, true);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
test('flutter macos desktop not enabled with environment variable on dev', () => testbed.run(() {
|
test('flutter macos desktop enabled with environment variable on dev', () => testbed.run(() {
|
||||||
when(mockFlutterVerion.channel).thenReturn('dev');
|
when(mockFlutterVerion.channel).thenReturn('dev');
|
||||||
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_MACOS': 'true'});
|
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_MACOS': 'true'});
|
||||||
|
|
||||||
expect(featureFlags.isMacOSEnabled, false);
|
expect(featureFlags.isMacOSEnabled, true);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
test('flutter macos desktop off by default on beta', () => testbed.run(() {
|
test('flutter macos desktop off by default on beta', () => testbed.run(() {
|
||||||
|
Loading…
Reference in New Issue
Block a user