forked from firka/flutter
indent formal parameters correctly (#41644)
This commit is contained in:
committed by
GitHub
parent
dc03c44321
commit
890b939401
@@ -224,10 +224,11 @@ class AndroidDevice extends Device {
|
||||
}
|
||||
|
||||
String runAdbCheckedSync(
|
||||
List<String> params, {
|
||||
String workingDirectory,
|
||||
bool allowReentrantFlutter = false,
|
||||
Map<String, String> environment}) {
|
||||
List<String> params, {
|
||||
String workingDirectory,
|
||||
bool allowReentrantFlutter = false,
|
||||
Map<String, String> environment,
|
||||
}) {
|
||||
return processUtils.runSync(
|
||||
adbCommandForDevice(params),
|
||||
throwOnError: true,
|
||||
@@ -239,10 +240,10 @@ class AndroidDevice extends Device {
|
||||
}
|
||||
|
||||
Future<RunResult> runAdbCheckedAsync(
|
||||
List<String> params, {
|
||||
String workingDirectory,
|
||||
bool allowReentrantFlutter = false,
|
||||
}) async {
|
||||
List<String> params, {
|
||||
String workingDirectory,
|
||||
bool allowReentrantFlutter = false,
|
||||
}) async {
|
||||
return processUtils.run(
|
||||
adbCommandForDevice(params),
|
||||
throwOnError: true,
|
||||
|
||||
@@ -79,9 +79,10 @@ import 'dart:async';
|
||||
/// [onError] must have type `FutureOr<T> Function(Object error)` or
|
||||
/// `FutureOr<T> Function(Object error, StackTrace stackTrace)` otherwise an
|
||||
/// [ArgumentError] will be thrown synchronously.
|
||||
Future<T> asyncGuard<T>(Future<T> Function() fn, {
|
||||
Function onError,
|
||||
}) {
|
||||
Future<T> asyncGuard<T>(
|
||||
Future<T> Function() fn, {
|
||||
Function onError,
|
||||
}) {
|
||||
if (onError != null &&
|
||||
onError is! _UnaryOnError<T> &&
|
||||
onError is! _BinaryOnError<T>) {
|
||||
|
||||
@@ -71,12 +71,10 @@ void ensureDirectoryExists(String filePath) {
|
||||
/// Skips files if [shouldCopyFile] returns `false`.
|
||||
void copyDirectorySync(
|
||||
Directory srcDir,
|
||||
Directory destDir,
|
||||
{
|
||||
bool shouldCopyFile(File srcFile, File destFile),
|
||||
void onFileCopied(File srcFile, File destFile),
|
||||
}
|
||||
) {
|
||||
Directory destDir, {
|
||||
bool shouldCopyFile(File srcFile, File destFile),
|
||||
void onFileCopied(File srcFile, File destFile),
|
||||
}) {
|
||||
if (!srcDir.existsSync()) {
|
||||
throw Exception('Source directory "${srcDir.path}" does not exist, nothing to copy');
|
||||
}
|
||||
|
||||
@@ -629,8 +629,14 @@ void verifyOutputDirectories(List<File> outputs, Environment environment, Target
|
||||
|
||||
/// A node in the build graph.
|
||||
class Node {
|
||||
Node(this.target, this.inputs, this.outputs, this.dependencies,
|
||||
Environment environment, this.missingDepfile) {
|
||||
Node(
|
||||
this.target,
|
||||
this.inputs,
|
||||
this.outputs,
|
||||
this.dependencies,
|
||||
Environment environment,
|
||||
this.missingDepfile,
|
||||
) {
|
||||
final File stamp = target._findStampFile(environment);
|
||||
|
||||
// If the stamp file doesn't exist, we haven't run this step before and
|
||||
|
||||
@@ -215,8 +215,7 @@ abstract class Source {
|
||||
/// The source is provided by an [Artifact].
|
||||
///
|
||||
/// If [artifact] points to a directory then all child files are included.
|
||||
const factory Source.artifact(Artifact artifact, {TargetPlatform platform,
|
||||
BuildMode mode}) = _ArtifactSource;
|
||||
const factory Source.artifact(Artifact artifact, {TargetPlatform platform, BuildMode mode}) = _ArtifactSource;
|
||||
|
||||
/// The source is provided by a depfile generated at runtime.
|
||||
///
|
||||
|
||||
@@ -92,8 +92,7 @@ class FuchsiaAmberCtl {
|
||||
|
||||
/// Instructs the pkg_resolver instance running on [device] to prefetch the
|
||||
/// package [packageName].
|
||||
Future<bool> pkgCtlResolve(FuchsiaDevice device, FuchsiaPackageServer server,
|
||||
String packageName) async {
|
||||
Future<bool> pkgCtlResolve(FuchsiaDevice device, FuchsiaPackageServer server, String packageName) async {
|
||||
final String packageUrl = 'fuchsia-pkg://${server.name}/$packageName';
|
||||
final RunResult result = await device.shell('pkgctl resolve $packageUrl');
|
||||
return result.exitCode == 0;
|
||||
|
||||
@@ -34,10 +34,11 @@ Future<void> _timedBuildStep(String name, Future<void> Function() action) async
|
||||
// 2. Create a manifest file for assets.
|
||||
// 3. Using these manifests, use the Fuchsia SDK 'pm' tool to create the
|
||||
// Fuchsia package.
|
||||
Future<void> buildFuchsia(
|
||||
{@required FuchsiaProject fuchsiaProject,
|
||||
@required String target, // E.g., lib/main.dart
|
||||
BuildInfo buildInfo = BuildInfo.debug}) async {
|
||||
Future<void> buildFuchsia({
|
||||
@required FuchsiaProject fuchsiaProject,
|
||||
@required String target, // E.g., lib/main.dart
|
||||
BuildInfo buildInfo = BuildInfo.debug,
|
||||
}) async {
|
||||
final Directory outDir = fs.directory(getFuchsiaBuildDirectory());
|
||||
if (!outDir.existsSync()) {
|
||||
outDir.createSync(recursive: true);
|
||||
@@ -53,9 +54,10 @@ Future<void> buildFuchsia(
|
||||
}
|
||||
|
||||
Future<void> _buildAssets(
|
||||
FuchsiaProject fuchsiaProject,
|
||||
String target, // lib/main.dart
|
||||
BuildInfo buildInfo) async {
|
||||
FuchsiaProject fuchsiaProject,
|
||||
String target, // lib/main.dart
|
||||
BuildInfo buildInfo,
|
||||
) async {
|
||||
final String assetDir = getAssetBuildDirectory();
|
||||
final AssetBundle assets = await buildAssets(
|
||||
manifestPath: fuchsiaProject.project.pubspecFile.path,
|
||||
@@ -110,9 +112,10 @@ void _rewriteCmx(BuildMode mode, File src, File dst) {
|
||||
|
||||
// TODO(zra): Allow supplying a signing key.
|
||||
Future<void> _buildPackage(
|
||||
FuchsiaProject fuchsiaProject,
|
||||
String target, // lib/main.dart
|
||||
BuildInfo buildInfo) async {
|
||||
FuchsiaProject fuchsiaProject,
|
||||
String target, // lib/main.dart
|
||||
BuildInfo buildInfo,
|
||||
) async {
|
||||
final String outDir = getFuchsiaBuildDirectory();
|
||||
final String pkgDir = fs.path.join(outDir, 'pkg');
|
||||
final String appName = fuchsiaProject.project.manifest.appName;
|
||||
|
||||
@@ -498,9 +498,9 @@ class FuchsiaDevice extends Device {
|
||||
return null;
|
||||
}
|
||||
|
||||
FuchsiaIsolateDiscoveryProtocol getIsolateDiscoveryProtocol(
|
||||
String isolateName) =>
|
||||
FuchsiaIsolateDiscoveryProtocol(this, isolateName);
|
||||
FuchsiaIsolateDiscoveryProtocol getIsolateDiscoveryProtocol(String isolateName) {
|
||||
return FuchsiaIsolateDiscoveryProtocol(this, isolateName);
|
||||
}
|
||||
|
||||
@override
|
||||
bool isSupportedForProject(FlutterProject flutterProject) {
|
||||
|
||||
@@ -58,8 +58,7 @@ class FuchsiaPM {
|
||||
///
|
||||
/// where $APPNAME is the same [appName] passed to [init], and meta/package
|
||||
/// is set up to be the file `meta/package` created by [init].
|
||||
Future<bool> build(
|
||||
String buildPath, String keyPath, String manifestPath) {
|
||||
Future<bool> build(String buildPath, String keyPath, String manifestPath) {
|
||||
return _runPMCommand(<String>[
|
||||
'-o',
|
||||
buildPath,
|
||||
|
||||
@@ -279,7 +279,8 @@ class XcodeProjectInterpreter {
|
||||
/// Asynchronously retrieve xcode build settings. This one is preferred for
|
||||
/// new call-sites.
|
||||
Future<Map<String, String>> getBuildSettings(
|
||||
String projectPath, String target, {
|
||||
String projectPath,
|
||||
String target, {
|
||||
Duration timeout = const Duration(minutes: 1),
|
||||
}) async {
|
||||
final Status status = Status.withSpinner(
|
||||
|
||||
@@ -14,8 +14,7 @@ import 'cocoapods.dart';
|
||||
|
||||
/// For a given build, determines whether dependencies have changed since the
|
||||
/// last call to processPods, then calls processPods with that information.
|
||||
Future<void> processPodsIfNeeded(XcodeBasedProject xcodeProject,
|
||||
String buildDirectory, BuildMode buildMode) async {
|
||||
Future<void> processPodsIfNeeded(XcodeBasedProject xcodeProject, String buildDirectory, BuildMode buildMode) async {
|
||||
final FlutterProject project = xcodeProject.parent;
|
||||
// Ensure that the plugin list is up to date, since hasPlugins relies on it.
|
||||
refreshPluginsList(project);
|
||||
|
||||
@@ -157,8 +157,13 @@ class MDnsObservatoryDiscoveryResult {
|
||||
final String authCode;
|
||||
}
|
||||
|
||||
Future<Uri> buildObservatoryUri(Device device,
|
||||
String host, int devicePort, [int observatoryPort, String authCode]) async {
|
||||
Future<Uri> buildObservatoryUri(
|
||||
Device device,
|
||||
String host,
|
||||
int devicePort, [
|
||||
int observatoryPort,
|
||||
String authCode,
|
||||
]) async {
|
||||
String path = '/';
|
||||
if (authCode != null) {
|
||||
path = authCode;
|
||||
|
||||
@@ -484,8 +484,12 @@ abstract class FlutterCommand extends Command<void> {
|
||||
///
|
||||
/// For example, the command path (e.g. `build/apk`) and the result,
|
||||
/// as well as the time spent running it.
|
||||
void _sendPostUsage(String commandPath, FlutterCommandResult commandResult,
|
||||
DateTime startTime, DateTime endTime) {
|
||||
void _sendPostUsage(
|
||||
String commandPath,
|
||||
FlutterCommandResult commandResult,
|
||||
DateTime startTime,
|
||||
DateTime endTime,
|
||||
) {
|
||||
if (commandPath == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -205,8 +205,12 @@ class FlutterWebPlatform extends PlatformPlugin {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<RunnerSuite> load(String path, SuitePlatform platform,
|
||||
SuiteConfiguration suiteConfig, Object message) async {
|
||||
Future<RunnerSuite> load(
|
||||
String path,
|
||||
SuitePlatform platform,
|
||||
SuiteConfiguration suiteConfig,
|
||||
Object message,
|
||||
) async {
|
||||
if (_closed) {
|
||||
return null;
|
||||
}
|
||||
@@ -509,8 +513,11 @@ class BrowserManager {
|
||||
/// Returns the browser manager, or throws an [ApplicationException] if a
|
||||
/// connection fails to be established.
|
||||
static Future<BrowserManager> start(
|
||||
Runtime runtime, Uri url, Future<WebSocketChannel> future,
|
||||
{bool debug = false}) async {
|
||||
Runtime runtime,
|
||||
Uri url,
|
||||
Future<WebSocketChannel> future, {
|
||||
bool debug = false,
|
||||
}) async {
|
||||
final Chrome chrome =
|
||||
await chromeLauncher.launch(url.toString(), headless: true);
|
||||
|
||||
@@ -671,8 +678,12 @@ class BrowserManager {
|
||||
///
|
||||
/// All methods forward directly to [BrowserManager].
|
||||
class _BrowserEnvironment implements Environment {
|
||||
_BrowserEnvironment(this._manager, this.observatoryUrl,
|
||||
this.remoteDebuggerUrl, this.onRestart);
|
||||
_BrowserEnvironment(
|
||||
this._manager,
|
||||
this.observatoryUrl,
|
||||
this.remoteDebuggerUrl,
|
||||
this.onRestart,
|
||||
);
|
||||
|
||||
final BrowserManager _manager;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user