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
11ca0f1a
Commit
11ca0f1a
authored
Nov 10, 2016
by
John McCutchan
Committed by
GitHub
Nov 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support caching host filesystem symlink targets to speedup DevFS updates (#6798)
parent
bbf98d9c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
executable.dart
packages/flutter_tools/lib/executable.dart
+2
-0
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+26
-6
No files found.
packages/flutter_tools/lib/executable.dart
View file @
11ca0f1a
...
...
@@ -35,6 +35,7 @@ import 'src/commands/test.dart';
import
'src/commands/trace.dart'
;
import
'src/commands/update_packages.dart'
;
import
'src/commands/upgrade.dart'
;
import
'src/devfs.dart'
;
import
'src/device.dart'
;
import
'src/doctor.dart'
;
import
'src/globals.dart'
;
...
...
@@ -83,6 +84,7 @@ Future<Null> main(List<String> args) async {
// Initialize globals.
context
[
Logger
]
=
new
StdoutLogger
();
context
[
DeviceManager
]
=
new
DeviceManager
();
context
[
DevFSConfig
]
=
new
DevFSConfig
();
Doctor
.
initGlobal
();
dynamic
result
=
await
runner
.
run
(
args
);
...
...
packages/flutter_tools/lib/src/devfs.dart
View file @
11ca0f1a
...
...
@@ -8,6 +8,7 @@ import 'dart:io';
import
'package:path/path.dart'
as
path
;
import
'base/context.dart'
;
import
'build_info.dart'
;
import
'dart/package_map.dart'
;
import
'asset.dart'
;
...
...
@@ -16,6 +17,13 @@ import 'vmservice.dart';
typedef
void
DevFSProgressReporter
(
int
progress
,
int
max
);
class
DevFSConfig
{
/// Should DevFS assume that symlink targets are stable?
bool
cacheSymlinks
=
false
;
}
DevFSConfig
get
devFSConfig
=>
context
[
DevFSConfig
];
// A file that has been added to a DevFS.
class
DevFSEntry
{
DevFSEntry
(
this
.
devicePath
,
this
.
file
)
...
...
@@ -30,10 +38,13 @@ class DevFSEntry {
String
get
assetPath
=>
bundleEntry
.
archivePath
;
final
FileSystemEntity
file
;
FileSystemEntity
_linkTarget
;
FileStat
_fileStat
;
// When we scanned for files, did this still exist?
bool
_exists
=
false
;
DateTime
get
lastModified
=>
_fileStat
?.
modified
;
bool
get
_isSourceEntry
=>
file
==
null
;
bool
get
_isAssetEntry
=>
bundleEntry
!=
null
;
bool
get
stillExists
{
if
(
_isSourceEntry
)
return
true
;
...
...
@@ -67,19 +78,28 @@ class DevFSEntry {
void
_stat
()
{
if
(
_isSourceEntry
)
return
;
if
(
_linkTarget
!=
null
)
{
// Stat the cached symlink target.
_fileStat
=
_linkTarget
.
statSync
();
return
;
}
_fileStat
=
file
.
statSync
();
if
(
_fileStat
.
type
==
FileSystemEntityType
.
LINK
)
{
//
Stat the
link target.
//
Resolve, stat, and maybe cache the sym
link target.
String
resolved
=
file
.
resolveSymbolicLinksSync
();
_fileStat
=
FileStat
.
statSync
(
resolved
);
FileSystemEntity
linkTarget
=
new
File
(
resolved
);
// Stat the link target.
_fileStat
=
linkTarget
.
statSync
();
if
(
devFSConfig
.
cacheSymlinks
)
{
_linkTarget
=
linkTarget
;
}
}
}
bool
get
_isSourceEntry
=>
file
==
null
;
bool
get
_isAssetEntry
=>
bundleEntry
!=
null
;
File
_getFile
()
{
if
(
_linkTarget
!=
null
)
{
return
_linkTarget
;
}
if
(
file
is
Link
)
{
// The link target.
return
new
File
(
file
.
resolveSymbolicLinksSync
());
...
...
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