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
d121df99
Unverified
Commit
d121df99
authored
Apr 26, 2019
by
chunhtai
Committed by
GitHub
Apr 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 31511: Test performance has regressed (#31582)
parent
14f2f98f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+25
-1
No files found.
packages/flutter_tools/lib/src/commands/test.dart
View file @
d121df99
...
...
@@ -13,6 +13,7 @@ import '../bundle.dart';
import
'../cache.dart'
;
import
'../codegen.dart'
;
import
'../dart/pub.dart'
;
import
'../devfs.dart'
;
import
'../globals.dart'
;
import
'../project.dart'
;
import
'../runner/flutter_command.dart'
;
...
...
@@ -239,7 +240,30 @@ class TestCommand extends FastFlutterCommand {
if
(
build
!=
0
)
{
throwToolExit
(
'Error: Failed to build asset bundle'
);
}
await
writeBundle
(
fs
.
directory
(
fs
.
path
.
join
(
'build'
,
'unit_test_assets'
)),
assetBundle
.
entries
);
if
(
_needRebuild
(
assetBundle
.
entries
))
{
await
writeBundle
(
fs
.
directory
(
fs
.
path
.
join
(
'build'
,
'unit_test_assets'
)),
assetBundle
.
entries
);
}
}
bool
_needRebuild
(
Map
<
String
,
DevFSContent
>
entries
)
{
final
File
manifest
=
fs
.
file
(
fs
.
path
.
join
(
'build'
,
'unit_test_assets'
,
'AssetManifest.json'
));
if
(!
manifest
.
existsSync
())
{
return
true
;
}
final
DateTime
lastModified
=
manifest
.
lastModifiedSync
();
final
File
pub
=
fs
.
file
(
'pubspec.yaml'
);
if
(
pub
.
lastModifiedSync
().
isAfter
(
lastModified
))
{
return
true
;
}
for
(
DevFSFileContent
entry
in
entries
.
values
.
whereType
<
DevFSFileContent
>())
{
// Calling isModified to access file stats first in order for isModifiedAfter
// to work.
if
(
entry
.
isModified
&&
entry
.
isModifiedAfter
(
lastModified
))
{
return
true
;
}
}
return
false
;
}
}
...
...
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