Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions lib/web_ui/dev/analyze.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// Copyright 2013 The Flutter 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:args/command_runner.dart';

import 'environment.dart';
import 'pipeline.dart';
import 'utils.dart';

class AnalyzeCommand extends Command<bool> with ArgUtils<bool> {
@override
String get name => 'analyze';

@override
String get description => 'Analyze the Flutter web engine.';

@override
FutureOr<bool> run() async {
final Pipeline buildPipeline = Pipeline(steps: <PipelineStep>[
PubGetStep(),
AnalyzeStep(),
]);
await buildPipeline.run();
return true;
}
}

/// Runs `dart pub get`.
class PubGetStep extends ProcessStep {
@override
String get description => 'pub get';

@override
bool get isSafeToInterrupt => true;

@override
Future<ProcessManager> createProcess() {
print('Running `dart pub get`...');
return startProcess(
environment.dartExecutable,
<String>['pub', 'get'],
workingDirectory: environment.webUiRootDir.path,
);
}
}

/// Runs `dart analyze --fatal-infos`.
class AnalyzeStep extends ProcessStep {
@override
String get description => 'analyze';

@override
bool get isSafeToInterrupt => true;

@override
Future<ProcessManager> createProcess() {
print('Running `dart analyze`...');
return startProcess(
environment.dartExecutable,
<String>['analyze', '--fatal-infos'],
workingDirectory: environment.webUiRootDir.path,
);
}
}
2 changes: 2 additions & 0 deletions lib/web_ui/dev/felt.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'dart:io' as io;

import 'package:args/command_runner.dart';

import 'analyze.dart';
import 'build.dart';
import 'clean.dart';
import 'exceptions.dart';
Expand All @@ -19,6 +20,7 @@ CommandRunner<bool> runner = CommandRunner<bool>(
'felt',
'Command-line utility for building and testing Flutter web engine.',
)
..addCommand(AnalyzeCommand())
..addCommand(BuildCommand())
..addCommand(CleanCommand())
..addCommand(GenerateFallbackFontDataCommand())
Expand Down