Unverified Commit af74a725 authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Send relative uri when target physical file path is specified. (#15887)

parent 2eebf6a0
...@@ -409,6 +409,7 @@ class DevFS { ...@@ -409,6 +409,7 @@ class DevFS {
ResidentCompiler generator, ResidentCompiler generator,
String dillOutputPath, String dillOutputPath,
bool fullRestart: false, bool fullRestart: false,
String projectRootPath,
}) async { }) async {
// Mark all entries as possibly deleted. // Mark all entries as possibly deleted.
for (DevFSContent content in _entries.values) { for (DevFSContent content in _entries.values) {
...@@ -503,11 +504,16 @@ class DevFS { ...@@ -503,11 +504,16 @@ class DevFS {
await generator.recompile(mainPath, invalidatedFiles, await generator.recompile(mainPath, invalidatedFiles,
outputPath: dillOutputPath ?? fs.path.join(getBuildDirectory(), 'app.dill'), outputPath: dillOutputPath ?? fs.path.join(getBuildDirectory(), 'app.dill'),
packagesFilePath : _packagesFilePath); packagesFilePath : _packagesFilePath);
if (compiledBinary != null && compiledBinary.isNotEmpty) if (compiledBinary != null && compiledBinary.isNotEmpty) {
final String entryUri = projectRootPath != null ?
fs.path.relative(mainPath, from: projectRootPath):
mainPath;
dirtyEntries.putIfAbsent( dirtyEntries.putIfAbsent(
fs.path.toUri(target + '.dill'), fs.path.toUri(entryUri + '.dill'),
() => new DevFSFileContent(fs.file(compiledBinary)) () => new DevFSFileContent(fs.file(compiledBinary))
); );
}
} }
if (dirtyEntries.isNotEmpty) { if (dirtyEntries.isNotEmpty) {
printTrace('Updating files'); printTrace('Updating files');
......
...@@ -376,7 +376,8 @@ class FlutterDevice { ...@@ -376,7 +376,8 @@ class FlutterDevice {
bool bundleFirstUpload: false, bool bundleFirstUpload: false,
bool bundleDirty: false, bool bundleDirty: false,
Set<String> fileFilter, Set<String> fileFilter,
bool fullRestart: false bool fullRestart: false,
String projectRootPath,
}) async { }) async {
final Status devFSStatus = logger.startProgress( final Status devFSStatus = logger.startProgress(
'Syncing files to device ${device.name}...', 'Syncing files to device ${device.name}...',
...@@ -395,6 +396,7 @@ class FlutterDevice { ...@@ -395,6 +396,7 @@ class FlutterDevice {
generator: generator, generator: generator,
fullRestart: fullRestart, fullRestart: fullRestart,
dillOutputPath: dillOutputPath, dillOutputPath: dillOutputPath,
projectRootPath: projectRootPath,
); );
} on DevFSException { } on DevFSException {
devFSStatus.cancel(); devFSStatus.cancel();
......
...@@ -279,7 +279,8 @@ class HotRunner extends ResidentRunner { ...@@ -279,7 +279,8 @@ class HotRunner extends ResidentRunner {
bundleFirstUpload: isFirstUpload, bundleFirstUpload: isFirstUpload,
bundleDirty: isFirstUpload == false && rebuildBundle, bundleDirty: isFirstUpload == false && rebuildBundle,
fileFilter: _dartDependencies, fileFilter: _dartDependencies,
fullRestart: fullRestart fullRestart: fullRestart,
projectRootPath: projectRootPath,
); );
if (!result) if (!result)
return false; return false;
......
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