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
a9eddd48
Commit
a9eddd48
authored
Apr 18, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also analyze the driver host entry points. (#3395)
parent
424a6b1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
analyze.dart
packages/flutter_tools/lib/src/commands/analyze.dart
+20
-5
No files found.
packages/flutter_tools/lib/src/commands/analyze.dart
View file @
a9eddd48
...
...
@@ -22,6 +22,23 @@ bool isDartFile(FileSystemEntity entry) => entry is File && entry.path.endsWith(
bool
isDartTestFile
(
FileSystemEntity
entry
)
=>
entry
is
File
&&
entry
.
path
.
endsWith
(
'_test.dart'
);
bool
isDartBenchmarkFile
(
FileSystemEntity
entry
)
=>
entry
is
File
&&
entry
.
path
.
endsWith
(
'_bench.dart'
);
RegExp
_testFileParser
=
new
RegExp
(
r'^(.+)_test(\.dart)$'
);
void
_addDriverTest
(
FileSystemEntity
entry
,
List
<
String
>
dartFiles
)
{
if
(
isDartTestFile
(
entry
))
{
final
String
testFileName
=
entry
.
path
;
dartFiles
.
add
(
testFileName
);
Match
groups
=
_testFileParser
.
firstMatch
(
testFileName
);
assert
(
groups
.
groupCount
==
2
);
final
String
hostFileName
=
'
${groups[1]}${groups[2]}
'
;
File
hostFile
=
new
File
(
hostFileName
);
if
(
hostFile
.
existsSync
())
{
assert
(
isDartFile
(
hostFile
));
dartFiles
.
add
(
hostFileName
);
}
}
}
void
_addPackage
(
String
directoryPath
,
List
<
String
>
dartFiles
,
Set
<
String
>
pubSpecDirectories
)
{
final
int
originalDartFilesCount
=
dartFiles
.
length
;
...
...
@@ -61,12 +78,10 @@ void _addPackage(String directoryPath, List<String> dartFiles, Set<String> pubSp
if
(
testDriverDirectory
.
existsSync
())
{
for
(
FileSystemEntity
entry
in
testDriverDirectory
.
listSync
())
{
if
(
entry
is
Directory
)
{
for
(
FileSystemEntity
subentry
in
entry
.
listSync
())
{
if
(
isDartTestFile
(
subentry
))
dartFiles
.
add
(
subentry
.
path
);
}
for
(
FileSystemEntity
subentry
in
entry
.
listSync
())
_addDriverTest
(
subentry
,
dartFiles
);
}
else
if
(
isDartTestFile
(
entry
))
{
dartFiles
.
add
(
entry
.
path
);
_addDriverTest
(
entry
,
dartFiles
);
}
}
}
...
...
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