Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
99866f4a
Unverified
Commit
99866f4a
authored
Mar 27, 2019
by
Jonah Williams
Committed by
GitHub
Mar 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make timeout durations configurable (#30053)
parent
4b365fb9
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
61 additions
and
38 deletions
+61
-38
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+1
-1
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+5
-5
logger.dart
packages/flutter_tools/lib/src/base/logger.dart
+25
-4
cache.dart
packages/flutter_tools/lib/src/cache.dart
+2
-2
analyze_continuously.dart
.../flutter_tools/lib/src/commands/analyze_continuously.dart
+1
-1
analyze_once.dart
packages/flutter_tools/lib/src/commands/analyze_once.dart
+1
-1
build_aot.dart
packages/flutter_tools/lib/src/commands/build_aot.dart
+1
-1
update_packages.dart
packages/flutter_tools/lib/src/commands/update_packages.dart
+1
-1
context_runner.dart
packages/flutter_tools/lib/src/context_runner.dart
+1
-0
pub.dart
packages/flutter_tools/lib/src/dart/pub.dart
+1
-1
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+1
-1
cocoapods.dart
packages/flutter_tools/lib/src/ios/cocoapods.dart
+1
-1
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+1
-1
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+2
-2
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+2
-2
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+3
-3
coverage_collector.dart
packages/flutter_tools/lib/src/test/coverage_collector.dart
+1
-1
tracing.dart
packages/flutter_tools/lib/src/tracing.dart
+1
-1
logger_test.dart
packages/flutter_tools/test/base/logger_test.dart
+9
-9
context.dart
packages/flutter_tools/test/src/context.dart
+1
-0
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
99866f4a
...
@@ -277,7 +277,7 @@ class AndroidDevice extends Device {
...
@@ -277,7 +277,7 @@ class AndroidDevice extends Device {
if
(!
await
_checkForSupportedAdbVersion
()
||
!
await
_checkForSupportedAndroidVersion
())
if
(!
await
_checkForSupportedAdbVersion
()
||
!
await
_checkForSupportedAndroidVersion
())
return
false
;
return
false
;
final
Status
status
=
logger
.
startProgress
(
'Installing
${fs.path.relative(apk.file.path)}
...'
,
timeout:
kS
lowOperation
);
final
Status
status
=
logger
.
startProgress
(
'Installing
${fs.path.relative(apk.file.path)}
...'
,
timeout:
timeoutConfiguration
.
s
lowOperation
);
final
RunResult
installResult
=
await
runAsync
(
adbCommandForDevice
(<
String
>[
'install'
,
'-t'
,
'-r'
,
apk
.
file
.
path
]));
final
RunResult
installResult
=
await
runAsync
(
adbCommandForDevice
(<
String
>[
'install'
,
'-t'
,
'-r'
,
apk
.
file
.
path
]));
status
.
stop
();
status
.
stop
();
// Some versions of adb exit with exit code 0 even on failure :(
// Some versions of adb exit with exit code 0 even on failure :(
...
...
packages/flutter_tools/lib/src/android/gradle.dart
View file @
99866f4a
...
@@ -115,7 +115,7 @@ Future<GradleProject> _gradleProject() async {
...
@@ -115,7 +115,7 @@ Future<GradleProject> _gradleProject() async {
/// Runs `gradlew dependencies`, ensuring that dependencies are resolved and
/// Runs `gradlew dependencies`, ensuring that dependencies are resolved and
/// potentially downloaded.
/// potentially downloaded.
Future
<
void
>
checkGradleDependencies
()
async
{
Future
<
void
>
checkGradleDependencies
()
async
{
final
Status
progress
=
logger
.
startProgress
(
'Ensuring gradle dependencies are up to date...'
,
timeout:
kS
lowOperation
);
final
Status
progress
=
logger
.
startProgress
(
'Ensuring gradle dependencies are up to date...'
,
timeout:
timeoutConfiguration
.
s
lowOperation
);
final
FlutterProject
flutterProject
=
await
FlutterProject
.
current
();
final
FlutterProject
flutterProject
=
await
FlutterProject
.
current
();
final
String
gradle
=
await
_ensureGradle
(
flutterProject
);
final
String
gradle
=
await
_ensureGradle
(
flutterProject
);
await
runCheckedAsync
(
await
runCheckedAsync
(
...
@@ -133,7 +133,7 @@ Future<GradleProject> _readGradleProject() async {
...
@@ -133,7 +133,7 @@ Future<GradleProject> _readGradleProject() async {
final
FlutterProject
flutterProject
=
await
FlutterProject
.
current
();
final
FlutterProject
flutterProject
=
await
FlutterProject
.
current
();
final
String
gradle
=
await
_ensureGradle
(
flutterProject
);
final
String
gradle
=
await
_ensureGradle
(
flutterProject
);
updateLocalProperties
(
project:
flutterProject
);
updateLocalProperties
(
project:
flutterProject
);
final
Status
status
=
logger
.
startProgress
(
'Resolving dependencies...'
,
timeout:
kS
lowOperation
);
final
Status
status
=
logger
.
startProgress
(
'Resolving dependencies...'
,
timeout:
timeoutConfiguration
.
s
lowOperation
);
GradleProject
project
;
GradleProject
project
;
try
{
try
{
final
RunResult
propertiesRunResult
=
await
runCheckedAsync
(
final
RunResult
propertiesRunResult
=
await
runCheckedAsync
(
...
@@ -211,7 +211,7 @@ Future<String> _ensureGradle(FlutterProject project) async {
...
@@ -211,7 +211,7 @@ Future<String> _ensureGradle(FlutterProject project) async {
// of validating the Gradle executable. This may take several seconds.
// of validating the Gradle executable. This may take several seconds.
Future
<
String
>
_initializeGradle
(
FlutterProject
project
)
async
{
Future
<
String
>
_initializeGradle
(
FlutterProject
project
)
async
{
final
Directory
android
=
project
.
android
.
hostAppGradleRoot
;
final
Directory
android
=
project
.
android
.
hostAppGradleRoot
;
final
Status
status
=
logger
.
startProgress
(
'Initializing gradle...'
,
timeout:
kS
lowOperation
);
final
Status
status
=
logger
.
startProgress
(
'Initializing gradle...'
,
timeout:
timeoutConfiguration
.
s
lowOperation
);
String
gradle
=
_locateGradlewExecutable
(
android
);
String
gradle
=
_locateGradlewExecutable
(
android
);
if
(
gradle
==
null
)
{
if
(
gradle
==
null
)
{
injectGradleWrapper
(
android
);
injectGradleWrapper
(
android
);
...
@@ -351,7 +351,7 @@ Future<void> _buildGradleProjectV1(FlutterProject project, String gradle) async
...
@@ -351,7 +351,7 @@ Future<void> _buildGradleProjectV1(FlutterProject project, String gradle) async
// Run 'gradlew build'.
// Run 'gradlew build'.
final
Status
status
=
logger
.
startProgress
(
final
Status
status
=
logger
.
startProgress
(
'Running
\'
gradlew build
\'
...'
,
'Running
\'
gradlew build
\'
...'
,
timeout:
kS
lowOperation
,
timeout:
timeoutConfiguration
.
s
lowOperation
,
multilineOutput:
true
,
multilineOutput:
true
,
);
);
final
int
exitCode
=
await
runCommandAndStreamOutput
(
final
int
exitCode
=
await
runCommandAndStreamOutput
(
...
@@ -403,7 +403,7 @@ Future<void> _buildGradleProjectV2(
...
@@ -403,7 +403,7 @@ Future<void> _buildGradleProjectV2(
}
}
final
Status
status
=
logger
.
startProgress
(
final
Status
status
=
logger
.
startProgress
(
'Running Gradle task
\'
$assembleTask
\'
...'
,
'Running Gradle task
\'
$assembleTask
\'
...'
,
timeout:
kS
lowOperation
,
timeout:
timeoutConfiguration
.
s
lowOperation
,
multilineOutput:
true
,
multilineOutput:
true
,
);
);
final
String
gradlePath
=
fs
.
file
(
gradle
).
absolute
.
path
;
final
String
gradlePath
=
fs
.
file
(
gradle
).
absolute
.
path
;
...
...
packages/flutter_tools/lib/src/base/logger.dart
View file @
99866f4a
...
@@ -13,8 +13,29 @@ import 'terminal.dart';
...
@@ -13,8 +13,29 @@ import 'terminal.dart';
import
'utils.dart'
;
import
'utils.dart'
;
const
int
kDefaultStatusPadding
=
59
;
const
int
kDefaultStatusPadding
=
59
;
const
Duration
kFastOperation
=
Duration
(
seconds:
2
);
const
Duration
_kFastOperation
=
Duration
(
seconds:
2
);
const
Duration
kSlowOperation
=
Duration
(
minutes:
2
);
const
Duration
_kSlowOperation
=
Duration
(
minutes:
2
);
/// The [TimeoutConfiguration] instance.
///
/// If not provided via injection, a default instance is provided.
TimeoutConfiguration
get
timeoutConfiguration
=>
context
[
TimeoutConfiguration
]
??
const
TimeoutConfiguration
();
class
TimeoutConfiguration
{
const
TimeoutConfiguration
();
/// The expected time that various "slow" operations take, such as running
/// the analyzer.
///
/// Defaults to 2 minutes.
Duration
get
slowOperation
=>
_kSlowOperation
;
/// The expected time that various "fast" operations take, such as a hot
/// reload.
///
/// Defaults to 2 seconds.
Duration
get
fastOperation
=>
_kFastOperation
;
}
typedef
VoidCallback
=
void
Function
();
typedef
VoidCallback
=
void
Function
();
...
@@ -375,7 +396,7 @@ class VerboseLogger extends Logger {
...
@@ -375,7 +396,7 @@ class VerboseLogger extends Logger {
timeout:
timeout
,
timeout:
timeout
,
onFinish:
()
{
onFinish:
()
{
String
time
;
String
time
;
if
(
timeout
==
null
||
timeout
>
kF
astOperation
)
{
if
(
timeout
==
null
||
timeout
>
timeoutConfiguration
.
f
astOperation
)
{
time
=
getElapsedAsSeconds
(
timer
.
elapsed
);
time
=
getElapsedAsSeconds
(
timer
.
elapsed
);
}
else
{
}
else
{
time
=
getElapsedAsMilliseconds
(
timer
.
elapsed
);
time
=
getElapsedAsMilliseconds
(
timer
.
elapsed
);
...
@@ -473,7 +494,7 @@ abstract class Status {
...
@@ -473,7 +494,7 @@ abstract class Status {
@protected
@protected
String
get
elapsedTime
{
String
get
elapsedTime
{
if
(
timeout
==
null
||
timeout
>
kF
astOperation
)
if
(
timeout
==
null
||
timeout
>
timeoutConfiguration
.
f
astOperation
)
return
getElapsedAsSeconds
(
_stopwatch
.
elapsed
);
return
getElapsedAsSeconds
(
_stopwatch
.
elapsed
);
return
getElapsedAsMilliseconds
(
_stopwatch
.
elapsed
);
return
getElapsedAsMilliseconds
(
_stopwatch
.
elapsed
);
}
}
...
...
packages/flutter_tools/lib/src/cache.dart
View file @
99866f4a
...
@@ -366,7 +366,7 @@ abstract class CachedArtifact {
...
@@ -366,7 +366,7 @@ abstract class CachedArtifact {
Future
<
void
>
_downloadArchive
(
String
message
,
Uri
url
,
Directory
location
,
bool
verifier
(
File
f
),
void
extractor
(
File
f
,
Directory
d
))
{
Future
<
void
>
_downloadArchive
(
String
message
,
Uri
url
,
Directory
location
,
bool
verifier
(
File
f
),
void
extractor
(
File
f
,
Directory
d
))
{
return
_withDownloadFile
(
'
${flattenNameSubdirs(url)}
'
,
(
File
tempFile
)
async
{
return
_withDownloadFile
(
'
${flattenNameSubdirs(url)}
'
,
(
File
tempFile
)
async
{
if
(!
verifier
(
tempFile
))
{
if
(!
verifier
(
tempFile
))
{
final
Status
status
=
logger
.
startProgress
(
message
,
timeout:
kS
lowOperation
);
final
Status
status
=
logger
.
startProgress
(
message
,
timeout:
timeoutConfiguration
.
s
lowOperation
);
try
{
try
{
await
_downloadFile
(
url
,
tempFile
);
await
_downloadFile
(
url
,
tempFile
);
status
.
stop
();
status
.
stop
();
...
@@ -781,7 +781,7 @@ Future<void> _downloadFile(Uri url, File location) async {
...
@@ -781,7 +781,7 @@ Future<void> _downloadFile(Uri url, File location) async {
}
}
Future
<
bool
>
_doesRemoteExist
(
String
message
,
Uri
url
)
async
{
Future
<
bool
>
_doesRemoteExist
(
String
message
,
Uri
url
)
async
{
final
Status
status
=
logger
.
startProgress
(
message
,
timeout:
kS
lowOperation
);
final
Status
status
=
logger
.
startProgress
(
message
,
timeout:
timeoutConfiguration
.
s
lowOperation
);
final
bool
exists
=
await
doesRemoteFileExist
(
url
);
final
bool
exists
=
await
doesRemoteFileExist
(
url
);
status
.
stop
();
status
.
stop
();
return
exists
;
return
exists
;
...
...
packages/flutter_tools/lib/src/commands/analyze_continuously.dart
View file @
99866f4a
...
@@ -77,7 +77,7 @@ class AnalyzeContinuously extends AnalyzeBase {
...
@@ -77,7 +77,7 @@ class AnalyzeContinuously extends AnalyzeBase {
analysisStatus
?.
cancel
();
analysisStatus
?.
cancel
();
if
(!
firstAnalysis
)
if
(!
firstAnalysis
)
printStatus
(
'
\n
'
);
printStatus
(
'
\n
'
);
analysisStatus
=
logger
.
startProgress
(
'Analyzing
$analysisTarget
...'
,
timeout:
kS
lowOperation
);
analysisStatus
=
logger
.
startProgress
(
'Analyzing
$analysisTarget
...'
,
timeout:
timeoutConfiguration
.
s
lowOperation
);
analyzedPaths
.
clear
();
analyzedPaths
.
clear
();
analysisTimer
=
Stopwatch
()..
start
();
analysisTimer
=
Stopwatch
()..
start
();
}
else
{
}
else
{
...
...
packages/flutter_tools/lib/src/commands/analyze_once.dart
View file @
99866f4a
...
@@ -107,7 +107,7 @@ class AnalyzeOnce extends AnalyzeBase {
...
@@ -107,7 +107,7 @@ class AnalyzeOnce extends AnalyzeBase {
?
'
${directories.length}
${directories.length == 1 ? 'directory' : 'directories'}
'
?
'
${directories.length}
${directories.length == 1 ? 'directory' : 'directories'}
'
:
fs
.
path
.
basename
(
directories
.
first
);
:
fs
.
path
.
basename
(
directories
.
first
);
final
Status
progress
=
argResults
[
'preamble'
]
final
Status
progress
=
argResults
[
'preamble'
]
?
logger
.
startProgress
(
'Analyzing
$message
...'
,
timeout:
kS
lowOperation
)
?
logger
.
startProgress
(
'Analyzing
$message
...'
,
timeout:
timeoutConfiguration
.
s
lowOperation
)
:
null
;
:
null
;
await
analysisCompleter
.
future
;
await
analysisCompleter
.
future
;
...
...
packages/flutter_tools/lib/src/commands/build_aot.dart
View file @
99866f4a
...
@@ -69,7 +69,7 @@ class BuildAotCommand extends BuildSubCommand {
...
@@ -69,7 +69,7 @@ class BuildAotCommand extends BuildSubCommand {
final
String
typeName
=
artifacts
.
getEngineType
(
platform
,
buildMode
);
final
String
typeName
=
artifacts
.
getEngineType
(
platform
,
buildMode
);
status
=
logger
.
startProgress
(
status
=
logger
.
startProgress
(
'Building AOT snapshot in
${getFriendlyModeName(getBuildMode())}
mode (
$typeName
)...'
,
'Building AOT snapshot in
${getFriendlyModeName(getBuildMode())}
mode (
$typeName
)...'
,
timeout:
kS
lowOperation
,
timeout:
timeoutConfiguration
.
s
lowOperation
,
);
);
}
}
final
String
outputPath
=
argResults
[
'output-dir'
]
??
getAotBuildDirectory
();
final
String
outputPath
=
argResults
[
'output-dir'
]
??
getAotBuildDirectory
();
...
...
packages/flutter_tools/lib/src/commands/update_packages.dart
View file @
99866f4a
...
@@ -87,7 +87,7 @@ class UpdatePackagesCommand extends FlutterCommand {
...
@@ -87,7 +87,7 @@ class UpdatePackagesCommand extends FlutterCommand {
Future
<
void
>
_downloadCoverageData
()
async
{
Future
<
void
>
_downloadCoverageData
()
async
{
final
Status
status
=
logger
.
startProgress
(
final
Status
status
=
logger
.
startProgress
(
'Downloading lcov data for package:flutter...'
,
'Downloading lcov data for package:flutter...'
,
timeout:
kS
lowOperation
,
timeout:
timeoutConfiguration
.
s
lowOperation
,
);
);
final
String
urlBase
=
platform
.
environment
[
'FLUTTER_STORAGE_BASE_URL'
]
??
'https://storage.googleapis.com'
;
final
String
urlBase
=
platform
.
environment
[
'FLUTTER_STORAGE_BASE_URL'
]
??
'https://storage.googleapis.com'
;
final
List
<
int
>
data
=
await
fetchUrl
(
Uri
.
parse
(
'
$urlBase
/flutter_infra/flutter/coverage/lcov.info'
));
final
List
<
int
>
data
=
await
fetchUrl
(
Uri
.
parse
(
'
$urlBase
/flutter_infra/flutter/coverage/lcov.info'
));
...
...
packages/flutter_tools/lib/src/context_runner.dart
View file @
99866f4a
...
@@ -91,6 +91,7 @@ Future<T> runInContext<T>(
...
@@ -91,6 +91,7 @@ Future<T> runInContext<T>(
SimControl:
()
=>
SimControl
(),
SimControl:
()
=>
SimControl
(),
SystemClock:
()
=>
const
SystemClock
(),
SystemClock:
()
=>
const
SystemClock
(),
Stdio:
()
=>
const
Stdio
(),
Stdio:
()
=>
const
Stdio
(),
TimeoutConfiguration:
()
=>
const
TimeoutConfiguration
(),
Usage:
()
=>
Usage
(),
Usage:
()
=>
Usage
(),
UserMessages:
()
=>
UserMessages
(),
UserMessages:
()
=>
UserMessages
(),
WindowsWorkflow:
()
=>
const
WindowsWorkflow
(),
WindowsWorkflow:
()
=>
const
WindowsWorkflow
(),
...
...
packages/flutter_tools/lib/src/dart/pub.dart
View file @
99866f4a
...
@@ -93,7 +93,7 @@ Future<void> pubGet({
...
@@ -93,7 +93,7 @@ Future<void> pubGet({
final
String
command
=
upgrade
?
'upgrade'
:
'get'
;
final
String
command
=
upgrade
?
'upgrade'
:
'get'
;
final
Status
status
=
logger
.
startProgress
(
final
Status
status
=
logger
.
startProgress
(
'Running "flutter packages
$command
" in
${fs.path.basename(directory)}
...'
,
'Running "flutter packages
$command
" in
${fs.path.basename(directory)}
...'
,
timeout:
kS
lowOperation
,
timeout:
timeoutConfiguration
.
s
lowOperation
,
);
);
final
List
<
String
>
args
=
<
String
>[
'--verbosity=warning'
];
final
List
<
String
>
args
=
<
String
>[
'--verbosity=warning'
];
if
(
FlutterCommand
.
current
!=
null
&&
FlutterCommand
.
current
.
globalResults
[
'verbose'
])
if
(
FlutterCommand
.
current
!=
null
&&
FlutterCommand
.
current
.
globalResults
[
'verbose'
])
...
...
packages/flutter_tools/lib/src/doctor.dart
View file @
99866f4a
...
@@ -187,7 +187,7 @@ class Doctor {
...
@@ -187,7 +187,7 @@ class Doctor {
for
(
ValidatorTask
validatorTask
in
startValidatorTasks
())
{
for
(
ValidatorTask
validatorTask
in
startValidatorTasks
())
{
final
DoctorValidator
validator
=
validatorTask
.
validator
;
final
DoctorValidator
validator
=
validatorTask
.
validator
;
final
Status
status
=
Status
.
withSpinner
(
final
Status
status
=
Status
.
withSpinner
(
timeout:
kF
astOperation
,
timeout:
timeoutConfiguration
.
f
astOperation
,
slowWarningCallback:
()
=>
validator
.
slowWarning
,
slowWarningCallback:
()
=>
validator
.
slowWarning
,
);
);
ValidationResult
result
;
ValidationResult
result
;
...
...
packages/flutter_tools/lib/src/ios/cocoapods.dart
View file @
99866f4a
...
@@ -254,7 +254,7 @@ class CocoaPods {
...
@@ -254,7 +254,7 @@ class CocoaPods {
}
}
Future
<
void
>
_runPodInstall
(
IosProject
iosProject
,
String
engineDirectory
)
async
{
Future
<
void
>
_runPodInstall
(
IosProject
iosProject
,
String
engineDirectory
)
async
{
final
Status
status
=
logger
.
startProgress
(
'Running pod install...'
,
timeout:
kS
lowOperation
);
final
Status
status
=
logger
.
startProgress
(
'Running pod install...'
,
timeout:
timeoutConfiguration
.
s
lowOperation
);
final
ProcessResult
result
=
await
processManager
.
run
(
final
ProcessResult
result
=
await
processManager
.
run
(
<
String
>[
'pod'
,
'install'
,
'--verbose'
],
<
String
>[
'pod'
,
'install'
,
'--verbose'
],
workingDirectory:
iosProject
.
hostAppRoot
.
path
,
workingDirectory:
iosProject
.
hostAppRoot
.
path
,
...
...
packages/flutter_tools/lib/src/ios/devices.dart
View file @
99866f4a
...
@@ -309,7 +309,7 @@ class IOSDevice extends Device {
...
@@ -309,7 +309,7 @@ class IOSDevice extends Device {
int
installationResult
=
-
1
;
int
installationResult
=
-
1
;
Uri
localObservatoryUri
;
Uri
localObservatoryUri
;
final
Status
installStatus
=
logger
.
startProgress
(
'Installing and launching...'
,
timeout:
kS
lowOperation
);
final
Status
installStatus
=
logger
.
startProgress
(
'Installing and launching...'
,
timeout:
timeoutConfiguration
.
s
lowOperation
);
if
(!
debuggingOptions
.
debuggingEnabled
)
{
if
(!
debuggingOptions
.
debuggingEnabled
)
{
// If debugging is not enabled, just launch the application and continue.
// If debugging is not enabled, just launch the application and continue.
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
99866f4a
...
@@ -480,7 +480,7 @@ Future<XcodeBuildResult> buildXcodeProject({
...
@@ -480,7 +480,7 @@ Future<XcodeBuildResult> buildXcodeProject({
initialBuildStatus
=
null
;
initialBuildStatus
=
null
;
buildSubStatus
=
logger
.
startProgress
(
buildSubStatus
=
logger
.
startProgress
(
line
,
line
,
timeout:
kS
lowOperation
,
timeout:
timeoutConfiguration
.
s
lowOperation
,
progressIndicatorPadding:
kDefaultStatusPadding
-
7
,
progressIndicatorPadding:
kDefaultStatusPadding
-
7
,
);
);
}
}
...
@@ -495,7 +495,7 @@ Future<XcodeBuildResult> buildXcodeProject({
...
@@ -495,7 +495,7 @@ Future<XcodeBuildResult> buildXcodeProject({
}
}
final
Stopwatch
buildStopwatch
=
Stopwatch
()..
start
();
final
Stopwatch
buildStopwatch
=
Stopwatch
()..
start
();
initialBuildStatus
=
logger
.
startProgress
(
'Running Xcode build...'
,
timeout:
kF
astOperation
);
initialBuildStatus
=
logger
.
startProgress
(
'Running Xcode build...'
,
timeout:
timeoutConfiguration
.
f
astOperation
);
final
RunResult
buildResult
=
await
runAsync
(
final
RunResult
buildResult
=
await
runAsync
(
buildCommands
,
buildCommands
,
workingDirectory:
app
.
project
.
hostAppRoot
.
path
,
workingDirectory:
app
.
project
.
hostAppRoot
.
path
,
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
99866f4a
...
@@ -447,7 +447,7 @@ class FlutterDevice {
...
@@ -447,7 +447,7 @@ class FlutterDevice {
})
async
{
})
async
{
final
Status
devFSStatus
=
logger
.
startProgress
(
final
Status
devFSStatus
=
logger
.
startProgress
(
'Syncing files to device
${device.name}
...'
,
'Syncing files to device
${device.name}
...'
,
timeout:
kF
astOperation
,
timeout:
timeoutConfiguration
.
f
astOperation
,
);
);
UpdateFSReport
report
;
UpdateFSReport
report
;
try
{
try
{
...
@@ -633,7 +633,7 @@ abstract class ResidentRunner {
...
@@ -633,7 +633,7 @@ abstract class ResidentRunner {
}
}
Future
<
void
>
_screenshot
(
FlutterDevice
device
)
async
{
Future
<
void
>
_screenshot
(
FlutterDevice
device
)
async
{
final
Status
status
=
logger
.
startProgress
(
'Taking screenshot for
${device.device.name}
...'
,
timeout:
kF
astOperation
);
final
Status
status
=
logger
.
startProgress
(
'Taking screenshot for
${device.device.name}
...'
,
timeout:
timeoutConfiguration
.
f
astOperation
);
final
File
outputFile
=
getUniqueFile
(
fs
.
currentDirectory
,
'flutter'
,
'png'
);
final
File
outputFile
=
getUniqueFile
(
fs
.
currentDirectory
,
'flutter'
,
'png'
);
try
{
try
{
if
(
supportsServiceProtocol
&&
isRunningDebug
)
{
if
(
supportsServiceProtocol
&&
isRunningDebug
)
{
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
99866f4a
...
@@ -538,7 +538,7 @@ class HotRunner extends ResidentRunner {
...
@@ -538,7 +538,7 @@ class HotRunner extends ResidentRunner {
}
}
final
Status
status
=
logger
.
startProgress
(
final
Status
status
=
logger
.
startProgress
(
'Performing hot restart...'
,
'Performing hot restart...'
,
timeout:
kF
astOperation
,
timeout:
timeoutConfiguration
.
f
astOperation
,
progressId:
'hot.restart'
,
progressId:
'hot.restart'
,
);
);
try
{
try
{
...
@@ -557,7 +557,7 @@ class HotRunner extends ResidentRunner {
...
@@ -557,7 +557,7 @@ class HotRunner extends ResidentRunner {
final
String
progressPrefix
=
reloadOnTopOfSnapshot
?
'Initializing'
:
'Performing'
;
final
String
progressPrefix
=
reloadOnTopOfSnapshot
?
'Initializing'
:
'Performing'
;
Status
status
=
logger
.
startProgress
(
Status
status
=
logger
.
startProgress
(
'
$progressPrefix
hot reload...'
,
'
$progressPrefix
hot reload...'
,
timeout:
kF
astOperation
,
timeout:
timeoutConfiguration
.
f
astOperation
,
progressId:
'hot.reload'
,
progressId:
'hot.reload'
,
);
);
OperationResult
result
;
OperationResult
result
;
...
@@ -570,7 +570,7 @@ class HotRunner extends ResidentRunner {
...
@@ -570,7 +570,7 @@ class HotRunner extends ResidentRunner {
status
?.
cancel
();
status
?.
cancel
();
status
=
logger
.
startProgress
(
status
=
logger
.
startProgress
(
message
,
message
,
timeout:
kS
lowOperation
,
timeout:
timeoutConfiguration
.
s
lowOperation
,
progressId:
'hot.reload'
,
progressId:
'hot.reload'
,
);
);
showTime
=
false
;
showTime
=
false
;
...
...
packages/flutter_tools/lib/src/test/coverage_collector.dart
View file @
99866f4a
...
@@ -92,7 +92,7 @@ class CoverageCollector extends TestWatcher {
...
@@ -92,7 +92,7 @@ class CoverageCollector extends TestWatcher {
}
}
Future
<
bool
>
collectCoverageData
(
String
coveragePath
,
{
bool
mergeCoverageData
=
false
,
Directory
coverageDirectory
})
async
{
Future
<
bool
>
collectCoverageData
(
String
coveragePath
,
{
bool
mergeCoverageData
=
false
,
Directory
coverageDirectory
})
async
{
final
Status
status
=
logger
.
startProgress
(
'Collecting coverage information...'
,
timeout:
kF
astOperation
);
final
Status
status
=
logger
.
startProgress
(
'Collecting coverage information...'
,
timeout:
timeoutConfiguration
.
f
astOperation
);
final
String
coverageData
=
await
finalizeCoverage
(
final
String
coverageData
=
await
finalizeCoverage
(
coverageDirectory:
coverageDirectory
,
coverageDirectory:
coverageDirectory
,
);
);
...
...
packages/flutter_tools/lib/src/tracing.dart
View file @
99866f4a
...
@@ -40,7 +40,7 @@ class Tracing {
...
@@ -40,7 +40,7 @@ class Tracing {
if
(
awaitFirstFrame
)
{
if
(
awaitFirstFrame
)
{
final
Status
status
=
logger
.
startProgress
(
final
Status
status
=
logger
.
startProgress
(
'Waiting for application to render first frame...'
,
'Waiting for application to render first frame...'
,
timeout:
kF
astOperation
,
timeout:
timeoutConfiguration
.
f
astOperation
,
);
);
try
{
try
{
final
Completer
<
void
>
whenFirstFrameRendered
=
Completer
<
void
>();
final
Completer
<
void
>
whenFirstFrameRendered
=
Completer
<
void
>();
...
...
packages/flutter_tools/test/base/logger_test.dart
View file @
99866f4a
...
@@ -166,7 +166,7 @@ void main() {
...
@@ -166,7 +166,7 @@ void main() {
final
Status
status
=
logger
.
startProgress
(
final
Status
status
=
logger
.
startProgress
(
'Hello'
,
'Hello'
,
progressId:
null
,
progressId:
null
,
timeout:
kS
lowOperation
,
timeout:
timeoutConfiguration
.
s
lowOperation
,
progressIndicatorPadding:
20
,
// this minus the "Hello" equals the 15 below.
progressIndicatorPadding:
20
,
// this minus the "Hello" equals the 15 below.
);
);
expect
(
outputStderr
().
length
,
equals
(
1
));
expect
(
outputStderr
().
length
,
equals
(
1
));
...
@@ -357,7 +357,7 @@ void main() {
...
@@ -357,7 +357,7 @@ void main() {
called
=
0
;
called
=
0
;
summaryStatus
=
SummaryStatus
(
summaryStatus
=
SummaryStatus
(
message:
'Hello world'
,
message:
'Hello world'
,
timeout:
kS
lowOperation
,
timeout:
timeoutConfiguration
.
s
lowOperation
,
padding:
20
,
padding:
20
,
onFinish:
()
=>
called
++,
onFinish:
()
=>
called
++,
);
);
...
@@ -593,7 +593,7 @@ void main() {
...
@@ -593,7 +593,7 @@ void main() {
final
Status
status
=
logger
.
startProgress
(
final
Status
status
=
logger
.
startProgress
(
'Hello'
,
'Hello'
,
progressId:
null
,
progressId:
null
,
timeout:
kS
lowOperation
,
timeout:
timeoutConfiguration
.
s
lowOperation
,
progressIndicatorPadding:
20
,
// this minus the "Hello" equals the 15 below.
progressIndicatorPadding:
20
,
// this minus the "Hello" equals the 15 below.
);
);
expect
(
outputStderr
().
length
,
equals
(
1
));
expect
(
outputStderr
().
length
,
equals
(
1
));
...
@@ -661,8 +661,8 @@ void main() {
...
@@ -661,8 +661,8 @@ void main() {
testUsingContext
(
'sequential startProgress calls with StdoutLogger'
,
()
async
{
testUsingContext
(
'sequential startProgress calls with StdoutLogger'
,
()
async
{
final
Logger
logger
=
context
[
Logger
];
final
Logger
logger
=
context
[
Logger
];
logger
.
startProgress
(
'AAA'
,
timeout:
kF
astOperation
)..
stop
();
logger
.
startProgress
(
'AAA'
,
timeout:
timeoutConfiguration
.
f
astOperation
)..
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
kF
astOperation
)..
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
timeoutConfiguration
.
f
astOperation
)..
stop
();
final
List
<
String
>
output
=
outputStdout
();
final
List
<
String
>
output
=
outputStdout
();
expect
(
output
.
length
,
equals
(
3
));
expect
(
output
.
length
,
equals
(
3
));
// There's 61 spaces at the start: 59 (padding default) - 3 (length of AAA) + 5 (margin).
// There's 61 spaces at the start: 59 (padding default) - 3 (length of AAA) + 5 (margin).
...
@@ -679,8 +679,8 @@ void main() {
...
@@ -679,8 +679,8 @@ void main() {
testUsingContext
(
'sequential startProgress calls with VerboseLogger and StdoutLogger'
,
()
async
{
testUsingContext
(
'sequential startProgress calls with VerboseLogger and StdoutLogger'
,
()
async
{
final
Logger
logger
=
context
[
Logger
];
final
Logger
logger
=
context
[
Logger
];
logger
.
startProgress
(
'AAA'
,
timeout:
kF
astOperation
)..
stop
();
logger
.
startProgress
(
'AAA'
,
timeout:
timeoutConfiguration
.
f
astOperation
)..
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
kF
astOperation
)..
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
timeoutConfiguration
.
f
astOperation
)..
stop
();
expect
(
outputStdout
(),
<
Matcher
>[
expect
(
outputStdout
(),
<
Matcher
>[
matches
(
r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] AAA$'
),
matches
(
r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] AAA$'
),
matches
(
r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] AAA \(completed.*\)$'
),
matches
(
r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] AAA \(completed.*\)$'
),
...
@@ -696,8 +696,8 @@ void main() {
...
@@ -696,8 +696,8 @@ void main() {
testUsingContext
(
'sequential startProgress calls with BufferLogger'
,
()
async
{
testUsingContext
(
'sequential startProgress calls with BufferLogger'
,
()
async
{
final
BufferLogger
logger
=
context
[
Logger
];
final
BufferLogger
logger
=
context
[
Logger
];
logger
.
startProgress
(
'AAA'
,
timeout:
kF
astOperation
)..
stop
();
logger
.
startProgress
(
'AAA'
,
timeout:
timeoutConfiguration
.
f
astOperation
)..
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
kF
astOperation
)..
stop
();
logger
.
startProgress
(
'BBB'
,
timeout:
timeoutConfiguration
.
f
astOperation
)..
stop
();
expect
(
logger
.
statusText
,
'AAA
\n
BBB
\n
'
);
expect
(
logger
.
statusText
,
'AAA
\n
BBB
\n
'
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Logger:
()
=>
BufferLogger
(),
Logger:
()
=>
BufferLogger
(),
...
...
packages/flutter_tools/test/src/context.dart
View file @
99866f4a
...
@@ -86,6 +86,7 @@ void testUsingContext(
...
@@ -86,6 +86,7 @@ void testUsingContext(
Usage:
()
=>
MockUsage
(),
Usage:
()
=>
MockUsage
(),
XcodeProjectInterpreter:
()
=>
MockXcodeProjectInterpreter
(),
XcodeProjectInterpreter:
()
=>
MockXcodeProjectInterpreter
(),
FileSystem:
()
=>
LocalFileSystemBlockingSetCurrentDirectory
(),
FileSystem:
()
=>
LocalFileSystemBlockingSetCurrentDirectory
(),
TimeoutConfiguration:
()
=>
const
TimeoutConfiguration
(),
},
},
body:
()
{
body:
()
{
final
String
flutterRoot
=
getFlutterRoot
();
final
String
flutterRoot
=
getFlutterRoot
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment