Unverified Commit 0e4770e8 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Count kernel bytes in bytes synced by DevFS.update (#18288)

DevFS.update() returns the number of bytes synced from the host to the
target device. When running in Dart 2 mode, ensure that the size of the
kernel file is included in the count of bytes synced.
parent 0628a1fb
...@@ -397,7 +397,9 @@ class DevFS { ...@@ -397,7 +397,9 @@ class DevFS {
printTrace('DevFS: Deleted filesystem on the device ($_baseUri)'); printTrace('DevFS: Deleted filesystem on the device ($_baseUri)');
} }
/// Update files on the device and return the number of bytes sync'd /// Updates files on the device.
///
/// Returns the number of bytes synced.
Future<int> update({ Future<int> update({
String mainPath, String mainPath,
String target, String target,
...@@ -511,12 +513,13 @@ class DevFS { ...@@ -511,12 +513,13 @@ class DevFS {
final String entryUri = projectRootPath != null ? final String entryUri = projectRootPath != null ?
fs.path.relative(mainPath, from: projectRootPath): fs.path.relative(mainPath, from: projectRootPath):
mainPath; mainPath;
dirtyEntries.putIfAbsent( final Uri kernelUri = fs.path.toUri(entryUri + '.dill');
fs.path.toUri(entryUri + '.dill'), if (!dirtyEntries.containsKey(kernelUri)) {
() => new DevFSFileContent(fs.file(compiledBinary)) final DevFSFileContent content = new DevFSFileContent(fs.file(compiledBinary));
); dirtyEntries[kernelUri] = content;
numBytes += content.size;
}
} }
} }
if (dirtyEntries.isNotEmpty) { if (dirtyEntries.isNotEmpty) {
printTrace('Updating files'); printTrace('Updating files');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment