Unverified Commit 89427d67 authored by Alexandre Ardhuin's avatar Alexandre Ardhuin Committed by GitHub

add missing trailing commas in flutter_tools (#40968)

parent e9965f56
......@@ -513,8 +513,9 @@ class AndroidDevice extends Device {
await androidBuilder.buildApk(
project: project,
target: mainPath,
androidBuildInfo: AndroidBuildInfo(debuggingOptions.buildInfo,
targetArchs: <AndroidArch>[androidArch]
androidBuildInfo: AndroidBuildInfo(
debuggingOptions.buildInfo,
targetArchs: <AndroidArch>[androidArch],
),
);
// Package has been built, so we can get the updated application ID and
......
......@@ -261,7 +261,7 @@ Future<GradleProject> _readGradleProject({bool isLibrary = false}) async {
project = GradleProject(
<String>['debug', 'profile', 'release'],
<String>[],
fs.path.join(flutterProject.android.hostAppGradleRoot.path, 'app', 'build')
fs.path.join(flutterProject.android.hostAppGradleRoot.path, 'app', 'build'),
);
}
status.stop();
......
......@@ -113,7 +113,7 @@ class BuildRunner extends CodeGenerator {
}
scriptIdFile.writeAsBytesSync(appliedBuilderDigest);
final ProcessResult generateResult = await processManager.run(<String>[
sdkBinaryName('pub'), 'run', 'build_runner', 'generate-build-script'
sdkBinaryName('pub'), 'run', 'build_runner', 'generate-build-script',
], workingDirectory: syntheticPubspec.parent.path);
if (generateResult.exitCode != 0) {
throwToolExit('Error generating build_script snapshot: ${generateResult.stderr}');
......@@ -173,7 +173,7 @@ class BuildRunner extends CodeGenerator {
if (log.message != null) {
printTrace(log.message);
}
}
},
);
} finally {
status.stop();
......
......@@ -190,7 +190,7 @@ final List<core.BuilderApplication> builders = <core.BuilderApplication>[
),
),
core.applyPostProcess('flutter_tools:module_cleanup', moduleCleanup,
defaultGenerateFor: const InputSet())
defaultGenerateFor: const InputSet()),
];
/// The entrypoint to this build script.
......
......@@ -33,7 +33,7 @@ class DwdsWebRunnerFactory extends WebRunnerFactory {
String target,
@required FlutterProject flutterProject,
@required bool ipv6,
@required DebuggingOptions debuggingOptions
@required DebuggingOptions debuggingOptions,
}) {
return ResidentWebRunner(
device,
......
......@@ -131,7 +131,7 @@ class MultirootFileBasedAssetReader extends core.FileBasedAssetReader {
}
}
final String generatedRoot = fs.path.join(
generatedDirectory.path, packageGraph.root.name
generatedDirectory.path, packageGraph.root.name,
);
if (!fs.isDirectorySync(generatedRoot)) {
return;
......
......@@ -254,7 +254,7 @@ class WebFs {
'lib',
'dev_compiler',
'web',
'dart_stack_trace_mapper.js'
'dart_stack_trace_mapper.js',
));
return Response.ok(file.readAsBytesSync(), headers: <String, String>{
'Content-Type': 'text/javascript',
......@@ -266,7 +266,7 @@ class WebFs {
'dev_compiler',
'kernel',
'amd',
'require.js'
'require.js',
));
return Response.ok(file.readAsBytesSync(), headers: <String, String>{
'Content-Type': 'text/javascript',
......@@ -394,9 +394,12 @@ class BuildDaemonCreator {
}
Future<BuildDaemonClient> _connectClient(
String workingDirectory,
{ bool release, bool profile, bool hasPlugins, bool initializePlatform }
) {
String workingDirectory, {
bool release,
bool profile,
bool hasPlugins,
bool initializePlatform,
}) {
final String flutterToolsPackages = fs.path.join(Cache.flutterRoot, 'packages', 'flutter_tools', '.packages');
final String buildScript = fs.path.join(Cache.flutterRoot, 'packages', 'flutter_tools', 'lib', 'src', 'build_runner', 'build_script.dart');
final String flutterWebSdk = artifacts.getArtifactPath(Artifact.flutterWebSdk);
......@@ -417,7 +420,7 @@ class BuildDaemonCreator {
'--define', 'flutter_tools:entrypoint=profile=$profile',
'--define', 'flutter_tools:shell=flutterWebSdk=$flutterWebSdk',
'--define', 'flutter_tools:shell=hasPlugins=$hasPlugins',
'--define', 'flutter_tools:shell=initializePlatform=$initializePlatform'
'--define', 'flutter_tools:shell=initializePlatform=$initializePlatform',
],
logHandler: (ServerLog serverLog) {
switch (serverLog.level) {
......
......@@ -126,7 +126,7 @@ abstract class Target {
<Node>[
for (Target target in dependencies) target._toNode(environment)
],
environment
environment,
);
}
......@@ -390,9 +390,9 @@ class BuildSystem {
/// Build `target` and all of its dependencies.
Future<BuildResult> build(
Target target,
Environment environment,
{ BuildSystemConfig buildSystemConfig = const BuildSystemConfig() }
) async {
Environment environment, {
BuildSystemConfig buildSystemConfig = const BuildSystemConfig(),
}) async {
environment.buildDir.createSync(recursive: true);
environment.outputDir.createSync(recursive: true);
......
......@@ -288,7 +288,7 @@ abstract class MacOSBundleFlutterAssets extends Target {
List<Source> get inputs => const <Source>[
Source.pattern('{PROJECT_DIR}/pubspec.yaml'),
Source.pattern('{BUILD_DIR}/App.framework/App'),
Source.behavior(MacOSAssetBehavior())
Source.behavior(MacOSAssetBehavior()),
];
@override
......
......@@ -44,7 +44,7 @@ class AssembleCommand extends FlutterCommand {
argParser.addMultiOption(
'define',
abbr: 'd',
help: 'Allows passing configuration to a target with --define=target=key=value.'
help: 'Allows passing configuration to a target with --define=target=key=value.',
);
argParser.addOption('build-inputs', help: 'A file path where a newline '
'separated file containing all inputs used will be written after a build.'
......@@ -60,7 +60,7 @@ class AssembleCommand extends FlutterCommand {
);
argParser.addOption(
'resource-pool-size',
help: 'The maximum number of concurrent tasks the build system will run.'
help: 'The maximum number of concurrent tasks the build system will run.',
);
}
......
......@@ -82,7 +82,7 @@ class BuildBundleCommand extends BuildSubCommand {
}
return <CustomDimensions, String>{
CustomDimensions.commandBuildBundleTargetPlatform: argResults['target-platform'],
CustomDimensions.commandBuildBundleIsModule: '${futterProject.isModule}'
CustomDimensions.commandBuildBundleIsModule: '${futterProject.isModule}',
};
}
......
......@@ -24,7 +24,7 @@ class BuildLinuxCommand extends BuildSubCommand {
);
argParser.addFlag('profile',
negatable: false,
help: 'Build a version of your app specialized for performance profiling.'
help: 'Build a version of your app specialized for performance profiling.',
);
argParser.addFlag('release',
negatable: false,
......
......@@ -24,7 +24,7 @@ class BuildWindowsCommand extends BuildSubCommand {
);
argParser.addFlag('profile',
negatable: false,
help: 'Build a version of your app specialized for performance profiling.'
help: 'Build a version of your app specialized for performance profiling.',
);
argParser.addFlag('release',
negatable: false,
......
......@@ -274,7 +274,7 @@ Future<LaunchResult> _startApp(DriveCommand command) async {
command.getBuildInfo(),
startPaused: true,
observatoryPort: command.observatoryPort,
verboseSystemLogs: command.verboseSystemLogs
verboseSystemLogs: command.verboseSystemLogs,
),
platformArgs: platformArgs,
prebuiltApplication: !command.shouldBuild,
......
......@@ -173,7 +173,7 @@ class RunCommand extends RunCommandBase {
negatable: true,
defaultsTo: true,
hide: true,
help: 'Whether to automatically invoke webOnlyInitializePlatform.'
help: 'Whether to automatically invoke webOnlyInitializePlatform.',
)
..addOption(FlutterOptions.kExtraFrontEndOptions, hide: true)
..addOption(FlutterOptions.kExtraGenSnapshotOptions, hide: true)
......
......@@ -50,7 +50,7 @@ class TestCommand extends FastFlutterCommand {
defaultsTo: false,
negatable: false,
help: 'No longer require an authentication code to connect to the VM '
'service (not recommended).'
'service (not recommended).',
)
..addFlag('coverage',
defaultsTo: false,
......@@ -87,7 +87,7 @@ class TestCommand extends FastFlutterCommand {
abbr: 'j',
defaultsTo: math.max<int>(1, platform.numberOfProcessors - 2).toString(),
help: 'The number of concurrent test processes to run.',
valueHelp: 'jobs'
valueHelp: 'jobs',
)
..addFlag('test-assets',
defaultsTo: true,
......@@ -98,7 +98,7 @@ class TestCommand extends FastFlutterCommand {
..addOption('platform',
allowed: const <String>['tester', 'chrome'],
defaultsTo: 'tester',
help: 'The platform to run the unit tests on. Defaults to "tester".'
help: 'The platform to run the unit tests on. Defaults to "tester".',
);
usesTrackWidgetCreation(verboseHelp: verboseHelp);
}
......
......@@ -30,7 +30,7 @@ class FuchsiaDevFinder {
final List<String> command = <String>[
fuchsiaArtifacts.devFinder.path,
'list',
'-full'
'-full',
];
final RunResult result = await processUtils.run(command);
if (result.exitCode != 0) {
......@@ -55,7 +55,7 @@ class FuchsiaDevFinder {
'resolve',
'-local',
'-device-limit', '1',
deviceName
deviceName,
];
final RunResult result = await processUtils.run(command);
if (result.exitCode != 0) {
......
......@@ -459,7 +459,7 @@ class FuchsiaDevice extends Device {
'-F',
fuchsiaArtifacts.sshConfig.absolute.path,
id,
command
command,
]);
}
......@@ -652,7 +652,7 @@ class _FuchsiaPortForwarder extends DevicePortForwarder {
'-vvv',
'-L',
'${forwardedPort.hostPort}:$_ipv4Loopback:${forwardedPort.devicePort}',
device.id
device.id,
];
final ProcessResult result = await processManager.run(command);
if (result.exitCode != 0) {
......
......@@ -77,7 +77,7 @@ class FuchsiaSdk {
'-F',
fuchsiaArtifacts.sshConfig.absolute.path,
id,
remoteCommand
remoteCommand,
];
processManager.start(cmd).then((Process newProcess) {
if (controller.isClosed) {
......
......@@ -133,7 +133,7 @@ class IOSDevice extends Device {
);
_iproxyPath = artifacts.getArtifactPath(
Artifact.iproxy,
platform: TargetPlatform.ios
platform: TargetPlatform.ios,
);
}
......
......@@ -111,7 +111,7 @@ class IMobileDevice {
_isInstalled ??= processUtils.exitsHappySync(
<String>[
_ideviceIdPath,
'-h'
'-h',
],
environment: Map<String, String>.fromEntries(
<MapEntry<String, String>>[cache.dyLdLibEntry]
......@@ -141,7 +141,7 @@ class IMobileDevice {
<String>[
_ideviceinfoPath,
'-u',
fakeIphoneId
fakeIphoneId,
],
environment: executionEnv,
)).processResult;
......@@ -176,7 +176,7 @@ class IMobileDevice {
final ProcessResult result = await processManager.run(
<String>[
_ideviceIdPath,
'-l'
'-l',
],
environment: Map<String, String>.fromEntries(
<MapEntry<String, String>>[cache.dyLdLibEntry]
......@@ -199,7 +199,7 @@ class IMobileDevice {
'-u',
deviceID,
'-k',
key
key,
],
environment: Map<String, String>.fromEntries(
<MapEntry<String, String>>[cache.dyLdLibEntry]
......@@ -250,7 +250,7 @@ class IMobileDevice {
return processUtils.run(
<String>[
_idevicescreenshotPath,
outputFile.path
outputFile.path,
],
throwOnError: true,
environment: Map<String, String>.fromEntries(
......
......@@ -373,7 +373,7 @@ class IOSSimulator extends Device {
if (debuggingOptions.skiaDeterministicRendering) '--skia-deterministic-rendering',
if (debuggingOptions.useTestFonts) '--use-test-fonts',
'--observatory-port=${debuggingOptions.observatoryPort ?? 0}',
]
],
];
ProtocolDiscovery observatoryDiscovery;
......
......@@ -59,7 +59,7 @@ Future<void> updateGeneratedXcodeProperties({
targetOverride: targetOverride,
useMacOSConfig: useMacOSConfig,
setSymroot: setSymroot,
buildDirOverride: buildDirOverride
buildDirOverride: buildDirOverride,
);
_updateGeneratedXcodePropertiesFile(
......@@ -327,7 +327,7 @@ class XcodeProjectInterpreter {
'-scheme',
scheme,
'-quiet',
'clean'
'clean',
], workingDirectory: fs.currentDirectory.path);
}
......
......@@ -108,8 +108,9 @@ abstract class Usage {
///
/// Note that using [command] above is preferred to ensure that the parameter
/// keys are well-defined in [CustomDimensions] above.
void sendCommand(String command, {
Map<String, String> parameters
void sendCommand(
String command, {
Map<String, String> parameters,
});
/// Sends an 'event' to the underlying analytics implementation.
......@@ -118,13 +119,18 @@ abstract class Usage {
/// event types defined in this directory in events.dart.
@visibleForOverriding
@visibleForTesting
void sendEvent(String category, String parameter, {
Map<String, String> parameters
void sendEvent(
String category,
String parameter, {
Map<String, String> parameters,
});
/// Sends timing information to the underlying analytics implementation.
void sendTiming(String category, String variableName, Duration duration, {
String label
void sendTiming(
String category,
String variableName,
Duration duration, {
String label,
});
/// Sends an exception to the underlying analytics implementation.
......
......@@ -384,7 +384,7 @@ class HotRunner extends ResidentRunner {
Future<OperationResult> _restartFromSources({
String reason,
bool benchmarkMode = false
bool benchmarkMode = false,
}) async {
if (!_isPaused()) {
printTrace('Refreshing active FlutterViews before restarting.');
......@@ -520,7 +520,7 @@ class HotRunner extends ResidentRunner {
bool fullRestart = false,
bool pauseAfterRestart = false,
String reason,
bool benchmarkMode = false
bool benchmarkMode = false,
}) async {
String targetPlatform;
String sdkName;
......@@ -663,7 +663,7 @@ class HotRunner extends ResidentRunner {
bool emulator,
bool pause = false,
String reason,
void Function(String message) onSlow
void Function(String message) onSlow,
}) async {
for (FlutterDevice device in flutterDevices) {
for (FlutterView view in device.views) {
......
......@@ -293,7 +293,7 @@ abstract class FlutterCommand extends Command<void> {
'which shortens the names of your app’s classes and members, '
'and optimization, which applies more aggressive strategies to '
'further reduce the size of your app.'
'To learn more, see: https://developer.android.com/studio/build/shrink-code'
'To learn more, see: https://developer.android.com/studio/build/shrink-code',
);
}
......
......@@ -94,7 +94,7 @@ FlutterPlatform installHook({
Uri projectRootDirectory,
FlutterProject flutterProject,
String icudtlPath,
PlatformPluginRegistration platformPluginRegistration
PlatformPluginRegistration platformPluginRegistration,
}) {
assert(enableObservatory || (!startPaused && observatoryPort == null));
......@@ -104,7 +104,7 @@ FlutterPlatform installHook({
<Runtime>[Runtime.vm],
() {
return platform;
}
},
);
};
final FlutterPlatform platform = FlutterPlatform(
......
......@@ -248,7 +248,7 @@ class FlutterWebPlatform extends PlatformPlugin {
.resolve('static/index.html')
.replace(queryParameters: <String, String>{
'managerUrl': webSocketUrl.toString(),
'debug': _config.pauseAfterLoad.toString()
'debug': _config.pauseAfterLoad.toString(),
});
printTrace('Serving tests at $hostUrl');
......@@ -551,12 +551,16 @@ class BrowserManager {
/// If [mapper] is passed, it's used to map stack traces for errors coming
/// from this test suite.
Future<RunnerSuite> load(
String path, Uri url, SuiteConfiguration suiteConfig, Object message,
{StackTraceMapper mapper}) async {
String path,
Uri url,
SuiteConfiguration suiteConfig,
Object message, {
StackTraceMapper mapper,
}) async {
url = url.replace(
fragment: Uri.encodeFull(jsonEncode(<String, Object>{
'metadata': suiteConfig.metadata.serialize(),
'browser': _runtime.identifier
'browser': _runtime.identifier,
})));
final int suiteID = _suiteID++;
......@@ -585,7 +589,7 @@ class BrowserManager {
'command': 'loadSuite',
'url': url.toString(),
'id': suiteID,
'channel': suiteChannelID
'channel': suiteChannelID,
});
try {
......
......@@ -84,7 +84,7 @@ Future<int> runTests(
<Runtime>[Runtime.chrome],
() {
return FlutterWebPlatform.start(flutterProject.directory.path);
}
},
);
await test.main(testArgs);
return exitCode;
......
......@@ -35,7 +35,7 @@ const String kWindowsExecutable = r'Google\Chrome\Application\chrome.exe';
final List<String> kWindowsPrefixes = <String>[
platform.environment['LOCALAPPDATA'],
platform.environment['PROGRAMFILES'],
platform.environment['PROGRAMFILES(X86)']
platform.environment['PROGRAMFILES(X86)'],
];
/// Find the chrome executable on the current platform.
......
......@@ -46,7 +46,7 @@ Future<void> buildWeb(FlutterProject flutterProject, String target, BuildInfo bu
'build',
'flutter_web',
flutterProject.manifest.appName,
'${fs.path.withoutExtension(target)}_web_entrypoint.dart.js'
'${fs.path.withoutExtension(target)}_web_entrypoint.dart.js',
);
fs.file(outputPath).copySync(fs.path.join(outputDir.path, 'main.dart.js'));
fs.file('$outputPath.map').copySync(fs.path.join(outputDir.path, 'main.dart.js.map'));
......
......@@ -98,7 +98,7 @@ class ChromeDevice extends Device {
String version = 'unknown';
if (platform.isWindows) {
final ProcessResult result = await processManager.run(<String>[
r'reg', 'query', 'HKEY_CURRENT_USER\\Software\\Google\\Chrome\\BLBeacon', '/v', 'version'
r'reg', 'query', 'HKEY_CURRENT_USER\\Software\\Google\\Chrome\\BLBeacon', '/v', 'version',
]);
if (result.exitCode == 0) {
final List<String> parts = result.stdout.split(RegExp(r'\s+'));
......
......@@ -21,6 +21,6 @@ abstract class WebRunnerFactory {
String target,
@required FlutterProject flutterProject,
@required bool ipv6,
@required DebuggingOptions debuggingOptions
@required DebuggingOptions debuggingOptions,
});
}
......@@ -51,7 +51,7 @@ class VisualStudioValidator extends DoctorValidator {
messages.add(ValidationMessage.error(
userMessages.visualStudioMissingComponents(
visualStudio.workloadDescription,
visualStudio.necessaryComponentDescriptions(majorVersion)
visualStudio.necessaryComponentDescriptions(majorVersion),
)
));
}
......@@ -61,7 +61,7 @@ class VisualStudioValidator extends DoctorValidator {
messages.add(ValidationMessage.error(
userMessages.visualStudioMissing(
visualStudio.workloadDescription,
visualStudio.necessaryComponentDescriptions(majorVersion)
visualStudio.necessaryComponentDescriptions(majorVersion),
)
));
}
......
......@@ -67,7 +67,7 @@ void main() {
FlutterVersion: () => FlutterVersion(const SystemClock()),
Usage: () => Usage(
configDirOverride: tempDir.path,
logFile: tempDir.childFile('analytics.log').path
logFile: tempDir.childFile('analytics.log').path,
),
});
......@@ -89,7 +89,7 @@ void main() {
FlutterVersion: () => FlutterVersion(const SystemClock()),
Usage: () => Usage(
configDirOverride: tempDir.path,
logFile: tempDir.childFile('analytics.log').path
logFile: tempDir.childFile('analytics.log').path,
),
});
......
......@@ -328,13 +328,12 @@ someOtherTask
expect(project.apkFilesFor(
const AndroidBuildInfo(
BuildInfo.debug,
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
]
)
),
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
],
)),
<String>[
'app-armeabi-v7a-debug.apk',
'app-arm64-v8a-debug.apk',
......@@ -343,13 +342,12 @@ someOtherTask
expect(project.apkFilesFor(
const AndroidBuildInfo(
BuildInfo.release,
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
]
)
),
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
],
)),
<String>[
'app-armeabi-v7a-release.apk',
'app-arm64-v8a-release.apk',
......@@ -358,26 +356,24 @@ someOtherTask
expect(project.apkFilesFor(
const AndroidBuildInfo(
BuildInfo(BuildMode.release, 'unknown'),
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
]
)
).isEmpty, isTrue);
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
],
)).isEmpty, isTrue);
});
test('should provide apks for each ABI and flavored build types', () {
final GradleProject project = GradleProject(<String>['debug', 'profile', 'release'], <String>['free', 'paid'], '/some/dir');
expect(project.apkFilesFor(
const AndroidBuildInfo(
BuildInfo(BuildMode.debug, 'free'),
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
]
)
),
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
],
)),
<String>[
'app-free-armeabi-v7a-debug.apk',
'app-free-arm64-v8a-debug.apk',
......@@ -386,13 +382,12 @@ someOtherTask
expect(project.apkFilesFor(
const AndroidBuildInfo(
BuildInfo(BuildMode.release, 'paid'),
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
]
)
),
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
],
)),
<String>[
'app-paid-armeabi-v7a-release.apk',
'app-paid-arm64-v8a-release.apk',
......@@ -401,13 +396,12 @@ someOtherTask
expect(project.apkFilesFor(
const AndroidBuildInfo(
BuildInfo(BuildMode.release, 'unknown'),
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
]
)
).isEmpty, isTrue);
splitPerAbi: true,
targetArchs: <AndroidArch>[
AndroidArch.armeabi_v7a,
AndroidArch.arm64_v8a,
],
)).isEmpty, isTrue);
});
test('should provide assemble task name for default build types', () {
final GradleProject project = GradleProject(<String>['debug', 'profile', 'release'], <String>[], '/some/dir');
......@@ -1144,11 +1138,12 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
migrateToR8(sampleAppAndroid);
expect(testLogger.traceText, contains('set `android.enableR8=true` in gradle.properties'));
expect(sampleAppAndroid.childFile('gradle.properties').readAsStringSync(),
expect(
sampleAppAndroid.childFile('gradle.properties').readAsStringSync(),
equals(
'org.gradle.jvmargs=-Xmx1536M\n'
'android.enableR8=true\n'
)
),
);
}, overrides: <Type, Generator>{
FileSystem: () => memoryFileSystem,
......@@ -1246,7 +1241,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
androidBuildInfo: const AndroidBuildInfo(BuildInfo(BuildMode.release, null)),
project: FlutterProject.current(),
outputDir: 'build/',
target: ''
target: '',
);
final List<String> actualGradlewCall = verify(mockProcessManager.start(
......
......@@ -36,7 +36,7 @@ void main() {
test('Can find assets from the generated directory', () => testbed.run(() async {
final MultirootFileBasedAssetReader reader = MultirootFileBasedAssetReader(
packageGraph,
fs.directory(fs.path.join('.dart_tool', 'build', 'generated'))
fs.directory(fs.path.join('.dart_tool', 'build', 'generated')),
);
// Note: we can't read from the regular directory because the default
......
......@@ -102,7 +102,7 @@ void main() {
},
overrides: <Type, Generator>{
Platform: () => mockPlatform,
}
},
);
});
......
......@@ -21,7 +21,7 @@ void main() {
);
final MissingOutputException missingOutputException = MissingOutputException(
<File>[ fs.file('foo'), fs.file('bar') ],
'example'
'example',
);
final MisplacedOutputException misplacedOutputException = MisplacedOutputException(
'foo',
......@@ -38,16 +38,16 @@ void main() {
'but did not exist. Check the definition of target:example for errors');
expect(
cycleException.toString(),
'Dependency cycle detected in build: foo -> bar'
'Dependency cycle detected in build: foo -> bar',
);
expect(
invalidPatternException.toString(),
'The pattern "ABC" is not valid'
'The pattern "ABC" is not valid',
);
expect(
missingOutputException.toString(),
'foo, bar were declared as outputs, but were not generated by the '
'action. Check the definition of target:example for errors'
'action. Check the definition of target:example for errors',
);
expect(
misplacedOutputException.toString(),
......@@ -56,7 +56,7 @@ void main() {
);
expect(
missingDefineException.toString(),
'Target example required define foobar but it was not provided'
'Target example required define foobar but it was not provided',
);
});
}
......
......@@ -44,7 +44,7 @@ void main() {
defines: <String, String>{
kBuildMode: getNameForBuildMode(BuildMode.profile),
kTargetPlatform: getNameForTargetPlatform(TargetPlatform.android_arm),
}
},
);
iosEnvironment = Environment(
outputDir: fs.currentDirectory,
......@@ -52,7 +52,7 @@ void main() {
defines: <String, String>{
kBuildMode: getNameForBuildMode(BuildMode.profile),
kTargetPlatform: getNameForTargetPlatform(TargetPlatform.ios),
}
},
);
HostPlatform hostPlatform;
if (platform.isWindows) {
......@@ -130,7 +130,7 @@ flutter_tools:lib/''');
outputFilePath: anyNamed('outputFilePath'),
depFilePath: anyNamed('depFilePath'),
packagesPath: anyNamed('packagesPath'),
mainPath: anyNamed('mainPath')
mainPath: anyNamed('mainPath'),
)).thenAnswer((Invocation _) async {
return const CompilerOutput('example', 0, <Uri>[]);
});
......@@ -154,7 +154,7 @@ flutter_tools:lib/''');
outputFilePath: anyNamed('outputFilePath'),
depFilePath: anyNamed('depFilePath'),
packagesPath: anyNamed('packagesPath'),
mainPath: anyNamed('mainPath')
mainPath: anyNamed('mainPath'),
)).thenAnswer((Invocation _) async {
return const CompilerOutput('example', 0, <Uri>[]);
});
......
......@@ -73,7 +73,7 @@ void main() {
defines: <String, String>{
kBuildMode: 'debug',
kTargetPlatform: 'darwin-x64',
}
},
);
}, overrides: <Type, Generator>{
ProcessManager: () => MockProcessManager(),
......
......@@ -41,7 +41,7 @@ void main() {
device: mockDevice,
generator: residentCompiler,
exception: const HttpException('Connection closed before full header was received, '
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws')
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'),
),
];
......@@ -68,7 +68,7 @@ void main() {
TestFlutterDevice(
device: mockDevice,
generator: residentCompiler,
exception: const HttpException(', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws')
exception: const HttpException(', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'),
),
];
......@@ -96,7 +96,7 @@ class TestFlutterDevice extends FlutterDevice {
TestFlutterDevice({
@required Device device,
@required this.exception,
@required ResidentCompiler generator
@required ResidentCompiler generator,
}) : assert(exception != null),
super(device, buildMode: BuildMode.debug, generator: generator, trackWidgetCreation: false);
......
......@@ -258,9 +258,9 @@ void main() {
}
Future<BuildApkCommand> runBuildApkCommand(
String target,
{ List<String> arguments }
) async {
String target, {
List<String> arguments,
}) async {
final BuildApkCommand command = BuildApkCommand();
final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>[
......
......@@ -247,9 +247,9 @@ void main() {
}
Future<BuildAppBundleCommand> runBuildAppBundleCommand(
String target,
{ List<String> arguments }
) async {
String target, {
List<String> arguments,
}) async {
final BuildAppBundleCommand command = BuildAppBundleCommand();
final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>[
......
......@@ -103,7 +103,7 @@ void main() {
expect(() => runner.run(<String>[
'bundle',
'--no-pub',
'--target-platform=windows-x64'
'--target-platform=windows-x64',
]), throwsA(isInstanceOf<ToolExit>()));
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem(),
......@@ -120,7 +120,7 @@ void main() {
expect(() => runner.run(<String>[
'bundle',
'--no-pub',
'--target-platform=linux-x64'
'--target-platform=linux-x64',
]), throwsA(isInstanceOf<ToolExit>()));
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem(),
......@@ -137,7 +137,7 @@ void main() {
expect(() => runner.run(<String>[
'bundle',
'--no-pub',
'--target-platform=darwin-x64'
'--target-platform=darwin-x64',
]), throwsA(isInstanceOf<ToolExit>()));
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem(),
......@@ -154,7 +154,7 @@ void main() {
await runner.run(<String>[
'bundle',
'--no-pub',
'--target-platform=windows-x64'
'--target-platform=windows-x64',
]);
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem(),
......@@ -171,7 +171,7 @@ void main() {
await runner.run(<String>[
'bundle',
'--no-pub',
'--target-platform=linux-x64'
'--target-platform=linux-x64',
]);
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem(),
......@@ -188,7 +188,7 @@ void main() {
await runner.run(<String>[
'bundle',
'--no-pub',
'--target-platform=darwin-x64'
'--target-platform=darwin-x64',
]);
}, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem(),
......
......@@ -44,7 +44,7 @@ void main() {
projectName: anyNamed('projectName'),
projectDirectory: anyNamed('projectDirectory'),
mode: anyNamed('mode'),
initializePlatform: anyNamed('initializePlatform')
initializePlatform: anyNamed('initializePlatform'),
)).thenAnswer((Invocation invocation) {
final String path = fs.path.join('.dart_tool', 'build', 'flutter_web', 'foo', 'lib', 'main_web_entrypoint.dart.js');
fs.file(path).createSync(recursive: true);
......
......@@ -61,7 +61,7 @@ void main() {
await commandRunner.run(<String>[
'config',
'--build-dir=foo'
'--build-dir=foo',
]);
expect(getBuildDirectory(), 'foo');
......@@ -73,7 +73,7 @@ void main() {
expect(() => commandRunner.run(<String>[
'config',
'--build-dir=/foo'
'--build-dir=/foo',
]), throwsA(isInstanceOf<ToolExit>()));
});
......@@ -86,7 +86,7 @@ void main() {
'--enable-web',
'--enable-linux-desktop',
'--enable-windows-desktop',
'--enable-macos-desktop'
'--enable-macos-desktop',
]);
expect(Config.instance.getValue('enable-web'), true);
......@@ -108,7 +108,7 @@ void main() {
'--no-enable-web',
'--no-enable-linux-desktop',
'--no-enable-windows-desktop',
'--no-enable-macos-desktop'
'--no-enable-macos-desktop',
]);
expect(Config.instance.getValue('enable-web'), false);
......@@ -131,7 +131,7 @@ void main() {
'--enable-web',
'--enable-linux-desktop',
'--enable-windows-desktop',
'--enable-macos-desktop'
'--enable-macos-desktop',
]);
await commandRunner.run(<String>[
......
......@@ -140,18 +140,21 @@ void main() {
await _createAndAnalyzeProject(
projectDir,
<String>[
'-i', 'objc', '-a', 'java'
], <String>[
'android/app/src/main/java/com/example/flutter_project/MainActivity.java',
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java',
'flutter_project.iml',
'ios/Flutter/AppFrameworkInfo.plist',
'ios/Runner/AppDelegate.m',
'ios/Runner/GeneratedPluginRegistrant.h',
], unexpectedPaths: <String>[
'.android/',
'.ios/',
]);
'-i', 'objc', '-a', 'java',
],
<String>[
'android/app/src/main/java/com/example/flutter_project/MainActivity.java',
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java',
'flutter_project.iml',
'ios/Flutter/AppFrameworkInfo.plist',
'ios/Runner/AppDelegate.m',
'ios/Runner/GeneratedPluginRegistrant.h',
],
unexpectedPaths: <String>[
'.android/',
'.ios/',
],
);
}, timeout: allowForRemotePubInvocation);
testUsingContext('detects and recreates an app project correctly', () async {
......@@ -160,18 +163,21 @@ void main() {
await _createAndAnalyzeProject(
projectDir,
<String>[
'-i', 'objc', '-a', 'java'
], <String>[
'android/app/src/main/java/com/example/flutter_project/MainActivity.java',
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java',
'flutter_project.iml',
'ios/Flutter/AppFrameworkInfo.plist',
'ios/Runner/AppDelegate.m',
'ios/Runner/GeneratedPluginRegistrant.h',
], unexpectedPaths: <String>[
'.android/',
'.ios/',
]);
'-i', 'objc', '-a', 'java',
],
<String>[
'android/app/src/main/java/com/example/flutter_project/MainActivity.java',
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java',
'flutter_project.iml',
'ios/Flutter/AppFrameworkInfo.plist',
'ios/Runner/AppDelegate.m',
'ios/Runner/GeneratedPluginRegistrant.h',
],
unexpectedPaths: <String>[
'.android/',
'.ios/',
],
);
}, timeout: allowForRemotePubInvocation);
testUsingContext('detects and recreates a plugin project correctly', () async {
......@@ -180,8 +186,9 @@ void main() {
return _createAndAnalyzeProject(
projectDir,
<String>[
'-i', 'objc', '-a', 'java'
], <String>[
'-i', 'objc', '-a', 'java',
],
<String>[
'android/src/main/java/com/example/flutter_project/FlutterProjectPlugin.java',
'example/android/app/src/main/java/com/example/flutter_project_example/MainActivity.java',
'example/ios/Runner/AppDelegate.h',
......@@ -921,7 +928,7 @@ void main() {
'--template=app',
'--org', 'com.bar.foo',
'-i', 'objc',
'-a', 'java'
'-a', 'java',
],
<String>[],
);
......
......@@ -243,7 +243,7 @@ Future<ProcessResult> _runFlutterTest(
'test',
'--no-color',
...extraArguments,
testPath
testPath,
];
while (_testExclusionLock != null) {
......
......@@ -88,14 +88,14 @@ void main() {
expect(() => installHook(
shellPath: 'abc',
enableObservatory: false,
startPaused: true
startPaused: true,
), throwsA(isA<AssertionError>()));
expect(() => installHook(
shellPath: 'abc',
enableObservatory: false,
startPaused: false,
observatoryPort: 123
observatoryPort: 123,
), throwsA(isA<AssertionError>()));
FlutterPlatform capturedPlatform;
......
......@@ -12,7 +12,7 @@ void main() {
test('no imports of commands/* or test/* in lib/src/*', () {
final List<String> skippedPaths = <String> [
fs.path.join(flutterTools, 'lib', 'src', 'commands'),
fs.path.join(flutterTools, 'lib', 'src', 'test')
fs.path.join(flutterTools, 'lib', 'src', 'test'),
];
bool _isNotSkipped(FileSystemEntity entity) => skippedPaths.every((String path) => !entity.path.startsWith(path));
......
......@@ -290,7 +290,7 @@ void main() {
device: mockDevice,
generator: residentCompiler,
exception: const HttpException('Connection closed before full header was received, '
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws')
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'),
),
];
......@@ -319,7 +319,7 @@ void main() {
TestFlutterDevice(
device: mockDevice,
generator: residentCompiler,
exception: const HttpException(', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws')
exception: const HttpException(', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'),
),
];
......@@ -353,7 +353,7 @@ class TestFlutterDevice extends FlutterDevice {
TestFlutterDevice({
@required Device device,
@required this.exception,
@required ResidentCompiler generator
@required ResidentCompiler generator,
}) : assert(exception != null),
super(device, buildMode: BuildMode.debug, generator: generator, trackWidgetCreation: false);
......
......@@ -65,8 +65,8 @@ void main() {
for (Platform platform in unsupportedPlatforms) {
testUsingContext('throws UnsupportedError exception if instantiated on ${platform.operatingSystem}', () {
expect(
() { IOSDevice('device-123'); },
throwsA(isInstanceOf<AssertionError>())
() { IOSDevice('device-123'); },
throwsA(isInstanceOf<AssertionError>()),
);
}, overrides: <Type, Generator>{
Platform: () => platform,
......@@ -95,7 +95,7 @@ void main() {
// const String appId = '789';
const MapEntry<String, String> libraryEntry = MapEntry<String, String>(
'DYLD_LIBRARY_PATH',
'/path/to/libraries'
'/path/to/libraries',
);
final Map<String, String> env = Map<String, String>.fromEntries(
<MapEntry<String, String>>[libraryEntry]
......@@ -149,7 +149,7 @@ void main() {
when(mockProcessManager.run(
installArgs,
workingDirectory: anyNamed('workingDirectory'),
environment: env
environment: env,
)).thenAnswer(
(_) => Future<ProcessResult>.value(ProcessResult(1, 0, '', ''))
);
......@@ -381,8 +381,8 @@ void main() {
const String installerPath = '/path/to/ideviceinstaller';
const String appId = '789';
const MapEntry<String, String> libraryEntry = MapEntry<String, String>(
'DYLD_LIBRARY_PATH',
'/path/to/libraries'
'DYLD_LIBRARY_PATH',
'/path/to/libraries',
);
final Map<String, String> env = Map<String, String>.fromEntries(
<MapEntry<String, String>>[libraryEntry]
......
......@@ -56,7 +56,7 @@ void main() {
testUsingContext('isWorking returns false if libimobiledevice is not installed', () async {
when(mockProcessManager.runSync(
<String>[ideviceIdPath, '-h'], environment: anyNamed('environment')
<String>[ideviceIdPath, '-h'], environment: anyNamed('environment'),
)).thenReturn(ProcessResult(123, 1, '', ''));
expect(await iMobileDevice.isWorking, false);
}, overrides: <Type, Generator>{
......
......@@ -96,7 +96,7 @@ void main() {
expect(result.type, ValidationType.missing);
expect(result.messages, <ValidationMessage>[
ValidationMessage('clang++ 4.0.1'),
ValidationMessage.error('make is not installed')
ValidationMessage.error('make is not installed'),
]);
}, overrides: <Type, Generator>{
ProcessManager: () => processManager,
......
......@@ -113,7 +113,7 @@ void main() {
}, overrides: <Type, Generator>{
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
Platform: () => mockPlatform,
ProcessManager: () => mockProcessManager
ProcessManager: () => mockProcessManager,
});
testUsingContext('isInstalledAndMeetsVersionCheck is false when no xcode-select', () {
......@@ -130,7 +130,7 @@ void main() {
}, overrides: <Type, Generator>{
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
Platform: () => mockPlatform,
ProcessManager: () => mockProcessManager
ProcessManager: () => mockProcessManager,
});
testUsingContext('isInstalledAndMeetsVersionCheck is false when version not satisfied', () {
......@@ -147,7 +147,7 @@ void main() {
}, overrides: <Type, Generator>{
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
Platform: () => mockPlatform,
ProcessManager: () => mockProcessManager
ProcessManager: () => mockProcessManager,
});
testUsingContext('isInstalledAndMeetsVersionCheck is true when macOS and installed and version is satisfied', () {
......@@ -164,7 +164,7 @@ void main() {
}, overrides: <Type, Generator>{
XcodeProjectInterpreter: () => mockXcodeProjectInterpreter,
Platform: () => mockPlatform,
ProcessManager: () => mockProcessManager
ProcessManager: () => mockProcessManager,
});
testUsingContext('eulaSigned is false when clang is not installed', () {
......
......@@ -93,7 +93,7 @@ void main() {
when(mockFlutterDevice.connect(
reloadSources: anyNamed('reloadSources'),
restart: anyNamed('restart'),
compileExpression: anyNamed('compileExpression')
compileExpression: anyNamed('compileExpression'),
)).thenAnswer((Invocation invocation) async { });
when(mockFlutterDevice.setupDevFS(any, any, packagesFilePath: anyNamed('packagesFilePath')))
.thenAnswer((Invocation invocation) async {
......@@ -223,7 +223,7 @@ void main() {
expect(verify(flutterUsage.sendEvent('hot', 'reload',
parameters: captureAnyNamed('parameters'))).captured[0],
containsPair(cdKey(CustomDimensions.hotEventTargetPlatform),
getNameForTargetPlatform(TargetPlatform.android_arm))
getNameForTargetPlatform(TargetPlatform.android_arm)),
);
}, overrides: <Type, Generator>{
Usage: () => MockUsage(),
......@@ -253,7 +253,7 @@ void main() {
expect(verify(flutterUsage.sendEvent('hot', 'restart',
parameters: captureAnyNamed('parameters'))).captured[0],
containsPair(cdKey(CustomDimensions.hotEventTargetPlatform),
getNameForTargetPlatform(TargetPlatform.android_arm))
getNameForTargetPlatform(TargetPlatform.android_arm)),
);
}, overrides: <Type, Generator>{
Usage: () => MockUsage(),
......
......@@ -155,7 +155,10 @@ void main() {
expect(result.code, 0);
// ensure that analytics are sent.
verify(Usage.instance.sendEvent('hot', 'restart', parameters: <String, String>{
'cd27': 'web-javascript', 'cd28': null, 'cd29': 'false', 'cd30': 'true'
'cd27': 'web-javascript',
'cd28': null,
'cd29': 'false',
'cd30': 'true',
})).called(1);
}, overrides: <Type, Generator>{
Usage: () => MockFlutterUsage(),
......@@ -179,7 +182,10 @@ void main() {
expect(result.code, 0);
// ensure that analytics are sent.
verify(Usage.instance.sendEvent('hot', 'restart', parameters: <String, String>{
'cd27': 'web-javascript', 'cd28': null, 'cd29': 'false', 'cd30': 'true'
'cd27': 'web-javascript',
'cd28': null,
'cd29': 'false',
'cd30': 'true',
})).called(1);
}, overrides: <Type, Generator>{
Usage: () => MockFlutterUsage(),
......
......@@ -149,7 +149,7 @@ void main() {
'flutter',
'dummy',
const Duration(milliseconds: 1000),
null
null,
],
);
},
......
......@@ -134,13 +134,18 @@ class CrashingUsage implements Usage {
_impl.sendCommand(command, parameters: parameters);
@override
void sendEvent(String category, String parameter, {
Map<String, String> parameters
void sendEvent(
String category,
String parameter, {
Map<String, String> parameters,
}) => _impl.sendEvent(category, parameter, parameters: parameters);
@override
void sendTiming(String category, String variableName, Duration duration, {
String label
void sendTiming(
String category,
String variableName,
Duration duration, {
String label,
}) => _impl.sendTiming(category, variableName, duration, label: label);
@override
......
......@@ -55,7 +55,7 @@ void main() {
'--no-default-browser-check',
'--disable-default-apps',
'--disable-translate',
'example_url'
'example_url',
])).thenAnswer((Invocation invocation) async {
return FakeProcess(
exitCode: Completer<int>().future,
......
......@@ -81,7 +81,7 @@ void main() {
bool enableDebugExtension}) async {
return mockDwds;
},
}
},
);
});
......
......@@ -43,7 +43,7 @@ void main() {
'isPrerelease': false,
'catalog': <String, dynamic>{
'productDisplayVersion': '15.9.12',
}
},
};
// A version of a response that doesn't include certain installation status
......@@ -54,7 +54,7 @@ void main() {
'installationVersion': '15.9.28307.665',
'catalog': <String, dynamic>{
'productDisplayVersion': '15.9.12',
}
},
};
// Arguments for a vswhere query to search for an installation with the required components.
......
......@@ -112,7 +112,7 @@ void main() {
final ValidationMessage expectedMessage = ValidationMessage.error(
userMessages.visualStudioMissing(
visualStudio.workloadDescription,
visualStudio.necessaryComponentDescriptions(validator.majorVersion)
visualStudio.necessaryComponentDescriptions(validator.majorVersion),
)
);
expect(result.messages.contains(expectedMessage), true);
......
......@@ -40,7 +40,7 @@ class MockApplicationPackageStore extends ApplicationPackageStore {
versionCode: 1,
launchActivity: 'io.flutter.android.mock.MockActivity',
),
iOS: BuildableIOSApp(MockIosProject(), MockIosProject.bundleId)
iOS: BuildableIOSApp(MockIosProject(), MockIosProject.bundleId),
);
}
......
......@@ -34,7 +34,7 @@ final Map<Type, Generator> _testbedDefaults = <Type, Generator>{
OperatingSystemUtils: () => FakeOperatingSystemUtils(),
OutputPreferences: () => OutputPreferences(showColor: false), // configures BufferLogger to avoid color codes.
Usage: () => NoOpUsage(), // prevent addition of analytics from burdening test mocks
FlutterVersion: () => FakeFlutterVersion() // prevent requirement to mock git for test runner.
FlutterVersion: () => FakeFlutterVersion(), // prevent requirement to mock git for test runner.
};
/// Manages interaction with the tool injection and runner system.
......@@ -110,7 +110,7 @@ class Testbed {
final Timer result = parent.createPeriodicTimer(zone, period, timer);
timers[result] = StackTrace.current;
return result;
}
},
),
body: () async {
Cache.flutterRoot = '';
......
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