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
5ec039dd
Unverified
Commit
5ec039dd
authored
Aug 15, 2019
by
Jonah Williams
Committed by
GitHub
Aug 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't reload if compilation has errors (#38586)
parent
b296d953
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+1
-1
devfs_test.dart
packages/flutter_tools/test/general.shard/devfs_test.dart
+31
-0
No files found.
packages/flutter_tools/lib/src/devfs.dart
View file @
5ec039dd
...
...
@@ -467,7 +467,7 @@ class DevFS {
outputPath:
dillOutputPath
??
getDefaultApplicationKernelPath
(
trackWidgetCreation:
trackWidgetCreation
),
packagesFilePath
:
_packagesFilePath
,
);
if
(
compilerOutput
==
null
)
{
if
(
compilerOutput
==
null
||
compilerOutput
.
errorCount
>
0
)
{
return
UpdateFSReport
(
success:
false
);
}
// list of sources that needs to be monitored are in [compilerOutput.sources]
...
...
packages/flutter_tools/test/general.shard/devfs_test.dart
View file @
5ec039dd
...
...
@@ -10,9 +10,11 @@ import 'package:file/file.dart';
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/compile.dart'
;
import
'package:flutter_tools/src/devfs.dart'
;
import
'package:flutter_tools/src/vmservice.dart'
;
import
'package:json_rpc_2/json_rpc_2.dart'
as
rpc
;
import
'package:mockito/mockito.dart'
;
import
'../src/common.dart'
;
import
'../src/context.dart'
;
...
...
@@ -100,6 +102,7 @@ void main() {
vmService
=
MockVMService
();
await
vmService
.
setUp
();
});
tearDownAll
(()
async
{
await
vmService
.
tearDown
();
_cleanupTempDirs
();
...
...
@@ -171,6 +174,33 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
});
testUsingContext
(
'reports unsuccessful compile when errors are returned'
,
()
async
{
devFS
=
DevFS
(
vmService
,
'test'
,
tempDir
);
await
devFS
.
create
();
final
RealMockResidentCompiler
residentCompiler
=
RealMockResidentCompiler
();
when
(
residentCompiler
.
recompile
(
any
,
any
,
outputPath:
anyNamed
(
'outputPath'
),
)).
thenAnswer
((
Invocation
invocation
)
{
return
Future
<
CompilerOutput
>.
value
(
const
CompilerOutput
(
'example'
,
2
,
<
Uri
>[]));
});
final
UpdateFSReport
report
=
await
devFS
.
update
(
mainPath:
'lib/foo.txt'
,
generator:
residentCompiler
,
pathToReload:
'lib/foo.txt.dill'
,
trackWidgetCreation:
false
,
invalidatedFiles:
<
Uri
>[],
);
expect
(
report
.
success
,
false
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
});
});
}
...
...
@@ -260,6 +290,7 @@ class MockVM implements VM {
dynamic
noSuchMethod
(
Invocation
invocation
)
=>
super
.
noSuchMethod
(
invocation
);
}
class
RealMockResidentCompiler
extends
Mock
implements
ResidentCompiler
{}
final
List
<
Directory
>
_tempDirs
=
<
Directory
>[];
final
Map
<
String
,
Uri
>
_packages
=
<
String
,
Uri
>{};
...
...
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