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
1cad4f47
Commit
1cad4f47
authored
Jun 23, 2016
by
pq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fallback to a standard SDK if no embedders are found.
parent
b2fed164
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
16 deletions
+22
-16
analysis.dart
packages/flutter_tools/lib/src/dart/analysis.dart
+22
-16
No files found.
packages/flutter_tools/lib/src/dart/analysis.dart
View file @
1cad4f47
...
@@ -14,6 +14,7 @@ import 'package:analyzer/source/error_processor.dart';
...
@@ -14,6 +14,7 @@ import 'package:analyzer/source/error_processor.dart';
import
'package:analyzer/src/generated/engine.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/generated/engine.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/generated/error.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/generated/error.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/generated/java_io.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/generated/java_io.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/generated/sdk_io.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/generated/source.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/generated/source.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/generated/source_io.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/generated/source_io.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/task/options.dart'
;
// ignore: implementation_imports
import
'package:analyzer/src/task/options.dart'
;
// ignore: implementation_imports
...
@@ -90,25 +91,30 @@ class AnalysisDriver {
...
@@ -90,25 +91,30 @@ class AnalysisDriver {
List
<
UriResolver
>
_getResolvers
(
InternalAnalysisContext
context
,
List
<
UriResolver
>
_getResolvers
(
InternalAnalysisContext
context
,
Map
<
String
,
List
<
file_system
.
Folder
>>
packageMap
)
{
Map
<
String
,
List
<
file_system
.
Folder
>>
packageMap
)
{
// Locate our embedder.
EmbedderYamlLocator
locator
=
new
EmbedderYamlLocator
(
packageMap
);
// Create
and configure an SDK
.
// Create
our list of resolvers
.
EmbedderSdk
sdk
=
new
EmbedderSdk
(
locator
.
embedderYamls
)
;
List
<
UriResolver
>
resolvers
=
<
UriResolver
>[]
;
// Look for an embedder.
EmbedderYamlLocator
locator
=
new
EmbedderYamlLocator
(
packageMap
);
if
(
locator
.
embedderYamls
.
isNotEmpty
)
{
// Create and configure an embedded SDK.
EmbedderSdk
sdk
=
new
EmbedderSdk
(
locator
.
embedderYamls
);
// Fail fast if no URI mappings are found.
// Fail fast if no URI mappings are found.
assert
(
sdk
.
libraryMap
.
size
()
>
0
);
assert
(
sdk
.
libraryMap
.
size
()
>
0
);
sdk
.
analysisOptions
=
context
.
analysisOptions
;
sdk
.
analysisOptions
=
context
.
analysisOptions
;
// TODO(pq): re-enable once we have a proper story for SDK summaries
// TODO(pq): re-enable once we have a proper story for SDK summaries
// in the presence of embedders (https://github.com/dart-lang/sdk/issues/26467).
// in the presence of embedders (https://github.com/dart-lang/sdk/issues/26467).
sdk
.
useSummary
=
false
;
sdk
.
useSummary
=
false
;
// Create our list of resolvers.
resolvers
.
add
(
new
DartUriResolver
(
sdk
));
List
<
UriResolver
>
resolvers
=
<
UriResolver
>[];
}
else
{
// Fall back to a standard SDK if no embedder is found.
DirectoryBasedDartSdk
sdk
=
new
DirectoryBasedDartSdk
(
new
JavaFile
(
sdkDir
));
sdk
.
analysisOptions
=
context
.
analysisOptions
;
resolvers
.
add
(
new
DartUriResolver
(
sdk
));
resolvers
.
add
(
new
DartUriResolver
(
sdk
));
}
if
(
options
.
packageRootPath
!=
null
)
{
if
(
options
.
packageRootPath
!=
null
)
{
JavaFile
packageDirectory
=
new
JavaFile
(
options
.
packageRootPath
);
JavaFile
packageDirectory
=
new
JavaFile
(
options
.
packageRootPath
);
...
...
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