[flutter_tools] warn when main library is relocated (#62930)
This commit is contained in:
@@ -376,10 +376,19 @@ class HotRunner extends ResidentRunner {
|
||||
asyncScanning: hotRunnerConfig.asyncScanning,
|
||||
packageConfig: flutterDevices[0].devFS.lastPackageConfig,
|
||||
);
|
||||
final File entrypointFile = globals.fs.file(mainPath);
|
||||
if (!entrypointFile.existsSync()) {
|
||||
globals.printError(
|
||||
'The entrypoint file (i.e. the file with main()) ${entrypointFile.path} '
|
||||
'cannot be found. Moving or renaming this file will prevent changes to '
|
||||
'its contents from being discovered during hot reload/restart until '
|
||||
'flutter is restarted or the file is restored.'
|
||||
);
|
||||
}
|
||||
final UpdateFSReport results = UpdateFSReport(success: true);
|
||||
for (final FlutterDevice device in flutterDevices) {
|
||||
results.incorporateResults(await device.updateDevFS(
|
||||
mainUri: globals.fs.file(mainPath).absolute.uri,
|
||||
mainUri: entrypointFile.absolute.uri,
|
||||
target: target,
|
||||
bundle: assetBundle,
|
||||
firstBuildTime: firstBuildTime,
|
||||
|
||||
Reference in New Issue
Block a user