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
8e6205fe
Unverified
Commit
8e6205fe
authored
Aug 08, 2019
by
Jonah Williams
Committed by
GitHub
Aug 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle thrown maps and rejects from fe server (#37743)
parent
f887542a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
26 deletions
+16
-26
compile.dart
packages/flutter_tools/lib/src/compile.dart
+1
-1
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+9
-15
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+1
-2
vmservice.dart
packages/flutter_tools/lib/src/vmservice.dart
+1
-1
compile_test.dart
packages/flutter_tools/test/general.shard/compile_test.dart
+4
-7
No files found.
packages/flutter_tools/lib/src/compile.dart
View file @
8e6205fe
...
@@ -653,7 +653,7 @@ class ResidentCompiler {
...
@@ -653,7 +653,7 @@ class ResidentCompiler {
if
(!
_compileRequestNeedsConfirmation
)
{
if
(!
_compileRequestNeedsConfirmation
)
{
return
Future
<
CompilerOutput
>.
value
(
null
);
return
Future
<
CompilerOutput
>.
value
(
null
);
}
}
_stdoutHandler
.
reset
();
_stdoutHandler
.
reset
(
expectSources:
false
);
_server
.
stdin
.
writeln
(
'reject'
);
_server
.
stdin
.
writeln
(
'reject'
);
printTrace
(
'<- reject'
);
printTrace
(
'<- reject'
);
_compileRequestNeedsConfirmation
=
false
;
_compileRequestNeedsConfirmation
=
false
;
...
...
packages/flutter_tools/lib/src/resident_runner.dart
View file @
8e6205fe
...
@@ -540,12 +540,10 @@ abstract class ResidentRunner {
...
@@ -540,12 +540,10 @@ abstract class ResidentRunner {
this
.
stayResident
=
true
,
this
.
stayResident
=
true
,
this
.
hotMode
=
true
,
this
.
hotMode
=
true
,
this
.
dillOutputPath
,
this
.
dillOutputPath
,
})
{
})
:
mainPath
=
findMainDartFile
(
target
),
_mainPath
=
findMainDartFile
(
target
);
projectRootPath
=
projectRootPath
??
fs
.
currentDirectory
.
path
,
_projectRootPath
=
projectRootPath
??
fs
.
currentDirectory
.
path
;
packagesFilePath
=
packagesFilePath
??
fs
.
path
.
absolute
(
PackageMap
.
globalPackagesPath
),
_packagesFilePath
=
assetBundle
=
AssetBundleFactory
.
instance
.
createBundle
()
{
packagesFilePath
??
fs
.
path
.
absolute
(
PackageMap
.
globalPackagesPath
);
_assetBundle
=
AssetBundleFactory
.
instance
.
createBundle
();
// TODO(jonahwilliams): this is transitionary logic to allow us to support
// TODO(jonahwilliams): this is transitionary logic to allow us to support
// platforms that are not yet using flutter assemble. In the "new world",
// platforms that are not yet using flutter assemble. In the "new world",
// builds are isolated based on a number of factors. Thus, we cannot assume
// builds are isolated based on a number of factors. Thus, we cannot assume
...
@@ -570,19 +568,15 @@ abstract class ResidentRunner {
...
@@ -570,19 +568,15 @@ abstract class ResidentRunner {
final
bool
ipv6
;
final
bool
ipv6
;
final
Completer
<
int
>
_finished
=
Completer
<
int
>();
final
Completer
<
int
>
_finished
=
Completer
<
int
>();
final
String
dillOutputPath
;
final
String
dillOutputPath
;
final
String
packagesFilePath
;
final
String
projectRootPath
;
final
String
mainPath
;
final
AssetBundle
assetBundle
;
bool
_exited
=
false
;
bool
_exited
=
false
;
bool
hotMode
;
bool
hotMode
;
String
_packagesFilePath
;
String
get
packagesFilePath
=>
_packagesFilePath
;
String
_projectRootPath
;
String
get
projectRootPath
=>
_projectRootPath
;
String
_mainPath
;
String
get
mainPath
=>
_mainPath
;
String
getReloadPath
({
bool
fullRestart
})
=>
mainPath
+
(
fullRestart
?
''
:
'.incremental'
)
+
'.dill'
;
String
getReloadPath
({
bool
fullRestart
})
=>
mainPath
+
(
fullRestart
?
''
:
'.incremental'
)
+
'.dill'
;
AssetBundle
_assetBundle
;
AssetBundle
get
assetBundle
=>
_assetBundle
;
bool
get
isRunningDebug
=>
debuggingOptions
.
buildInfo
.
isDebug
;
bool
get
isRunningDebug
=>
debuggingOptions
.
buildInfo
.
isDebug
;
bool
get
isRunningProfile
=>
debuggingOptions
.
buildInfo
.
isProfile
;
bool
get
isRunningProfile
=>
debuggingOptions
.
buildInfo
.
isProfile
;
bool
get
isRunningRelease
=>
debuggingOptions
.
buildInfo
.
isRelease
;
bool
get
isRunningRelease
=>
debuggingOptions
.
buildInfo
.
isRelease
;
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
8e6205fe
...
@@ -654,7 +654,7 @@ class HotRunner extends ResidentRunner {
...
@@ -654,7 +654,7 @@ class HotRunner extends ResidentRunner {
for
(
FlutterDevice
device
in
flutterDevices
)
{
for
(
FlutterDevice
device
in
flutterDevices
)
{
for
(
FlutterView
view
in
device
.
views
)
{
for
(
FlutterView
view
in
device
.
views
)
{
if
(
view
.
uiIsolate
==
null
)
{
if
(
view
.
uiIsolate
==
null
)
{
throw
'Application isolate not found'
;
return
OperationResult
(
2
,
'Application isolate not found'
,
fatal:
true
)
;
}
}
}
}
}
}
...
@@ -762,7 +762,6 @@ class HotRunner extends ResidentRunner {
...
@@ -762,7 +762,6 @@ class HotRunner extends ResidentRunner {
}
}
// Record time it took for the VM to reload the sources.
// Record time it took for the VM to reload the sources.
_addBenchmarkData
(
'hotReloadVMReloadMilliseconds'
,
vmReloadTimer
.
elapsed
.
inMilliseconds
);
_addBenchmarkData
(
'hotReloadVMReloadMilliseconds'
,
vmReloadTimer
.
elapsed
.
inMilliseconds
);
final
Stopwatch
reassembleTimer
=
Stopwatch
()..
start
();
final
Stopwatch
reassembleTimer
=
Stopwatch
()..
start
();
// Reload the isolate.
// Reload the isolate.
final
List
<
Future
<
void
>>
allDevices
=
<
Future
<
void
>>[];
final
List
<
Future
<
void
>>
allDevices
=
<
Future
<
void
>>[];
...
...
packages/flutter_tools/lib/src/vmservice.dart
View file @
8e6205fe
...
@@ -1177,7 +1177,7 @@ class Isolate extends ServiceObjectOwner {
...
@@ -1177,7 +1177,7 @@ class Isolate extends ServiceObjectOwner {
final
Map
<
String
,
dynamic
>
response
=
await
invokeRpcRaw
(
'_reloadSources'
,
params:
arguments
);
final
Map
<
String
,
dynamic
>
response
=
await
invokeRpcRaw
(
'_reloadSources'
,
params:
arguments
);
return
response
;
return
response
;
}
on
rpc
.
RpcException
catch
(
e
)
{
}
on
rpc
.
RpcException
catch
(
e
)
{
return
Future
<
Map
<
String
,
dynamic
>>.
error
(<
String
,
dynamic
>{
return
Future
<
Map
<
String
,
dynamic
>>.
value
(<
String
,
dynamic
>{
'code'
:
e
.
code
,
'code'
:
e
.
code
,
'message'
:
e
.
message
,
'message'
:
e
.
message
,
'data'
:
e
.
data
,
'data'
:
e
.
data
,
...
...
packages/flutter_tools/test/general.shard/compile_test.dart
View file @
8e6205fe
...
@@ -266,7 +266,6 @@ example:org-dartlang-app:/
...
@@ -266,7 +266,6 @@ example:org-dartlang-app:/
testUsingContext
(
'compile and recompile'
,
()
async
{
testUsingContext
(
'compile and recompile'
,
()
async
{
final
BufferLogger
logger
=
context
.
get
<
Logger
>();
final
BufferLogger
logger
=
context
.
get
<
Logger
>();
final
StreamController
<
List
<
int
>>
streamController
=
StreamController
<
List
<
int
>>();
final
StreamController
<
List
<
int
>>
streamController
=
StreamController
<
List
<
int
>>();
when
(
mockFrontendServer
.
stdout
)
when
(
mockFrontendServer
.
stdout
)
.
thenAnswer
((
Invocation
invocation
)
=>
streamController
.
stream
);
.
thenAnswer
((
Invocation
invocation
)
=>
streamController
.
stream
);
...
@@ -289,11 +288,10 @@ example:org-dartlang-app:/
...
@@ -289,11 +288,10 @@ example:org-dartlang-app:/
await
_accept
(
streamController
,
generator
,
mockFrontendServerStdIn
,
'^accept
\\
n
\$
'
);
await
_accept
(
streamController
,
generator
,
mockFrontendServerStdIn
,
'^accept
\\
n
\$
'
);
await
_recompile
(
streamController
,
generator
,
mockFrontendServerStdIn
,
await
_recompile
(
streamController
,
generator
,
mockFrontendServerStdIn
,
'result abc
\n
line1
\n
line2
\n
abc
\n
abc /path/to/main.dart.dill 0
\n
'
);
'result abc
\n
line1
\n
line2
\n
abc
\n
abc /path/to/main.dart.dill 0
\n
'
);
// No sources returned from reject command.
await
_reject
(
streamController
,
generator
,
mockFrontendServerStdIn
,
'result abc
\n
abc
\n
abc
\n
abc'
,
await
_reject
(
streamController
,
generator
,
mockFrontendServerStdIn
,
'result abc
\n
abc
\n
'
,
'^reject
\\
n
\$
'
);
'^reject
\\
n
\$
'
);
verifyNoMoreInteractions
(
mockFrontendServerStdIn
);
verifyNoMoreInteractions
(
mockFrontendServerStdIn
);
expect
(
mockFrontendServerStdIn
.
getAndClear
(),
isEmpty
);
expect
(
mockFrontendServerStdIn
.
getAndClear
(),
isEmpty
);
expect
(
logger
.
errorText
,
equals
(
expect
(
logger
.
errorText
,
equals
(
...
@@ -578,7 +576,6 @@ Future<void> _reject(
...
@@ -578,7 +576,6 @@ Future<void> _reject(
expect
(
commands
,
matches
(
re
));
expect
(
commands
,
matches
(
re
));
mockFrontendServerStdIn
.
_stdInWrites
.
clear
();
mockFrontendServerStdIn
.
_stdInWrites
.
clear
();
}
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockProcess
extends
Mock
implements
Process
{}
class
MockProcess
extends
Mock
implements
Process
{}
class
MockStream
extends
Mock
implements
Stream
<
List
<
int
>>
{}
class
MockStream
extends
Mock
implements
Stream
<
List
<
int
>>
{}
...
...
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