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
eb215c14
Commit
eb215c14
authored
May 05, 2016
by
pq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Review cleanup.
parent
4311ddb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
pubspec.yaml
packages/flutter_test/pubspec.yaml
+3
-1
analyze.dart
packages/flutter_tools/lib/src/commands/analyze.dart
+13
-15
No files found.
packages/flutter_test/pubspec.yaml
View file @
eb215c14
...
...
@@ -7,7 +7,9 @@ dependencies:
# here we pin it precisely to avoid version skew across our packages.
test
:
0.12.13+1
# Pinned in flutter_tools as well.
# We don't actually depend on 'analyzer', but 'test' and 'flutter_tools' do.
# We pin the version of analyzer we depend on to avoid version skew across our
# packages.
analyzer
:
0.27.4-alpha.1
flutter
:
...
...
packages/flutter_tools/lib/src/commands/analyze.dart
View file @
eb215c14
...
...
@@ -111,32 +111,31 @@ class AnalyzeCommand extends FlutterCommand {
}
}
//TODO(pq): revisit package and directory defaults
//TODO
(pq): revisit package and directory defaults
if
(
argResults
[
'current-directory'
]
&&
!
argResults
[
'flutter-repo'
])
{
// ./*.dart
Directory
c
wd
=
new
Directory
(
'.'
);
Directory
c
urrentDirectory
=
new
Directory
(
'.'
);
bool
foundOne
=
false
;
for
(
FileSystemEntity
entry
in
c
wd
.
listSync
())
{
for
(
FileSystemEntity
entry
in
c
urrentDirectory
.
listSync
())
{
if
(
isDartFile
(
entry
))
{
dartFiles
.
add
(
entry
);
foundOne
=
true
;
}
}
if
(
foundOne
)
{
pubSpecDirectories
.
add
(
cwd
);
}
if
(
foundOne
)
pubSpecDirectories
.
add
(
currentDirectory
);
}
if
(
argResults
[
'current-package'
]
&&
!
argResults
[
'flutter-repo'
])
{
// **/.*dart
Directory
c
wd
=
new
Directory
(
'.'
);
_collectDartFiles
(
c
wd
,
dartFiles
);
pubSpecDirectories
.
add
(
c
wd
);
Directory
c
urrentDirectory
=
new
Directory
(
'.'
);
_collectDartFiles
(
c
urrentDirectory
,
dartFiles
);
pubSpecDirectories
.
add
(
c
urrentDirectory
);
}
//TODO(ianh): Fix the intl package resource generator
//TODO(pq): extract this regexp from the exclude in options
//TODO
(ianh): Fix the intl package resource generator
//TODO
(pq): extract this regexp from the exclude in options
RegExp
stockExampleFiles
=
new
RegExp
(
'examples/stocks/lib/.*
\
.dart
\$
'
);
if
(
argResults
[
'flutter-repo'
])
{
...
...
@@ -200,7 +199,7 @@ class AnalyzeCommand extends FlutterCommand {
packagesBody
.
writeln
(
'
$package
:
${path.toUri(packages[package])}
'
);
// save the .packages file to disk
//TODO(pq): consider passing package info via a data URI
//TODO
(pq): consider passing package info via a data URI
Directory
host
=
Directory
.
systemTemp
.
createTempSync
(
'flutter-analyze-'
);
String
packagesFilePath
=
path
.
join
(
host
.
path
,
'.packages'
);
new
File
(
packagesFilePath
).
writeAsStringSync
(
packagesBody
.
toString
());
...
...
@@ -218,7 +217,7 @@ class AnalyzeCommand extends FlutterCommand {
options
.
analysisOptionsFile
=
path
.
join
(
ArtifactStore
.
flutterRoot
,
'packages'
,
'flutter_tools'
,
'flutter_analysis_options'
);
AnalysisDriver
analyzer
=
new
AnalysisDriver
(
options
);
//TODO
:
(pq): consider error handling
//TODO
(pq): consider error handling
List
<
AnalysisErrorDescription
>
errors
=
analyzer
.
analyze
(
dartFiles
);
int
errorCount
=
0
;
...
...
@@ -277,9 +276,8 @@ class AnalyzeCommand extends FlutterCommand {
return
collected
;
for
(
FileSystemEntity
entity
in
dir
.
listSync
(
recursive:
false
,
followLinks:
false
))
{
if
(
isDartFile
(
entity
)
&&
(
exclude
==
null
||
!
exclude
(
entity
)))
{
if
(
isDartFile
(
entity
)
&&
(
exclude
==
null
||
!
exclude
(
entity
)))
collected
.
add
(
entity
);
}
if
(
entity
is
Directory
)
{
String
name
=
path
.
basename
(
entity
.
path
);
if
(!
name
.
startsWith
(
'.'
)
&&
name
!=
'packages'
)
...
...
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