mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
[Tool] [Windows] Output build duration (#120311)
* [Tool][Windows] Output build duration * Tweak * Format
This commit is contained in:
parent
b4908f376e
commit
ef854a3db0
@ -58,7 +58,7 @@ TaskFunction createMacOSRunReleaseTest() {
|
||||
}
|
||||
|
||||
TaskFunction createWindowsRunDebugTest() {
|
||||
return DesktopRunOutputTest(
|
||||
return WindowsRunOutputTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'lib/empty.dart',
|
||||
release: false,
|
||||
@ -66,7 +66,7 @@ TaskFunction createWindowsRunDebugTest() {
|
||||
}
|
||||
|
||||
TaskFunction createWindowsRunReleaseTest() {
|
||||
return DesktopRunOutputTest(
|
||||
return WindowsRunOutputTest(
|
||||
'${flutterDirectory.path}/dev/integration_tests/ui',
|
||||
'lib/empty.dart',
|
||||
release: true,
|
||||
@ -164,6 +164,30 @@ class AndroidRunOutputTest extends RunOutputTask {
|
||||
}
|
||||
}
|
||||
|
||||
class WindowsRunOutputTest extends DesktopRunOutputTest {
|
||||
WindowsRunOutputTest(
|
||||
super.testDirectory,
|
||||
super.testTarget, {
|
||||
required super.release,
|
||||
super.allowStderr = false,
|
||||
}
|
||||
);
|
||||
|
||||
static final RegExp _buildOutput = RegExp(
|
||||
r'Building Windows application\.\.\.\s*\d+(\.\d+)?(ms|s)',
|
||||
multiLine: true,
|
||||
);
|
||||
|
||||
@override
|
||||
void verifyBuildOutput(List<String> stdout) {
|
||||
_findNextMatcherInList(
|
||||
stdout,
|
||||
_buildOutput.hasMatch,
|
||||
'Building Windows application...',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class DesktopRunOutputTest extends RunOutputTask {
|
||||
DesktopRunOutputTest(
|
||||
super.testDirectory,
|
||||
@ -188,6 +212,8 @@ class DesktopRunOutputTest extends RunOutputTask {
|
||||
'Launching $testTarget on',
|
||||
);
|
||||
|
||||
verifyBuildOutput(stdout);
|
||||
|
||||
_findNextMatcherInList(
|
||||
stdout,
|
||||
(String line) => line.contains('Quit (terminate the application on the device).'),
|
||||
@ -202,6 +228,9 @@ class DesktopRunOutputTest extends RunOutputTask {
|
||||
|
||||
return TaskResult.success(null);
|
||||
}
|
||||
|
||||
/// Verify the output from `flutter run`'s build step.
|
||||
void verifyBuildOutput(List<String> stdout) {}
|
||||
}
|
||||
|
||||
/// Test that the output of `flutter run` is expected.
|
||||
|
@ -90,7 +90,7 @@ Future<void> buildWindows(WindowsProject windowsProject, BuildInfo buildInfo, {
|
||||
}
|
||||
await _runBuild(cmakePath, buildDirectory, buildModeName);
|
||||
} finally {
|
||||
status.cancel();
|
||||
status.stop();
|
||||
}
|
||||
if (buildInfo.codeSizeDirectory != null && sizeAnalyzer != null) {
|
||||
final String arch = getNameForTargetPlatform(TargetPlatform.windows_x64);
|
||||
|
Loading…
Reference in New Issue
Block a user