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
e4f586d2
Commit
e4f586d2
authored
Mar 03, 2017
by
Michael Goderbauer
Committed by
GitHub
Mar 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Hot Restart on Windows (#8548)
parent
1bb164ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
26 deletions
+25
-26
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+12
-14
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+13
-12
No files found.
packages/flutter_tools/lib/src/run_hot.dart
View file @
e4f586d2
...
@@ -313,25 +313,23 @@ class HotRunner extends ResidentRunner {
...
@@ -313,25 +313,23 @@ class HotRunner extends ResidentRunner {
_devFS
=
null
;
_devFS
=
null
;
}
}
Future
<
Null
>
_launchInView
(
String
entryPath
,
Future
<
Null
>
_launchInView
(
Uri
entryUri
,
String
packagesPath
,
Uri
packagesUri
,
String
assetsDirectoryPath
)
async
{
Uri
assetsDirectoryUri
)
async
{
FlutterView
view
=
vmService
.
vm
.
mainView
;
FlutterView
view
=
vmService
.
vm
.
mainView
;
return
view
.
runFromSource
(
entry
Path
,
packagesPath
,
assetsDirectoryPath
);
return
view
.
runFromSource
(
entry
Uri
,
packagesUri
,
assetsDirectoryUri
);
}
}
Future
<
Null
>
_launchFromDevFS
(
ApplicationPackage
package
,
Future
<
Null
>
_launchFromDevFS
(
ApplicationPackage
package
,
String
mainScript
)
async
{
String
mainScript
)
async
{
String
entryPath
=
fs
.
path
.
relative
(
mainScript
,
from:
projectRootPath
);
String
entryUri
=
fs
.
path
.
relative
(
mainScript
,
from:
projectRootPath
);
String
deviceEntryPath
=
Uri
deviceEntryUri
=
_devFS
.
baseUri
.
resolveUri
(
fs
.
path
.
toUri
(
entryUri
));
_devFS
.
baseUri
.
resolve
(
entryPath
).
toFilePath
();
Uri
devicePackagesUri
=
_devFS
.
baseUri
.
resolve
(
'.packages'
);
String
devicePackagesPath
=
Uri
deviceAssetsDirectoryUri
=
_devFS
.
baseUri
.
resolve
(
'.packages'
).
toFilePath
();
_devFS
.
baseUri
.
resolveUri
(
fs
.
path
.
toUri
(
getAssetBuildDirectory
()));
String
deviceAssetsDirectoryPath
=
await
_launchInView
(
deviceEntryUri
,
_devFS
.
baseUri
.
resolve
(
getAssetBuildDirectory
()).
toFilePath
();
devicePackagesUri
,
await
_launchInView
(
deviceEntryPath
,
deviceAssetsDirectoryUri
);
devicePackagesPath
,
deviceAssetsDirectoryPath
);
}
}
Future
<
OperationResult
>
_restartFromSources
()
async
{
Future
<
OperationResult
>
_restartFromSources
()
async
{
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
e4f586d2
...
@@ -710,15 +710,16 @@ class VM extends ServiceObjectOwner {
...
@@ -710,15 +710,16 @@ class VM extends ServiceObjectOwner {
}
}
Future
<
ServiceMap
>
runInView
(
String
viewId
,
Future
<
ServiceMap
>
runInView
(
String
viewId
,
String
main
,
Uri
main
,
String
packages
,
Uri
packages
,
String
assetsDirectory
)
{
Uri
assetsDirectory
)
{
// TODO(goderbauer): Transfer Uri (instead of file path) when remote end supports it.
return
invokeRpc
(
'_flutter.runInView'
,
return
invokeRpc
(
'_flutter.runInView'
,
params:
<
String
,
dynamic
>
{
params:
<
String
,
dynamic
>
{
'viewId'
:
viewId
,
'viewId'
:
viewId
,
'mainScript'
:
main
,
'mainScript'
:
main
.
toFilePath
(
windows:
false
)
,
'packagesFile'
:
packages
,
'packagesFile'
:
packages
.
toFilePath
(
windows:
false
)
,
'assetDirectory'
:
assetsDirectory
'assetDirectory'
:
assetsDirectory
.
toFilePath
(
windows:
false
)
});
});
}
}
...
@@ -1024,9 +1025,9 @@ class FlutterView extends ServiceObject {
...
@@ -1024,9 +1025,9 @@ class FlutterView extends ServiceObject {
}
}
// TODO(johnmccutchan): Report errors when running failed.
// TODO(johnmccutchan): Report errors when running failed.
Future
<
Null
>
runFromSource
(
String
entryPath
,
Future
<
Null
>
runFromSource
(
Uri
entryUri
,
String
packagesPath
,
Uri
packagesUri
,
String
assetsDirectoryPath
)
async
{
Uri
assetsDirectoryUri
)
async
{
final
String
viewId
=
id
;
final
String
viewId
=
id
;
// When this completer completes the isolate is running.
// When this completer completes the isolate is running.
final
Completer
<
Null
>
completer
=
new
Completer
<
Null
>();
final
Completer
<
Null
>
completer
=
new
Completer
<
Null
>();
...
@@ -1040,9 +1041,9 @@ class FlutterView extends ServiceObject {
...
@@ -1040,9 +1041,9 @@ class FlutterView extends ServiceObject {
}
}
});
});
await
owner
.
vm
.
runInView
(
viewId
,
await
owner
.
vm
.
runInView
(
viewId
,
entry
Path
,
entry
Uri
,
packages
Path
,
packages
Uri
,
assetsDirectory
Path
);
assetsDirectory
Uri
);
await
completer
.
future
;
await
completer
.
future
;
await
owner
.
vm
.
refreshViews
();
await
owner
.
vm
.
refreshViews
();
await
subscription
.
cancel
();
await
subscription
.
cancel
();
...
...
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