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
d3d9e1ca
Commit
d3d9e1ca
authored
Sep 29, 2016
by
Devon Carew
Committed by
GitHub
Sep 29, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use less granular progress (#6130)
* use less granular progress * update restart text
parent
6cdab85d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
34 deletions
+18
-34
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+6
-18
hot.dart
packages/flutter_tools/lib/src/hot.dart
+11
-15
run.dart
packages/flutter_tools/lib/src/run.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/devfs.dart
View file @
d3d9e1ca
...
...
@@ -8,7 +8,6 @@ import 'dart:io';
import
'package:path/path.dart'
as
path
;
import
'base/logger.dart'
;
import
'build_info.dart'
;
import
'dart/package_map.dart'
;
import
'asset.dart'
;
...
...
@@ -307,15 +306,13 @@ class DevFS {
Set
<
String
>
fileFilter
})
async
{
_reset
();
printTrace
(
'DevFS: Starting sync from
$rootDirectory
'
);
Status
status
;
status
=
logger
.
startProgress
(
'Scanning project files...'
);
logger
.
printTrace
(
'Scanning project files'
);
Directory
directory
=
rootDirectory
;
await
_scanDirectory
(
directory
,
recursive:
true
,
fileFilter:
fileFilter
);
status
.
stop
(
showElapsedTime:
true
);
status
=
logger
.
startProgress
(
'Scanning package files...
'
);
printTrace
(
'Scanning package files
'
);
String
packagesFilePath
=
path
.
join
(
rootDirectory
.
path
,
kPackagesFileName
);
StringBuffer
sb
;
if
(
FileSystemEntity
.
isFileSync
(
packagesFilePath
))
{
...
...
@@ -346,9 +343,8 @@ class DevFS {
}
}
}
status
.
stop
(
showElapsedTime:
true
);
if
(
bundle
!=
null
)
{
status
=
logger
.
startProgress
(
'Scanning asset files...
'
);
printTrace
(
'Scanning asset files
'
);
// Synchronize asset bundle.
for
(
AssetBundleEntry
entry
in
bundle
.
entries
)
{
// We write the assets into the AssetBundle working dir so that they
...
...
@@ -357,10 +353,9 @@ class DevFS {
path
.
join
(
getAssetBuildDirectory
(),
entry
.
archivePath
);
_scanBundleEntry
(
devicePath
,
entry
,
bundleDirty
);
}
status
.
stop
(
showElapsedTime:
true
);
}
// Handle deletions.
status
=
logger
.
startProgress
(
'Scanning for deleted files...
'
);
printTrace
(
'Scanning for deleted files
'
);
final
List
<
String
>
toRemove
=
new
List
<
String
>();
_entries
.
forEach
((
String
path
,
DevFSEntry
entry
)
{
if
(!
entry
.
_exists
)
{
...
...
@@ -371,10 +366,9 @@ class DevFS {
for
(
int
i
=
0
;
i
<
toRemove
.
length
;
i
++)
{
_entries
.
remove
(
toRemove
[
i
]);
}
status
.
stop
(
showElapsedTime:
true
);
if
(
_deletedEntries
.
length
>
0
)
{
status
=
logger
.
startProgress
(
'Removing deleted files...
'
);
printTrace
(
'Removing deleted files
'
);
for
(
DevFSEntry
entry
in
_deletedEntries
)
{
Future
<
Map
<
String
,
dynamic
>>
operation
=
_operations
.
deleteFile
(
fsName
,
entry
);
...
...
@@ -384,13 +378,10 @@ class DevFS {
await
Future
.
wait
(
_pendingOperations
);
_pendingOperations
.
clear
();
_deletedEntries
.
clear
();
status
.
stop
(
showElapsedTime:
true
);
}
else
{
printStatus
(
"No files to remove."
);
}
if
(
_dirtyEntries
.
length
>
0
)
{
status
=
logger
.
startProgress
(
'Updating files...
'
);
printTrace
(
'Updating files
'
);
if
(
_httpWriter
!=
null
)
{
try
{
await
_httpWriter
.
write
(
_dirtyEntries
,
...
...
@@ -418,9 +409,6 @@ class DevFS {
_pendingOperations
.
clear
();
}
_dirtyEntries
.
clear
();
status
.
stop
(
showElapsedTime:
true
);
}
else
{
printStatus
(
"No files to update."
);
}
if
(
sb
!=
null
)
...
...
packages/flutter_tools/lib/src/hot.dart
View file @
d3d9e1ca
...
...
@@ -18,12 +18,12 @@ import 'cache.dart';
import
'commands/build_apk.dart'
;
import
'commands/install.dart'
;
import
'dart/package_map.dart'
;
import
'devfs.dart'
;
import
'device.dart'
;
import
'globals.dart'
;
import
'devfs.dart'
;
import
'vmservice.dart'
;
import
'resident_runner.dart'
;
import
'toolchain.dart'
;
import
'vmservice.dart'
;
const
bool
kHotReloadDefault
=
true
;
...
...
@@ -272,7 +272,7 @@ class HotRunner extends ResidentRunner {
}
await
vmService
.
vm
.
refreshViews
();
printStatus
(
'Connected to
view
\'
${vmService.vm.mainView}
\'
.'
);
printStatus
(
'Connected to
${vmService.vm.mainView}
.'
);
printStatus
(
'Running
${getDisplayPath(_mainPath)}
on
${device.name}
...'
);
_loaderShowMessage
(
'Launching...'
);
...
...
@@ -284,7 +284,7 @@ class HotRunner extends ResidentRunner {
registerSignalHandlers
();
print
Status
(
'Finishing file synchronization...
'
);
print
Trace
(
'Finishing file synchronization
'
);
// Finish the file sync now.
await
_updateDevFS
();
...
...
@@ -347,13 +347,12 @@ class HotRunner extends ResidentRunner {
}
Future
<
bool
>
_updateDevFS
({
DevFSProgressReporter
progressReporter
})
async
{
Status
devFSStatus
=
logger
.
startProgress
(
'Syncing files to device...'
);
final
bool
rebuildBundle
=
bundle
.
needsBuild
();
if
(
rebuildBundle
)
{
Status
bundleStatus
=
logger
.
startProgress
(
'Updating assets...
'
);
printTrace
(
'Updating assets
'
);
await
bundle
.
build
();
bundleStatus
.
stop
(
showElapsedTime:
true
);
}
Status
devFSStatus
=
logger
.
startProgress
(
'Syncing files to device...'
);
await
_devFS
.
update
(
progressReporter:
progressReporter
,
bundle:
bundle
,
bundleDirty:
rebuildBundle
,
...
...
@@ -426,8 +425,8 @@ class HotRunner extends ResidentRunner {
}
restartStatus
.
stop
(
showElapsedTime:
true
);
if
(
waitForFrame
)
{
printStatus
(
'Restart
time:
'
'
${getElapsedAsMilliseconds(firstFrameTimer.elapsed)}
'
);
printStatus
(
'Restart
performed in
'
'
${getElapsedAsMilliseconds(firstFrameTimer.elapsed)}
.
'
);
if
(
benchmarkMode
)
{
benchmarkData
[
'hotRestartMillisecondsToFrame'
]
=
firstFrameTimer
.
elapsed
.
inMilliseconds
;
...
...
@@ -495,17 +494,14 @@ class HotRunner extends ResidentRunner {
return
false
;
}
await
_evictDirtyAssets
();
Status
reassembleStatus
=
logger
.
startProgress
(
'Reassembling application...'
);
printTrace
(
'Reassembling application'
);
bool
waitForFrame
=
true
;
try
{
waitForFrame
=
(
await
currentView
.
uiIsolate
.
flutterReassemble
()
!=
null
);
}
catch
(
_
)
{
reassembleStatus
.
stop
(
showElapsedTime:
true
);
printError
(
'Reassembling application failed.'
);
return
false
;
}
reassembleStatus
.
stop
(
showElapsedTime:
true
);
try
{
/* ensure that a frame is scheduled */
await
currentView
.
uiIsolate
.
uiWindowScheduleFrame
();
...
...
@@ -516,8 +512,8 @@ class HotRunner extends ResidentRunner {
// When the framework is present, we can wait for the first frame
// event and measure reload itme.
await
firstFrameTimer
.
firstFrame
();
printStatus
(
'Hot reload
time:
'
'
${getElapsedAsMilliseconds(firstFrameTimer.elapsed)}
'
);
printStatus
(
'Hot reload
performed in
'
'
${getElapsedAsMilliseconds(firstFrameTimer.elapsed)}
.
'
);
if
(
benchmarkMode
)
{
benchmarkData
[
'hotReloadMillisecondsToFrame'
]
=
firstFrameTimer
.
elapsed
.
inMilliseconds
;
...
...
packages/flutter_tools/lib/src/run.dart
View file @
d3d9e1ca
...
...
@@ -202,7 +202,7 @@ class RunAndStayResident extends ResidentRunner {
if
(
vmService
!=
null
)
{
await
vmService
.
vm
.
refreshViews
();
printStatus
(
'Connected to
view
\'
${vmService.vm.mainView}
\'
.'
);
printStatus
(
'Connected to
${vmService.vm.mainView}
\
.'
);
}
if
(
vmService
!=
null
&&
traceStartup
)
{
...
...
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