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
fd50ccdd
Commit
fd50ccdd
authored
Sep 13, 2016
by
John McCutchan
Committed by
GitHub
Sep 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable hot mode by default. --no-hot disables it (#5794)
parent
e85f1629
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+13
-11
No files found.
packages/flutter_tools/lib/src/commands/run.dart
View file @
fd50ccdd
...
...
@@ -65,8 +65,8 @@ class RunCommand extends RunCommandBase {
// Option to enable hot reloading.
argParser
.
addFlag
(
'hot'
,
negatable:
fals
e
,
defaultsTo:
fals
e
,
negatable:
tru
e
,
defaultsTo:
tru
e
,
help:
'Run with support for hot reloading.'
);
// Option to write the pid to a file.
...
...
@@ -90,7 +90,7 @@ class RunCommand extends RunCommandBase {
String
get
usagePath
{
Device
device
=
deviceForCommand
;
String
command
=
argResults
[
'hot'
]
?
'hotrun'
:
name
;
String
command
=
shouldUseHotMode
()
?
'hotrun'
:
name
;
if
(
device
==
null
)
return
command
;
...
...
@@ -111,6 +111,10 @@ class RunCommand extends RunCommandBase {
}
}
bool
shouldUseHotMode
()
{
return
argResults
[
'hot'
]
&&
(
getBuildMode
()
==
BuildMode
.
debug
);
}
@override
Future
<
int
>
runInProject
()
async
{
int
debugPort
;
...
...
@@ -143,16 +147,14 @@ class RunCommand extends RunCommandBase {
Cache
.
releaseLockEarly
();
// Do some early error checks for hot mode.
bool
hotMode
=
argResults
[
'hot'
];
// Enable hot mode by default if ``--no-hot` was not passed and we are in
// debug mode.
final
bool
hotMode
=
shouldUseHotMode
();
if
(
hotMode
)
{
if
(
getBuildMode
()
!=
BuildMode
.
debug
)
{
printError
(
'Hot mode only works with debug builds.'
);
return
1
;
}
if
(!
deviceForCommand
.
supportsHotMode
)
{
printError
(
'Hot mode is not supported by this device.'
);
printError
(
'Hot mode is not supported by this device. '
'Run with --no-hot.'
);
return
1
;
}
}
...
...
@@ -164,7 +166,7 @@ class RunCommand extends RunCommandBase {
}
ResidentRunner
runner
;
if
(
argResults
[
'hot'
]
)
{
if
(
hotMode
)
{
runner
=
new
HotRunner
(
deviceForCommand
,
target:
targetFile
,
...
...
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