| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 @deprecated | 5 @deprecated |
| 6 library analyzer.src.generated.sdk_io; | 6 library analyzer.src.generated.sdk_io; |
| 7 | 7 |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| 11 import 'package:analyzer/dart/ast/ast.dart'; | 11 import 'package:analyzer/dart/ast/ast.dart'; |
| 12 import 'package:analyzer/exception/exception.dart'; | 12 import 'package:analyzer/exception/exception.dart'; |
| 13 import 'package:analyzer/src/context/context.dart'; | 13 import 'package:analyzer/src/context/context.dart'; |
| 14 import 'package:analyzer/src/dart/scanner/reader.dart'; | 14 import 'package:analyzer/src/dart/scanner/reader.dart'; |
| 15 import 'package:analyzer/src/dart/scanner/scanner.dart'; | 15 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
| 16 import 'package:analyzer/src/generated/engine.dart'; | 16 import 'package:analyzer/src/generated/engine.dart'; |
| 17 import 'package:analyzer/src/generated/error.dart'; | 17 import 'package:analyzer/src/generated/error.dart'; |
| 18 import 'package:analyzer/src/generated/java_engine_io.dart'; | 18 import 'package:analyzer/src/generated/java_engine_io.dart'; |
| 19 import 'package:analyzer/src/generated/java_io.dart'; | 19 import 'package:analyzer/src/generated/java_io.dart'; |
| 20 import 'package:analyzer/src/generated/parser.dart'; | 20 import 'package:analyzer/src/generated/parser.dart'; |
| 21 import 'package:analyzer/src/generated/sdk.dart'; | 21 import 'package:analyzer/src/generated/sdk.dart'; |
| 22 import 'package:analyzer/src/generated/source_io.dart'; | 22 import 'package:analyzer/src/generated/source_io.dart'; |
| 23 import 'package:analyzer/src/summary/idl.dart' show PackageBundle; | 23 import 'package:analyzer/src/summary/idl.dart' show PackageBundle; |
| 24 import 'package:analyzer/src/summary/summary_sdk.dart'; | 24 import 'package:analyzer/src/summary/package_bundle_reader.dart'; |
| 25 import 'package:path/path.dart' as pathos; | 25 import 'package:path/path.dart' as pathos; |
| 26 | 26 |
| 27 /** | 27 /** |
| 28 * An abstract implementation of a Dart SDK in which the available libraries are | 28 * An abstract implementation of a Dart SDK in which the available libraries are |
| 29 * stored in a library map. Subclasses are responsible for populating the | 29 * stored in a library map. Subclasses are responsible for populating the |
| 30 * library map. | 30 * library map. |
| 31 */ | 31 */ |
| 32 @deprecated | 32 @deprecated |
| 33 abstract class AbstractDartSdk implements DartSdk { | 33 abstract class AbstractDartSdk implements DartSdk { |
| 34 /** | 34 /** |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 @override | 72 @override |
| 73 AnalysisContext get context { | 73 AnalysisContext get context { |
| 74 if (_analysisContext == null) { | 74 if (_analysisContext == null) { |
| 75 _analysisContext = new SdkAnalysisContext(_analysisOptions); | 75 _analysisContext = new SdkAnalysisContext(_analysisOptions); |
| 76 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]); | 76 SourceFactory factory = new SourceFactory([new DartUriResolver(this)]); |
| 77 _analysisContext.sourceFactory = factory; | 77 _analysisContext.sourceFactory = factory; |
| 78 if (_useSummary) { | 78 if (_useSummary) { |
| 79 bool strongMode = _analysisOptions?.strongMode ?? false; | 79 bool strongMode = _analysisOptions?.strongMode ?? false; |
| 80 PackageBundle sdkBundle = getSummarySdkBundle(strongMode); | 80 PackageBundle sdkBundle = getSummarySdkBundle(strongMode); |
| 81 if (sdkBundle != null) { | 81 if (sdkBundle != null) { |
| 82 _analysisContext.resultProvider = new SdkSummaryResultProvider( | 82 SummaryDataStore dataStore = new SummaryDataStore([]); |
| 83 _analysisContext, sdkBundle, strongMode); | 83 dataStore.addBundle(null, sdkBundle); |
| 84 _analysisContext.resultProvider = |
| 85 new InputPackagesResultProvider(_analysisContext, dataStore); |
| 84 } | 86 } |
| 85 } | 87 } |
| 86 } | 88 } |
| 87 return _analysisContext; | 89 return _analysisContext; |
| 88 } | 90 } |
| 89 | 91 |
| 90 @override | 92 @override |
| 91 List<SdkLibrary> get sdkLibraries => libraryMap.sdkLibraries; | 93 List<SdkLibrary> get sdkLibraries => libraryMap.sdkLibraries; |
| 92 | 94 |
| 93 @override | 95 @override |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 SdkLibrariesReader_LibraryBuilder libraryBuilder = | 793 SdkLibrariesReader_LibraryBuilder libraryBuilder = |
| 792 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); | 794 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); |
| 793 // If any syntactic errors were found then don't try to visit the AST | 795 // If any syntactic errors were found then don't try to visit the AST |
| 794 // structure. | 796 // structure. |
| 795 if (!errorListener.errorReported) { | 797 if (!errorListener.errorReported) { |
| 796 unit.accept(libraryBuilder); | 798 unit.accept(libraryBuilder); |
| 797 } | 799 } |
| 798 return libraryBuilder.librariesMap; | 800 return libraryBuilder.librariesMap; |
| 799 } | 801 } |
| 800 } | 802 } |
| OLD | NEW |