Unverified Commit 4b2e8289 authored by Christopher Fujino's avatar Christopher Fujino Committed by GitHub

[flutter_tools] deprecate the dev branch from the feature system (#98689)

parent 74881c12
......@@ -79,10 +79,6 @@ const Feature flutterWebFeature = Feature(
available: true,
enabledByDefault: true,
),
dev: FeatureChannelSetting(
available: true,
enabledByDefault: true,
),
beta: FeatureChannelSetting(
available: true,
enabledByDefault: true,
......@@ -102,9 +98,6 @@ const Feature flutterMacOSDesktopFeature = Feature(
master: FeatureChannelSetting(
available: true,
),
dev: FeatureChannelSetting(
available: true,
),
beta: FeatureChannelSetting(
available: true,
),
......@@ -122,9 +115,6 @@ const Feature flutterLinuxDesktopFeature = Feature(
master: FeatureChannelSetting(
available: true,
),
dev: FeatureChannelSetting(
available: true,
),
beta: FeatureChannelSetting(
available: true,
),
......@@ -142,10 +132,6 @@ const Feature flutterWindowsDesktopFeature = Feature(
available: true,
enabledByDefault: true,
),
dev: FeatureChannelSetting(
available: true,
enabledByDefault: true,
),
beta: FeatureChannelSetting(
available: true,
enabledByDefault: true,
......@@ -164,10 +150,6 @@ const Feature flutterAndroidFeature = Feature(
available: true,
enabledByDefault: true,
),
dev: FeatureChannelSetting(
available: true,
enabledByDefault: true,
),
beta: FeatureChannelSetting(
available: true,
enabledByDefault: true,
......@@ -187,10 +169,6 @@ const Feature flutterIOSFeature = Feature(
available: true,
enabledByDefault: true,
),
dev: FeatureChannelSetting(
available: true,
enabledByDefault: true,
),
beta: FeatureChannelSetting(
available: true,
enabledByDefault: true,
......@@ -218,9 +196,6 @@ const Feature flutterCustomDevicesFeature = Feature(
master: FeatureChannelSetting(
available: true,
),
dev: FeatureChannelSetting(
available: true,
)
);
/// The fast hot reload feature for https://github.com/flutter/flutter/issues/61407.
......@@ -232,9 +207,6 @@ const Feature singleWidgetReload = Feature(
available: true,
enabledByDefault: true,
),
dev: FeatureChannelSetting(
available: true,
),
beta: FeatureChannelSetting(
available: true,
),
......@@ -247,9 +219,6 @@ const Feature windowsUwpEmbedding = Feature(
master: FeatureChannelSetting(
available: true,
),
dev: FeatureChannelSetting(
available: true,
),
);
/// A [Feature] is a process for conditionally enabling tool features.
......@@ -268,7 +237,6 @@ class Feature {
this.configSetting,
this.extraHelpText,
this.master = const FeatureChannelSetting(),
this.dev = const FeatureChannelSetting(),
this.beta = const FeatureChannelSetting(),
this.stable = const FeatureChannelSetting()
});
......@@ -279,9 +247,6 @@ class Feature {
/// The settings for the master branch and other unknown channels.
final FeatureChannelSetting master;
/// The settings for the dev branch.
final FeatureChannelSetting dev;
/// The settings for the beta branch.
final FeatureChannelSetting beta;
......@@ -316,7 +281,6 @@ class Feature {
'This setting will take effect on ');
final List<String> channels = <String>[
if (master.available) 'master',
if (dev.available) 'dev',
if (beta.available) 'beta',
if (stable.available) 'stable',
];
......@@ -342,8 +306,6 @@ class Feature {
return stable;
case 'beta':
return beta;
case 'dev':
return dev;
case 'master':
default:
return master;
......
......@@ -56,19 +56,16 @@ void main() {
testWithoutContext('retrieves the correct setting for each branch', () {
const FeatureChannelSetting masterSetting = FeatureChannelSetting(available: true);
const FeatureChannelSetting devSetting = FeatureChannelSetting(available: true);
const FeatureChannelSetting betaSetting = FeatureChannelSetting(available: true);
const FeatureChannelSetting stableSetting = FeatureChannelSetting(available: true);
const Feature feature = Feature(
name: 'example',
master: masterSetting,
dev: devSetting,
beta: betaSetting,
stable: stableSetting,
);
expect(feature.getSettingForChannel('master'), masterSetting);
expect(feature.getSettingForChannel('dev'), devSetting);
expect(feature.getSettingForChannel('beta'), betaSetting);
expect(feature.getSettingForChannel('stable'), stableSetting);
expect(feature.getSettingForChannel('unknown'), masterSetting);
......@@ -87,41 +84,40 @@ void main() {
testWithoutContext('Flutter web help string', () {
expect(flutterWebFeature.generateHelpMessage(),
'Enable or disable Flutter for web. '
'This setting will take effect on the master, dev, beta, and stable channels.');
'This setting will take effect on the master, beta, and stable channels.');
});
testWithoutContext('Flutter macOS desktop help string', () {
expect(flutterMacOSDesktopFeature.generateHelpMessage(),
'Enable or disable beta-quality support for desktop on macOS. '
'This setting will take effect on the master, dev, beta, and stable channels. '
'This setting will take effect on the master, beta, and stable channels. '
'Newer beta versions are available on the beta channel.');
});
testWithoutContext('Flutter Linux desktop help string', () {
expect(flutterLinuxDesktopFeature.generateHelpMessage(),
'Enable or disable beta-quality support for desktop on Linux. '
'This setting will take effect on the master, dev, beta, and stable channels. '
'This setting will take effect on the master, beta, and stable channels. '
'Newer beta versions are available on the beta channel.');
});
testWithoutContext('Flutter Windows desktop help string', () {
expect(flutterWindowsDesktopFeature.generateHelpMessage(),
'Enable or disable support for desktop on Windows. '
'This setting will take effect on the master, dev, beta, and stable channels.');
'This setting will take effect on the master, beta, and stable channels.');
});
testWithoutContext('help string on multiple channels', () {
const Feature testWithoutContextFeature = Feature(
name: 'example',
master: FeatureChannelSetting(available: true),
dev: FeatureChannelSetting(available: true),
beta: FeatureChannelSetting(available: true),
stable: FeatureChannelSetting(available: true),
configSetting: 'foo',
);
expect(testWithoutContextFeature.generateHelpMessage(), 'Enable or disable example. '
'This setting will take effect on the master, dev, beta, and stable channels.');
'This setting will take effect on the master, beta, and stable channels.');
});
/// Flutter Web
......@@ -146,26 +142,6 @@ void main() {
expect(featureFlags.isWebEnabled, true);
});
testWithoutContext('Flutter web off by default on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
expect(featureFlags.isWebEnabled, false);
});
testWithoutContext('Flutter web enabled with config on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
testConfig.setValue('enable-web', true);
expect(featureFlags.isWebEnabled, true);
});
testWithoutContext('Flutter web enabled with environment variable on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
platform.environment = <String, String>{'FLUTTER_WEB': 'true'};
expect(featureFlags.isWebEnabled, true);
});
testWithoutContext('Flutter web off by default on beta', () {
final FeatureFlags featureFlags = createFlags('beta');
......@@ -229,26 +205,6 @@ void main() {
expect(featureFlags.isMacOSEnabled, true);
});
testWithoutContext('Flutter macos desktop off by default on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
expect(featureFlags.isMacOSEnabled, false);
});
testWithoutContext('Flutter macos desktop enabled with config on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
testConfig.setValue('enable-macos-desktop', true);
expect(featureFlags.isMacOSEnabled, true);
});
testWithoutContext('Flutter macos desktop enabled with environment variable on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
platform.environment = <String, String>{'FLUTTER_MACOS': 'true'};
expect(featureFlags.isMacOSEnabled, true);
});
testWithoutContext('Flutter macos desktop off by default on beta', () {
final FeatureFlags featureFlags = createFlags('beta');
......@@ -310,26 +266,6 @@ void main() {
expect(featureFlags.isLinuxEnabled, true);
});
testWithoutContext('Flutter linux desktop off by default on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
expect(featureFlags.isLinuxEnabled, false);
});
testWithoutContext('Flutter linux desktop enabled with config on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
testConfig.setValue('enable-linux-desktop', true);
expect(featureFlags.isLinuxEnabled, true);
});
testWithoutContext('Flutter linux desktop enabled with environment variable on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
platform.environment = <String, String>{'FLUTTER_LINUX': 'true'};
expect(featureFlags.isLinuxEnabled, true);
});
testWithoutContext('Flutter linux desktop off by default on beta', () {
final FeatureFlags featureFlags = createFlags('beta');
......@@ -391,26 +327,6 @@ void main() {
expect(featureFlags.isWindowsEnabled, true);
});
testWithoutContext('Flutter Windows desktop off by default on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
expect(featureFlags.isWindowsEnabled, false);
});
testWithoutContext('Flutter Windows desktop enabled with config on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
testConfig.setValue('enable-windows-desktop', true);
expect(featureFlags.isWindowsEnabled, true);
});
testWithoutContext('Flutter Windows desktop not enabled with environment variable on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
platform.environment = <String, String>{'FLUTTER_WINDOWS': 'true'};
expect(featureFlags.isWindowsEnabled, true);
});
testWithoutContext('Flutter Windows desktop off by default on beta', () {
final FeatureFlags featureFlags = createFlags('beta');
......@@ -466,19 +382,6 @@ void main() {
expect(featureFlags.isWindowsUwpEnabled, true);
});
testWithoutContext('Flutter Windows UWP desktop off by default on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
expect(featureFlags.isWindowsUwpEnabled, false);
});
testWithoutContext('Flutter Windows UWP desktop enabled with config on dev', () {
final FeatureFlags featureFlags = createFlags('dev');
testConfig.setValue('enable-windows-uwp-desktop', true);
expect(featureFlags.isWindowsUwpEnabled, true);
});
testWithoutContext('Flutter Windows UWP desktop off by default on stable', () {
final FeatureFlags featureFlags = createFlags('stable');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment