mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
share a common default for enabling hot reload (#6081)
This commit is contained in:
parent
c5567a5fd2
commit
f7d501024c
@ -293,7 +293,7 @@ class AppDomain extends Domain {
|
||||
String route = _getStringArg(args, 'route');
|
||||
String mode = _getStringArg(args, 'mode');
|
||||
String target = _getStringArg(args, 'target');
|
||||
bool hotMode = _getBoolArg(args, 'hot') ?? false;
|
||||
bool enableHotReload = _getBoolArg(args, 'hot') ?? kHotReloadDefault;
|
||||
|
||||
Device device = daemon.deviceDomain._getOrLocateDevice(deviceId);
|
||||
if (device == null)
|
||||
@ -323,7 +323,7 @@ class AppDomain extends Domain {
|
||||
|
||||
ResidentRunner runner;
|
||||
|
||||
if (hotMode) {
|
||||
if (enableHotReload) {
|
||||
runner = new HotRunner(
|
||||
device,
|
||||
target: target,
|
||||
@ -339,7 +339,7 @@ class AppDomain extends Domain {
|
||||
);
|
||||
}
|
||||
|
||||
bool supportsRestart = hotMode ? device.supportsHotMode : device.supportsRestart;
|
||||
bool supportsRestart = enableHotReload ? device.supportsHotMode : device.supportsRestart;
|
||||
|
||||
AppInstance app = new AppInstance(_getNextAppId(), runner);
|
||||
_apps.add(app);
|
||||
|
@ -66,7 +66,7 @@ class RunCommand extends RunCommandBase {
|
||||
// Option to enable hot reloading.
|
||||
argParser.addFlag('hot',
|
||||
negatable: true,
|
||||
defaultsTo: true,
|
||||
defaultsTo: kHotReloadDefault,
|
||||
help: 'Run with support for hot reloading.');
|
||||
|
||||
// Option to write the pid to a file.
|
||||
|
@ -25,6 +25,8 @@ import 'vmservice.dart';
|
||||
import 'resident_runner.dart';
|
||||
import 'toolchain.dart';
|
||||
|
||||
const bool kHotReloadDefault = true;
|
||||
|
||||
String getDevFSLoaderScript() {
|
||||
return path.absolute(path.join(Cache.flutterRoot,
|
||||
'packages',
|
||||
|
Loading…
Reference in New Issue
Block a user