Unverified Commit 06b979c4 authored by Gary Qian's avatar Gary Qian Committed by GitHub

Revert "Warn when building on master channel (#25007)" (#27096)

This reverts commit dd65a546.
parent d0595f6b
......@@ -4,13 +4,7 @@
import 'dart:async';
import 'package:meta/meta.dart';
import '../base/terminal.dart';
import '../globals.dart';
import '../runner/flutter_command.dart';
import '../version.dart';
import 'build_aot.dart';
import 'build_apk.dart';
import 'build_appbundle.dart';
......@@ -42,16 +36,4 @@ abstract class BuildSubCommand extends FlutterCommand {
BuildSubCommand() {
requiresPubspecYaml();
}
@override
@mustCallSuper
Future<FlutterCommandResult> runCommand() async {
// Warn if building a release app on Master channel
final String channel = FlutterVersion.instance.channel;
if (channel == 'master') {
printStatus('🐉', newline: false, color: TerminalColor.red);
printStatus(' This is the $channel channel. Shipping apps from this channel is not recommended as it has not been as heavily tested as the stable channel. To build using the stable channel, consider using:\n flutter channel stable');
}
return null;
}
}
......@@ -57,8 +57,6 @@ class BuildAotCommand extends BuildSubCommand {
@override
Future<FlutterCommandResult> runCommand() async {
await super.runCommand();
final String targetPlatform = argResults['target-platform'];
final TargetPlatform platform = getTargetPlatformForName(targetPlatform);
if (platform == null)
......
......@@ -42,8 +42,6 @@ class BuildApkCommand extends BuildSubCommand {
@override
Future<FlutterCommandResult> runCommand() async {
await super.runCommand();
await buildApk(
project: await FlutterProject.current(),
target: targetFile,
......
......@@ -40,8 +40,6 @@ class BuildAppBundleCommand extends BuildSubCommand {
@override
Future<FlutterCommandResult> runCommand() async {
await super.runCommand();
await buildAppBundle(
project: await FlutterProject.current(),
target: targetFile,
......
......@@ -65,8 +65,6 @@ class BuildBundleCommand extends BuildSubCommand {
@override
Future<FlutterCommandResult> runCommand() async {
await super.runCommand();
final String targetPlatform = argResults['target-platform'];
final TargetPlatform platform = getTargetPlatformForName(targetPlatform);
if (platform == null)
......
......@@ -20,8 +20,6 @@ class BuildFlxCommand extends BuildSubCommand {
@override
Future<FlutterCommandResult> runCommand() async {
await super.runCommand();
printError("'build flx' is no longer supported. Instead, use 'build "
"bundle' to build and assemble the application code and resources "
'for your app.');
......
......@@ -50,8 +50,6 @@ class BuildIOSCommand extends BuildSubCommand {
@override
Future<FlutterCommandResult> runCommand() async {
await super.runCommand();
final bool forSimulator = argResults['simulator'];
defaultBuildMode = forSimulator ? BuildMode.debug : BuildMode.release;
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter_tools/src/base/context.dart';
import 'package:flutter_tools/src/commands/build.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/version.dart';
import 'package:flutter_tools/src/runner/flutter_command.dart';
import '../src/common.dart';
import '../src/context.dart';
void main() {
group('Master channel warning', () {
testUsingContext('warns on master', () async {
final MockBuildCommand buildCommand = MockBuildCommand();
try {
await createTestCommandRunner(buildCommand).run(<String>['build', 'test']);
} finally {}
Cache.releaseLockEarly();
expect(testLogger.statusText, contains('🐉 This is the master channel. Shipping apps from this channel is not recommended as it has not'));
}, overrides: <Type, Generator>{
FlutterVersion: () => MockVersion('master'),
});
testUsingContext('no warning on stable', () async {
final MockBuildCommand buildCommand = MockBuildCommand();
try {
await createTestCommandRunner(buildCommand).run(<String>['build', 'test']);
} finally {}
Cache.releaseLockEarly();
expect(testLogger.statusText, '');
}, overrides: <Type, Generator>{
FlutterVersion: () => MockVersion('stable'),
});
testUsingContext('no warning on dev', () async {
final MockBuildCommand buildCommand = MockBuildCommand();
try {
await createTestCommandRunner(buildCommand).run(<String>['build', 'test']);
} finally {}
Cache.releaseLockEarly();
expect(testLogger.statusText, '');
}, overrides: <Type, Generator>{
FlutterVersion: () => MockVersion('dev'),
});
testUsingContext('no warning on beta', () async {
final MockBuildCommand buildCommand = MockBuildCommand();
try {
await createTestCommandRunner(buildCommand).run(<String>['build', 'test']);
} finally {}
print(testLogger.statusText);
Cache.releaseLockEarly();
expect(testLogger.statusText, '');
}, overrides: <Type, Generator>{
FlutterVersion: () => MockVersion('beta'),
});
});
}
class MockVersion extends FlutterVersion {
MockVersion(String channel) : _fakeChannel = channel;
String _fakeChannel;
@override
String get channel => _fakeChannel;
}
class MockBuildCommand extends BuildCommand {
MockBuildCommand() {
addSubcommand(MockBuildTestCommand());
}
}
// Avoids command validation
class MockBuildTestCommand extends BuildSubCommand {
@override
final String name = 'test';
@override
final String description = 'This is a test class only.';
@override
Future<FlutterCommandResult> runCommand() async {
await super.runCommand();
return null;
}
}
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