re-re-enable lint unnecessary_const (#20103)
This commit is contained in:
committed by
GitHub
parent
ffbaa97b50
commit
eda03e2586
@@ -22,7 +22,7 @@ const String _kOptionPackages = 'packages';
|
||||
const String _kOptionAsset = 'asset-dir';
|
||||
const String _kOptionManifest = 'manifest';
|
||||
const String _kOptionAssetManifestOut = 'asset-manifest-out';
|
||||
const List<String> _kRequiredOptions = const <String>[
|
||||
const List<String> _kRequiredOptions = <String>[
|
||||
_kOptionPackages,
|
||||
_kOptionAsset,
|
||||
_kOptionAssetManifestOut,
|
||||
|
||||
@@ -24,7 +24,7 @@ import 'package:flutter_tools/src/usage.dart';
|
||||
const String _kOptionPackages = 'packages';
|
||||
const String _kOptionShell = 'shell';
|
||||
const String _kOptionTestDirectory = 'test-directory';
|
||||
const List<String> _kRequiredOptions = const <String>[
|
||||
const List<String> _kRequiredOptions = <String>[
|
||||
_kOptionPackages,
|
||||
_kOptionShell,
|
||||
_kOptionTestDirectory,
|
||||
|
||||
@@ -31,7 +31,7 @@ import 'android_sdk.dart';
|
||||
enum _HardwareType { emulator, physical }
|
||||
|
||||
/// Map to help our `isLocalEmulator` detection.
|
||||
const Map<String, _HardwareType> _knownHardware = const <String, _HardwareType>{
|
||||
const Map<String, _HardwareType> _knownHardware = <String, _HardwareType>{
|
||||
'goldfish': _HardwareType.emulator,
|
||||
'qcom': _HardwareType.physical,
|
||||
'ranchu': _HardwareType.emulator,
|
||||
@@ -698,7 +698,7 @@ class _AdbLogReader extends DeviceLogReader {
|
||||
_timeOrigin = null;
|
||||
runCommand(device.adbCommandForDevice(args)).then<Null>((Process process) {
|
||||
_process = process;
|
||||
const Utf8Decoder decoder = const Utf8Decoder(allowMalformed: true);
|
||||
const Utf8Decoder decoder = Utf8Decoder(allowMalformed: true);
|
||||
_process.stdout.transform(decoder).transform(const LineSplitter()).listen(_onLine);
|
||||
_process.stderr.transform(decoder).transform(const LineSplitter()).listen(_onLine);
|
||||
_process.exitCode.whenComplete(() {
|
||||
|
||||
@@ -292,7 +292,7 @@ class LocalEngineArtifacts extends Artifacts {
|
||||
}
|
||||
|
||||
String _genSnapshotPath() {
|
||||
const List<String> clangDirs = const <String>['.', 'clang_x86', 'clang_x64', 'clang_i386'];
|
||||
const List<String> clangDirs = <String>['.', 'clang_x86', 'clang_x64', 'clang_i386'];
|
||||
final String genSnapshotName = _artifactToFileName(Artifact.genSnapshot);
|
||||
for (String clangDir in clangDirs) {
|
||||
final String genSnapshotPath = fs.path.join(engineOutPath, clangDir, genSnapshotName);
|
||||
|
||||
@@ -18,7 +18,7 @@ import 'devfs.dart';
|
||||
import 'flutter_manifest.dart';
|
||||
import 'globals.dart';
|
||||
|
||||
const AssetBundleFactory _kManifestFactory = const _ManifestAssetBundleFactory();
|
||||
const AssetBundleFactory _kManifestFactory = _ManifestAssetBundleFactory();
|
||||
|
||||
/// Injected factory class for spawning [AssetBundle] instances.
|
||||
abstract class AssetBundleFactory {
|
||||
|
||||
@@ -170,7 +170,7 @@ class AppContext {
|
||||
class _Key {
|
||||
const _Key();
|
||||
|
||||
static const _Key key = const _Key();
|
||||
static const _Key key = _Key();
|
||||
|
||||
@override
|
||||
String toString() => 'context';
|
||||
@@ -180,5 +180,5 @@ class _Key {
|
||||
class _BoxedNull {
|
||||
const _BoxedNull();
|
||||
|
||||
static const _BoxedNull instance = const _BoxedNull();
|
||||
static const _BoxedNull instance = _BoxedNull();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ export 'package:file/file.dart';
|
||||
export 'package:file/local.dart';
|
||||
|
||||
const String _kRecordingType = 'file';
|
||||
const FileSystem _kLocalFs = const LocalFileSystem();
|
||||
const FileSystem _kLocalFs = LocalFileSystem();
|
||||
|
||||
/// Currently active implementation of the file system.
|
||||
///
|
||||
|
||||
@@ -116,12 +116,12 @@ class ProcessSignal implements io.ProcessSignal {
|
||||
@visibleForTesting
|
||||
const ProcessSignal(this._delegate);
|
||||
|
||||
static const ProcessSignal SIGWINCH = const _PosixProcessSignal._(io.ProcessSignal.sigwinch);
|
||||
static const ProcessSignal SIGTERM = const _PosixProcessSignal._(io.ProcessSignal.sigterm);
|
||||
static const ProcessSignal SIGUSR1 = const _PosixProcessSignal._(io.ProcessSignal.sigusr1);
|
||||
static const ProcessSignal SIGUSR2 = const _PosixProcessSignal._(io.ProcessSignal.sigusr2);
|
||||
static const ProcessSignal SIGINT = const ProcessSignal(io.ProcessSignal.sigint);
|
||||
static const ProcessSignal SIGKILL = const ProcessSignal(io.ProcessSignal.sigkill);
|
||||
static const ProcessSignal SIGWINCH = _PosixProcessSignal._(io.ProcessSignal.sigwinch);
|
||||
static const ProcessSignal SIGTERM = _PosixProcessSignal._(io.ProcessSignal.sigterm);
|
||||
static const ProcessSignal SIGUSR1 = _PosixProcessSignal._(io.ProcessSignal.sigusr1);
|
||||
static const ProcessSignal SIGUSR2 = _PosixProcessSignal._(io.ProcessSignal.sigusr2);
|
||||
static const ProcessSignal SIGINT = ProcessSignal(io.ProcessSignal.sigint);
|
||||
static const ProcessSignal SIGKILL = ProcessSignal(io.ProcessSignal.sigkill);
|
||||
|
||||
final io.ProcessSignal _delegate;
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ abstract class OperatingSystemUtils {
|
||||
///
|
||||
/// If available, the detailed version of the OS is included.
|
||||
String get name {
|
||||
const Map<String, String> osNames = const <String, String>{
|
||||
const Map<String, String> osNames = <String, String>{
|
||||
'macos': 'Mac OS',
|
||||
'linux': 'Linux',
|
||||
'windows': 'Windows'
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'file_system.dart';
|
||||
|
||||
export 'package:platform/platform.dart';
|
||||
|
||||
const Platform _kLocalPlatform = const LocalPlatform();
|
||||
const Platform _kLocalPlatform = LocalPlatform();
|
||||
const String _kRecordingType = 'platform';
|
||||
|
||||
Platform get platform => context[Platform] ?? _kLocalPlatform;
|
||||
|
||||
@@ -33,19 +33,19 @@ class ShutdownStage implements Comparable<ShutdownStage> {
|
||||
|
||||
/// The stage before the invocation recording (if one exists) is serialized
|
||||
/// to disk. Tasks performed during this stage *will* be recorded.
|
||||
static const ShutdownStage STILL_RECORDING = const ShutdownStage._(1);
|
||||
static const ShutdownStage STILL_RECORDING = ShutdownStage._(1);
|
||||
|
||||
/// The stage during which the invocation recording (if one exists) will be
|
||||
/// serialized to disk. Invocations performed after this stage will not be
|
||||
/// recorded.
|
||||
static const ShutdownStage SERIALIZE_RECORDING = const ShutdownStage._(2);
|
||||
static const ShutdownStage SERIALIZE_RECORDING = ShutdownStage._(2);
|
||||
|
||||
/// The stage during which a serialized recording will be refined (e.g.
|
||||
/// cleansed for tests, zipped up for bug reporting purposes, etc.).
|
||||
static const ShutdownStage POST_PROCESS_RECORDING = const ShutdownStage._(3);
|
||||
static const ShutdownStage POST_PROCESS_RECORDING = ShutdownStage._(3);
|
||||
|
||||
/// The stage during which temporary files and directories will be deleted.
|
||||
static const ShutdownStage CLEANUP = const ShutdownStage._(4);
|
||||
static const ShutdownStage CLEANUP = ShutdownStage._(4);
|
||||
|
||||
@override
|
||||
int compareTo(ShutdownStage other) => priority.compareTo(other.priority);
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'file_system.dart';
|
||||
import 'process.dart';
|
||||
|
||||
const String _kRecordingType = 'process';
|
||||
const ProcessManager _kLocalProcessManager = const LocalProcessManager();
|
||||
const ProcessManager _kLocalProcessManager = LocalProcessManager();
|
||||
|
||||
/// The active process manager.
|
||||
ProcessManager get processManager => context[ProcessManager] ?? _kLocalProcessManager;
|
||||
@@ -27,7 +27,7 @@ ProcessManager get processManager => context[ProcessManager] ?? _kLocalProcessMa
|
||||
/// subdirectory.
|
||||
RecordingProcessManager getRecordingProcessManager(String location) {
|
||||
final Directory dir = getRecordingSink(location, _kRecordingType);
|
||||
const ProcessManager delegate = const LocalProcessManager();
|
||||
const ProcessManager delegate = LocalProcessManager();
|
||||
final RecordingProcessManager manager = new RecordingProcessManager(delegate, dir);
|
||||
addShutdownHook(() async {
|
||||
await manager.flush(finishRunningProcesses: true);
|
||||
|
||||
@@ -33,7 +33,7 @@ class AnsiTerminal {
|
||||
|
||||
/// Setting the line mode can throw for some terminals (with "Operation not
|
||||
/// supported on socket"), but the error can be safely ignored.
|
||||
static const List<int> _lineModeIgnorableErrors = const <int>[
|
||||
static const List<int> _lineModeIgnorableErrors = <int>[
|
||||
_EBADF,
|
||||
_ENXIO,
|
||||
_ENOTTY,
|
||||
|
||||
@@ -15,7 +15,7 @@ import 'context.dart';
|
||||
import 'file_system.dart';
|
||||
import 'platform.dart';
|
||||
|
||||
const BotDetector _kBotDetector = const BotDetector();
|
||||
const BotDetector _kBotDetector = BotDetector();
|
||||
|
||||
class BotDetector {
|
||||
const BotDetector();
|
||||
|
||||
@@ -71,9 +71,9 @@ class BuildInfo {
|
||||
/// On Xcode builds it is used as CFBundleShortVersionString,
|
||||
final String buildName;
|
||||
|
||||
static const BuildInfo debug = const BuildInfo(BuildMode.debug, null);
|
||||
static const BuildInfo profile = const BuildInfo(BuildMode.profile, null);
|
||||
static const BuildInfo release = const BuildInfo(BuildMode.release, null);
|
||||
static const BuildInfo debug = BuildInfo(BuildMode.debug, null);
|
||||
static const BuildInfo profile = BuildInfo(BuildMode.profile, null);
|
||||
static const BuildInfo release = BuildInfo(BuildMode.release, null);
|
||||
|
||||
/// Returns whether a debug build is requested.
|
||||
///
|
||||
@@ -174,7 +174,7 @@ enum IOSArch {
|
||||
}
|
||||
|
||||
/// The default set of iOS device architectures to build for.
|
||||
const List<IOSArch> defaultIOSArchs = const <IOSArch>[
|
||||
const List<IOSArch> defaultIOSArchs = <IOSArch>[
|
||||
IOSArch.arm64,
|
||||
];
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class Cache {
|
||||
}
|
||||
}
|
||||
|
||||
static const List<String> _hostsBlockedInChina = const <String> [
|
||||
static const List<String> _hostsBlockedInChina = <String> [
|
||||
'storage.googleapis.com',
|
||||
];
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ class PackageDependency {
|
||||
|
||||
class PackageDependencyTracker {
|
||||
/// Packages whose source is defined in the vended SDK.
|
||||
static const List<String> _vendedSdkPackages = const <String>['analyzer', 'front_end', 'kernel'];
|
||||
static const List<String> _vendedSdkPackages = <String>['analyzer', 'front_end', 'kernel'];
|
||||
|
||||
// This is a map from package names to objects that track the paths
|
||||
// involved (sources and targets).
|
||||
|
||||
@@ -25,7 +25,7 @@ import '../runner/flutter_command.dart';
|
||||
/// ```
|
||||
/// 'linter': '0.1.35', // TODO(yjbanov): https://github.com/dart-lang/linter/issues/824
|
||||
/// ```
|
||||
const Map<String, String> _kManuallyPinnedDependencies = const <String, String>{
|
||||
const Map<String, String> _kManuallyPinnedDependencies = <String, String>{
|
||||
// Add pinned packages here.
|
||||
'mockito': '3.0.0-beta', // TODO(aam): https://github.com/dart-lang/mockito/issues/110
|
||||
'matcher': '0.12.2+1', // TODO(ianh): https://github.com/flutter/flutter/issues/18608, https://github.com/dart-lang/matcher/pull/88
|
||||
|
||||
@@ -12,7 +12,7 @@ String get dartSdkPath {
|
||||
}
|
||||
|
||||
/// The required Dart language flags
|
||||
const List<String> dartVmFlags = const <String>[];
|
||||
const List<String> dartVmFlags = <String>[];
|
||||
|
||||
/// Return the platform specific name for the given Dart SDK binary. So, `pub`
|
||||
/// ==> `pub.bat`. The default SDK location can be overridden with a specified
|
||||
|
||||
@@ -129,8 +129,8 @@ abstract class DeviceDiscovery {
|
||||
abstract class PollingDeviceDiscovery extends DeviceDiscovery {
|
||||
PollingDeviceDiscovery(this.name);
|
||||
|
||||
static const Duration _pollingInterval = const Duration(seconds: 4);
|
||||
static const Duration _pollingTimeout = const Duration(seconds: 30);
|
||||
static const Duration _pollingInterval = Duration(seconds: 4);
|
||||
static const Duration _pollingTimeout = Duration(seconds: 30);
|
||||
|
||||
final String name;
|
||||
ItemListNotifier<Device> _items;
|
||||
|
||||
@@ -127,7 +127,7 @@ class EmulatorManager {
|
||||
);
|
||||
}
|
||||
|
||||
static const List<String> preferredDevices = const <String>[
|
||||
static const List<String> preferredDevices = <String>[
|
||||
'pixel',
|
||||
'pixel_xl',
|
||||
];
|
||||
|
||||
@@ -118,7 +118,7 @@ Future<Map<String, String>> getCodeSigningIdentityDevelopmentTeam({
|
||||
return null;
|
||||
|
||||
const List<String> findIdentityCommand =
|
||||
const <String>['security', 'find-identity', '-p', 'codesigning', '-v'];
|
||||
<String>['security', 'find-identity', '-p', 'codesigning', '-v'];
|
||||
final List<String> validCodeSigningIdentities = runCheckedSync(findIdentityCommand)
|
||||
.split('\n')
|
||||
.map<String>((String outputLine) {
|
||||
|
||||
@@ -26,7 +26,7 @@ const String _kIdeviceinstallerInstructions =
|
||||
'To work with iOS devices, please install ideviceinstaller. To install, run:\n'
|
||||
'brew install ideviceinstaller.';
|
||||
|
||||
const Duration kPortForwardTimeout = const Duration(seconds: 10);
|
||||
const Duration kPortForwardTimeout = Duration(seconds: 10);
|
||||
|
||||
class IOSDeploy {
|
||||
const IOSDeploy();
|
||||
@@ -530,7 +530,7 @@ class _IOSDevicePortForwarder extends DevicePortForwarder {
|
||||
@override
|
||||
List<ForwardedPort> get forwardedPorts => _forwardedPorts;
|
||||
|
||||
static const Duration _kiProxyPortForwardTimeout = const Duration(seconds: 1);
|
||||
static const Duration _kiProxyPortForwardTimeout = Duration(seconds: 1);
|
||||
|
||||
@override
|
||||
Future<int> forward(int devicePort, {int hostPort}) async {
|
||||
|
||||
@@ -145,10 +145,10 @@ class SimControlListSection {
|
||||
|
||||
final String name;
|
||||
|
||||
static const SimControlListSection devices = const SimControlListSection._('devices');
|
||||
static const SimControlListSection devicetypes = const SimControlListSection._('devicetypes');
|
||||
static const SimControlListSection runtimes = const SimControlListSection._('runtimes');
|
||||
static const SimControlListSection pairs = const SimControlListSection._('pairs');
|
||||
static const SimControlListSection devices = SimControlListSection._('devices');
|
||||
static const SimControlListSection devicetypes = SimControlListSection._('devicetypes');
|
||||
static const SimControlListSection runtimes = SimControlListSection._('runtimes');
|
||||
static const SimControlListSection pairs = SimControlListSection._('pairs');
|
||||
}
|
||||
|
||||
/// A simulated device type.
|
||||
@@ -668,7 +668,7 @@ int compareIphoneVersions(String id1, String id2) {
|
||||
return v1.compareTo(v2);
|
||||
|
||||
// Sorted in the least preferred first order.
|
||||
const List<String> qualifiers = const <String>['-Plus', '', 's-Plus', 's'];
|
||||
const List<String> qualifiers = <String>['-Plus', '', 's-Plus', 's'];
|
||||
|
||||
final int q1 = qualifiers.indexOf(m1[2]);
|
||||
final int q2 = qualifiers.indexOf(m2[2]);
|
||||
|
||||
@@ -25,12 +25,12 @@ import 'watcher.dart';
|
||||
|
||||
/// The timeout we give the test process to connect to the test harness
|
||||
/// once the process has entered its main method.
|
||||
const Duration _kTestStartupTimeout = const Duration(minutes: 1);
|
||||
const Duration _kTestStartupTimeout = Duration(minutes: 1);
|
||||
|
||||
/// The timeout we give the test process to start executing Dart code. When the
|
||||
/// CPU is under severe load, this can take a while, but it's not indicative of
|
||||
/// any problem with Flutter, so we give it a large timeout.
|
||||
const Duration _kTestProcessTimeout = const Duration(minutes: 5);
|
||||
const Duration _kTestProcessTimeout = Duration(minutes: 5);
|
||||
|
||||
/// Message logged by the test process to signal that its main method has begun
|
||||
/// execution.
|
||||
|
||||
@@ -206,20 +206,20 @@ class FlutterVersion {
|
||||
/// The amount of time we wait before pinging the server to check for the
|
||||
/// availability of a newer version of Flutter.
|
||||
@visibleForTesting
|
||||
static const Duration kCheckAgeConsideredUpToDate = const Duration(days: 3);
|
||||
static const Duration kCheckAgeConsideredUpToDate = Duration(days: 3);
|
||||
|
||||
/// We warn the user if the age of their Flutter installation is greater than
|
||||
/// this duration.
|
||||
///
|
||||
/// This is set to 5 weeks because releases are currently around every 4 weeks.
|
||||
@visibleForTesting
|
||||
static const Duration kVersionAgeConsideredUpToDate = const Duration(days: 35);
|
||||
static const Duration kVersionAgeConsideredUpToDate = Duration(days: 35);
|
||||
|
||||
/// The amount of time we wait between issuing a warning.
|
||||
///
|
||||
/// This is to avoid annoying users who are unable to upgrade right away.
|
||||
@visibleForTesting
|
||||
static const Duration kMaxTimeSinceLastWarning = const Duration(days: 1);
|
||||
static const Duration kMaxTimeSinceLastWarning = Duration(days: 1);
|
||||
|
||||
/// The amount of time we pause for to let the user read the message about
|
||||
/// outdated Flutter installation.
|
||||
@@ -418,7 +418,7 @@ class VersionCheckStamp {
|
||||
if (newTimeWarningWasPrinted != null)
|
||||
jsonData['lastTimeWarningWasPrinted'] = '$newTimeWarningWasPrinted';
|
||||
|
||||
const JsonEncoder kPrettyJsonEncoder = const JsonEncoder.withIndent(' ');
|
||||
const JsonEncoder kPrettyJsonEncoder = JsonEncoder.withIndent(' ');
|
||||
Cache.instance.setStampFor(kFlutterVersionCheckStampFile, kPrettyJsonEncoder.convert(jsonData));
|
||||
}
|
||||
|
||||
|
||||
@@ -94,13 +94,13 @@ Future<StreamChannel<String>> _defaultOpenChannel(Uri uri) async {
|
||||
}
|
||||
|
||||
/// The default VM service request timeout.
|
||||
const Duration kDefaultRequestTimeout = const Duration(seconds: 30);
|
||||
const Duration kDefaultRequestTimeout = Duration(seconds: 30);
|
||||
|
||||
/// Used for RPC requests that may take a long time.
|
||||
const Duration kLongRequestTimeout = const Duration(minutes: 1);
|
||||
const Duration kLongRequestTimeout = Duration(minutes: 1);
|
||||
|
||||
/// Used for RPC requests that should never take a long time.
|
||||
const Duration kShortRequestTimeout = const Duration(seconds: 5);
|
||||
const Duration kShortRequestTimeout = Duration(seconds: 5);
|
||||
|
||||
/// A connection to the Dart VM Service.
|
||||
class VMService {
|
||||
|
||||
@@ -212,7 +212,7 @@ dependencies:
|
||||
flutter:
|
||||
''';
|
||||
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null);
|
||||
await checkBuildVersion(
|
||||
manifest: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -230,7 +230,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null);
|
||||
await checkBuildVersion(
|
||||
manifest: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -248,7 +248,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null, buildName: '1.0.2');
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null, buildName: '1.0.2');
|
||||
await checkBuildVersion(
|
||||
manifest: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -266,7 +266,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null, buildNumber: 3);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null, buildNumber: 3);
|
||||
await checkBuildVersion(
|
||||
manifest: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -284,7 +284,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
await checkBuildVersion(
|
||||
manifest: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -302,7 +302,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
await checkBuildVersion(
|
||||
manifest: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -319,7 +319,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
await checkBuildVersion(
|
||||
manifest: manifest,
|
||||
buildInfo: buildInfo,
|
||||
|
||||
@@ -17,7 +17,7 @@ import '../src/common.dart';
|
||||
import '../src/context.dart';
|
||||
|
||||
/// Test case timeout for tests involving project analysis.
|
||||
const Timeout allowForSlowAnalyzeTests = const Timeout.factor(5.0);
|
||||
const Timeout allowForSlowAnalyzeTests = Timeout.factor(5.0);
|
||||
|
||||
void main() {
|
||||
final String analyzerSeparator = platform.isWindows ? '-' : '•';
|
||||
|
||||
@@ -104,23 +104,23 @@ void main() {
|
||||
);
|
||||
}
|
||||
|
||||
const List<String> pubOutput = const <String>[
|
||||
const List<String> pubOutput = <String>[
|
||||
'.packages',
|
||||
'pubspec.lock',
|
||||
];
|
||||
|
||||
const List<String> pluginRegistrants = const <String>[
|
||||
const List<String> pluginRegistrants = <String>[
|
||||
'ios/Runner/GeneratedPluginRegistrant.h',
|
||||
'ios/Runner/GeneratedPluginRegistrant.m',
|
||||
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java',
|
||||
];
|
||||
|
||||
const List<String> pluginWitnesses = const <String>[
|
||||
const List<String> pluginWitnesses = <String>[
|
||||
'.flutter-plugins',
|
||||
'ios/Podfile',
|
||||
];
|
||||
|
||||
const Map<String, String> pluginContentWitnesses = const <String, String>{
|
||||
const Map<String, String> pluginContentWitnesses = <String, String>{
|
||||
'ios/Flutter/Debug.xcconfig': '#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"',
|
||||
'ios/Flutter/Release.xcconfig': '#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"',
|
||||
};
|
||||
|
||||
@@ -95,7 +95,7 @@ void main() {
|
||||
testUsingContext('moved flutter sdk', () async {
|
||||
final Directory destinationPath = fs.systemTempDirectory.createTempSync('dependency_checker_test_');
|
||||
// Copy the golden input and let the test run in an isolated temporary in-memory file system.
|
||||
const LocalFileSystem localFileSystem = const LocalFileSystem();
|
||||
const LocalFileSystem localFileSystem = LocalFileSystem();
|
||||
final Directory sourcePath = localFileSystem.directory(localFileSystem.path.join(dataPath, 'changed_sdk_location'));
|
||||
copyDirectorySync(sourcePath, destinationPath);
|
||||
fs.currentDirectory = destinationPath;
|
||||
|
||||
@@ -193,7 +193,7 @@ class MockProcessManager extends Mock implements ProcessManager {
|
||||
'system-images;android-27;google_apis_playstore;x86\n'
|
||||
'null\n'; // Yep, these really end with null (on dantup's machine at least)
|
||||
|
||||
static const ListEquality<String> _equality = const ListEquality<String>();
|
||||
static const ListEquality<String> _equality = ListEquality<String>();
|
||||
final List<String> _existingAvds = <String>['existing-avd-1'];
|
||||
|
||||
@override
|
||||
|
||||
@@ -18,7 +18,7 @@ FlutterTestDriver _flutter;
|
||||
/// This duration is arbitrary but is ideally:
|
||||
/// a) long enough to ensure that if the app is crashing at startup, we notice
|
||||
/// b) as short as possible, to avoid inflating build times
|
||||
const Duration requiredLifespan = const Duration(seconds: 5);
|
||||
const Duration requiredLifespan = Duration(seconds: 5);
|
||||
|
||||
void main() {
|
||||
group('flutter run', () {
|
||||
|
||||
@@ -18,9 +18,9 @@ import '../src/common.dart';
|
||||
|
||||
// Set this to true for debugging to get JSON written to stdout.
|
||||
const bool _printJsonAndStderr = false;
|
||||
const Duration defaultTimeout = const Duration(seconds: 20);
|
||||
const Duration appStartTimeout = const Duration(seconds: 60);
|
||||
const Duration quitTimeout = const Duration(seconds: 5);
|
||||
const Duration defaultTimeout = Duration(seconds: 20);
|
||||
const Duration appStartTimeout = Duration(seconds: 60);
|
||||
const Duration quitTimeout = Duration(seconds: 5);
|
||||
|
||||
class FlutterTestDriver {
|
||||
final Directory _projectFolder;
|
||||
@@ -78,7 +78,7 @@ class FlutterTestDriver {
|
||||
final String flutterBin = fs.path.join(getFlutterRoot(), 'bin', 'flutter');
|
||||
_debugPrint('Spawning flutter $args in ${_projectFolder.path}');
|
||||
|
||||
const ProcessManager _processManager = const LocalProcessManager();
|
||||
const ProcessManager _processManager = LocalProcessManager();
|
||||
_proc = await _processManager.start(
|
||||
<String>[flutterBin]
|
||||
.followedBy(args)
|
||||
|
||||
@@ -33,7 +33,7 @@ void main() {
|
||||
|
||||
testUsingContext('getAvailableDeviceIDs throws ToolExit when libimobiledevice is not installed', () async {
|
||||
when(mockProcessManager.run(<String>['idevice_id', '-l']))
|
||||
.thenThrow(const ProcessException('idevice_id', const <String>['-l']));
|
||||
.thenThrow(const ProcessException('idevice_id', <String>['-l']));
|
||||
expect(() async => await iMobileDevice.getAvailableDeviceIDs(), throwsToolExit());
|
||||
}, overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
@@ -109,7 +109,7 @@ void main() {
|
||||
|
||||
testUsingContext('xcodeSelectPath returns null when xcode-select is not installed', () {
|
||||
when(mockProcessManager.runSync(<String>['/usr/bin/xcode-select', '--print-path']))
|
||||
.thenThrow(const ProcessException('/usr/bin/xcode-select', const <String>['--print-path']));
|
||||
.thenThrow(const ProcessException('/usr/bin/xcode-select', <String>['--print-path']));
|
||||
expect(xcode.xcodeSelectPath, isNull);
|
||||
}, overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
@@ -169,7 +169,7 @@ void main() {
|
||||
|
||||
testUsingContext('eulaSigned is false when clang is not installed', () {
|
||||
when(mockProcessManager.runSync(<String>['/usr/bin/xcrun', 'clang']))
|
||||
.thenThrow(const ProcessException('/usr/bin/xcrun', const <String>['clang']));
|
||||
.thenThrow(const ProcessException('/usr/bin/xcrun', <String>['clang']));
|
||||
expect(xcode.eulaSigned, isFalse);
|
||||
}, overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
|
||||
@@ -46,7 +46,7 @@ void main() {
|
||||
|
||||
testUsingOsxContext('versionText returns null when xcodebuild is not installed', () {
|
||||
when(mockProcessManager.runSync(<String>[xcodebuild, '-version']))
|
||||
.thenThrow(const ProcessException(xcodebuild, const <String>['-version']));
|
||||
.thenThrow(const ProcessException(xcodebuild, <String>['-version']));
|
||||
expect(xcodeProjectInterpreter.versionText, isNull);
|
||||
});
|
||||
|
||||
@@ -285,7 +285,7 @@ Information about project "Runner":
|
||||
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, any)).thenReturn('engine');
|
||||
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm'));
|
||||
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null,
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null,
|
||||
previewDart2: true,
|
||||
targetPlatform: TargetPlatform.ios,
|
||||
);
|
||||
@@ -306,7 +306,7 @@ Information about project "Runner":
|
||||
testUsingOsxContext('sets TRACK_WIDGET_CREATION=true when trackWidgetCreation is true', () async {
|
||||
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, any)).thenReturn('engine');
|
||||
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm'));
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null,
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null,
|
||||
previewDart2: true,
|
||||
trackWidgetCreation: true,
|
||||
targetPlatform: TargetPlatform.ios,
|
||||
@@ -328,7 +328,7 @@ Information about project "Runner":
|
||||
testUsingOsxContext('does not set TRACK_WIDGET_CREATION when trackWidgetCreation is false', () async {
|
||||
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, any)).thenReturn('engine');
|
||||
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile_arm'));
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null,
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null,
|
||||
previewDart2: true,
|
||||
targetPlatform: TargetPlatform.ios,
|
||||
);
|
||||
@@ -349,7 +349,7 @@ Information about project "Runner":
|
||||
testUsingOsxContext('sets ARCHS=armv7 when armv7 local engine is set', () async {
|
||||
when(mockArtifacts.getArtifactPath(Artifact.flutterFramework, TargetPlatform.ios, any)).thenReturn('engine');
|
||||
when(mockArtifacts.engineOutPath).thenReturn(fs.path.join('out', 'ios_profile'));
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.debug, null,
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.debug, null,
|
||||
previewDart2: true,
|
||||
targetPlatform: TargetPlatform.ios,
|
||||
);
|
||||
@@ -425,7 +425,7 @@ dependencies:
|
||||
flutter:
|
||||
''';
|
||||
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null);
|
||||
await checkBuildVersion(
|
||||
manifestString: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -443,7 +443,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null);
|
||||
await checkBuildVersion(
|
||||
manifestString: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -461,7 +461,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null, buildName: '1.0.2');
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null, buildName: '1.0.2');
|
||||
await checkBuildVersion(
|
||||
manifestString: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -479,7 +479,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null, buildNumber: 3);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null, buildNumber: 3);
|
||||
await checkBuildVersion(
|
||||
manifestString: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -497,7 +497,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
await checkBuildVersion(
|
||||
manifestString: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -515,7 +515,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
await checkBuildVersion(
|
||||
manifestString: manifest,
|
||||
buildInfo: buildInfo,
|
||||
@@ -532,7 +532,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter:
|
||||
''';
|
||||
const BuildInfo buildInfo = const BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
const BuildInfo buildInfo = BuildInfo(BuildMode.release, null, buildName: '1.0.2', buildNumber: 3);
|
||||
await checkBuildVersion(
|
||||
manifestString: manifest,
|
||||
buildInfo: buildInfo,
|
||||
|
||||
@@ -76,7 +76,7 @@ Matcher throwsToolExit({int exitCode, String message}) {
|
||||
}
|
||||
|
||||
/// Matcher for [ToolExit]s.
|
||||
const Matcher isToolExit = const isInstanceOf<ToolExit>();
|
||||
const Matcher isToolExit = isInstanceOf<ToolExit>();
|
||||
|
||||
/// Matcher for functions that throw [ProcessExit].
|
||||
Matcher throwsProcessExit([dynamic exitCode]) {
|
||||
@@ -86,7 +86,7 @@ Matcher throwsProcessExit([dynamic exitCode]) {
|
||||
}
|
||||
|
||||
/// Matcher for [ProcessExit]s.
|
||||
const Matcher isProcessExit = const isInstanceOf<ProcessExit>();
|
||||
const Matcher isProcessExit = isInstanceOf<ProcessExit>();
|
||||
|
||||
/// Creates a flutter project in the [temp] directory using the
|
||||
/// [arguments] list if specified, or `--no-pub` if not.
|
||||
@@ -101,8 +101,8 @@ Future<String> createProject(Directory temp, {List<String> arguments}) async {
|
||||
}
|
||||
|
||||
/// Test case timeout for tests involving remote calls to `pub get` or similar.
|
||||
const Timeout allowForRemotePubInvocation = const Timeout.factor(10.0);
|
||||
const Timeout allowForRemotePubInvocation = Timeout.factor(10.0);
|
||||
|
||||
/// Test case timeout for tests involving creating a Flutter project with
|
||||
/// `--no-pub`. Use [allowForRemotePubInvocation] when creation involves `pub`.
|
||||
const Timeout allowForCreateFlutterProject = const Timeout.factor(3.0);
|
||||
const Timeout allowForCreateFlutterProject = Timeout.factor(3.0);
|
||||
|
||||
@@ -113,7 +113,7 @@ void testUsingContext(String description, dynamic testMethod(), {
|
||||
},
|
||||
);
|
||||
});
|
||||
}, timeout: timeout != null ? timeout : const Timeout(const Duration(seconds: 60)),
|
||||
}, timeout: timeout != null ? timeout : const Timeout(Duration(seconds: 60)),
|
||||
testOn: testOn, skip: skip);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ baz=qux
|
||||
});
|
||||
|
||||
group('Poller', () {
|
||||
const Duration kShortDelay = const Duration(milliseconds: 100);
|
||||
const Duration kShortDelay = Duration(milliseconds: 100);
|
||||
|
||||
Poller poller;
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ void fakeData(
|
||||
|
||||
final Answering<ProcessResult> syncAnswer = (Invocation invocation) {
|
||||
bool argsAre(String a1, [String a2, String a3, String a4, String a5, String a6, String a7, String a8]) {
|
||||
const ListEquality<String> equality = const ListEquality<String>();
|
||||
const ListEquality<String> equality = ListEquality<String>();
|
||||
final List<String> args = invocation.positionalArguments.single;
|
||||
final List<String> expectedArgs =
|
||||
<String>[a1, a2, a3, a4, a5, a6, a7, a8]
|
||||
|
||||
Reference in New Issue
Block a user