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
661740d2
Commit
661740d2
authored
Jun 15, 2016
by
Devon Carew
Committed by
GitHub
Jun 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updates from previous review (#4577)
parent
fc2dbdee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
19 deletions
+22
-19
run.dart
packages/flutter_tools/lib/src/run.dart
+22
-19
No files found.
packages/flutter_tools/lib/src/run.dart
View file @
661740d2
...
...
@@ -303,7 +303,7 @@ class RunAndStayResident {
await
devFS
.
init
();
}
catch
(
error
)
{
devFS
=
null
;
printError
(
'Error initi
ng DevFS
:
$error
'
);
printError
(
'Error initi
alizing development client
:
$error
'
);
return
null
;
}
}
...
...
@@ -313,7 +313,7 @@ class RunAndStayResident {
_sendFiles
(
directory
,
''
,
_dartFiles
(
directory
.
listSync
()));
directory
=
new
Directory
(
'lib'
);
_sendFiles
(
directory
,
'lib'
,
_dartFiles
(
directory
.
listSync
(
recursive:
true
,
followLinks:
false
)));
_sendFiles
(
directory
,
'lib'
,
_dartFiles
(
directory
.
listSync
(
recursive:
true
)));
// Send the packages.
if
(
FileSystemEntity
.
isFileSync
(
kPackagesFileName
))
{
...
...
@@ -329,7 +329,7 @@ class RunAndStayResident {
_sendFiles
(
directory
,
'packages/
$packageName
'
,
_dartFiles
(
directory
.
listSync
(
recursive:
true
,
followLinks:
false
))
_dartFiles
(
directory
.
listSync
(
recursive:
true
))
);
}
}
...
...
@@ -338,7 +338,7 @@ class RunAndStayResident {
try
{
await
devFS
.
flush
();
}
catch
(
error
)
{
printError
(
'Error sending
DevFS files
:
$error
'
);
printError
(
'Error sending
sources to the client device
:
$error
'
);
}
}
...
...
@@ -355,8 +355,7 @@ class RunAndStayResident {
List
<
File
>
_dartFiles
(
List
<
FileSystemEntity
>
entities
)
{
return
new
List
<
File
>.
from
(
entities
.
where
((
FileSystemEntity
entity
)
=>
entity
is
File
)
.
where
((
File
file
)
=>
file
.
path
.
endsWith
(
'.dart'
)));
.
where
((
FileSystemEntity
entity
)
=>
entity
is
File
&&
entity
.
path
.
endsWith
(
'.dart'
)));
}
void
_printHelp
()
{
...
...
@@ -425,21 +424,21 @@ class DevFS {
final
Observatory
observatory
;
String
fsName
;
Map
<
String
,
DevFSFileEntry
>
entries
=
<
String
,
DevFSFileEntry
>{};
Map
<
String
,
_DevFSFileEntry
>
entries
=
<
String
,
_
DevFSFileEntry
>{};
Future
<
dynamic
>
init
()
=>
observatory
.
createDevFS
(
fsName
);
void
stageFile
(
String
devPath
,
File
file
)
{
entries
.
putIfAbsent
(
devPath
,
()
=>
new
DevFSFileEntry
(
devPath
,
file
));
entries
.
putIfAbsent
(
devPath
,
()
=>
new
_
DevFSFileEntry
(
devPath
,
file
));
}
/// Flush any modified files to the devfs.
Future
<
Null
>
flush
()
async
{
List
<
DevFSFileEntry
>
toSend
=
entries
.
values
.
where
((
DevFSFileEntry
entry
)
=>
entry
.
isModified
)
List
<
_
DevFSFileEntry
>
toSend
=
entries
.
values
.
where
((
_
DevFSFileEntry
entry
)
=>
entry
.
isModified
)
.
toList
();
for
(
DevFSFileEntry
entry
in
toSend
)
{
for
(
_
DevFSFileEntry
entry
in
toSend
)
{
printTrace
(
'sending devfs://
$fsName
/
${entry.devPath}
'
);
entry
.
updateLastModified
();
}
...
...
@@ -451,21 +450,25 @@ class DevFS {
return
;
}
await
observatory
.
writeDevFSFiles
(
fsName
,
files:
toSend
.
map
((
DevFSFileEntry
entry
)
{
return
new
_DevFSFile
(
'/
${entry.devPath}
'
,
entry
.
file
);
}).
toList
()).
whenComplete
(()
{
try
{
List
<
_DevFSFile
>
files
=
toSend
.
map
((
_DevFSFileEntry
entry
)
{
return
new
_DevFSFile
(
'/
${entry.devPath}
'
,
entry
.
file
);
}).
toList
();
await
observatory
.
writeDevFSFiles
(
fsName
,
files:
files
);
}
finally
{
status
.
stop
(
showElapsedTime:
true
);
}
);
}
}
Future
<
List
<
String
>>
listDevFSFiles
()
=>
observatory
.
listDevFSFiles
(
fsName
);
}
class
DevFSFileEntry
{
DevFSFileEntry
(
this
.
devPath
,
this
.
file
);
class
_DevFSFileEntry
{
_DevFSFileEntry
(
this
.
devPath
,
this
.
file
);
final
String
devPath
;
final
File
file
;
String
devPath
;
File
file
;
DateTime
lastModified
;
bool
get
isModified
=>
lastModified
==
null
||
file
.
lastModifiedSync
().
isAfter
(
lastModified
);
...
...
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