Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(710)

Side by Side Diff: pkg/analyzer_cli/lib/src/driver.dart

Issue 2425423009: Split out options from ContextBuilder (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library analyzer_cli.src.driver; 5 library analyzer_cli.src.driver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert'; 8 import 'dart:convert';
9 import 'dart:io' as io; 9 import 'dart:io' as io;
10 10
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 resolver, 366 resolver,
367 new file_system.ResourceUriResolver(resourceProvider) 367 new file_system.ResourceUriResolver(resourceProvider)
368 ]; 368 ];
369 return new SourceFactory(resolvers); 369 return new SourceFactory(resolvers);
370 } 370 }
371 } 371 }
372 372
373 UriResolver packageUriResolver; 373 UriResolver packageUriResolver;
374 374
375 if (options.packageRootPath != null) { 375 if (options.packageRootPath != null) {
376 ContextBuilder builder = new ContextBuilder(resourceProvider, null, null); 376 ContextBuilderOptions builderOptions = new ContextBuilderOptions();
377 builder.defaultPackagesDirectoryPath = options.packageRootPath; 377 builderOptions.defaultPackagesDirectoryPath = options.packageRootPath;
378 ContextBuilder builder = new ContextBuilder(resourceProvider, null, null,
379 options: builderOptions);
378 packageUriResolver = new PackageMapUriResolver(resourceProvider, 380 packageUriResolver = new PackageMapUriResolver(resourceProvider,
379 builder.convertPackagesToMap(builder.createPackageMap(''))); 381 builder.convertPackagesToMap(builder.createPackageMap('')));
380 } else if (options.packageConfigPath == null) { 382 } else if (options.packageConfigPath == null) {
381 // TODO(pq): remove? 383 // TODO(pq): remove?
382 if (packageInfo.packageMap == null) { 384 if (packageInfo.packageMap == null) {
383 // Fall back to pub list-package-dirs. 385 // Fall back to pub list-package-dirs.
384 PubPackageMapProvider pubPackageMapProvider = 386 PubPackageMapProvider pubPackageMapProvider =
385 new PubPackageMapProvider(resourceProvider, sdk); 387 new PubPackageMapProvider(resourceProvider, sdk);
386 file_system.Resource cwd = resourceProvider.getResource('.'); 388 file_system.Resource cwd = resourceProvider.getResource('.');
387 PackageMapInfo packageMapInfo = 389 PackageMapInfo packageMapInfo =
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 for (var package in packages) { 879 for (var package in packages) {
878 var packageName = path.basename(package.path); 880 var packageName = path.basename(package.path);
879 var realPath = package.resolveSymbolicLinksSync(); 881 var realPath = package.resolveSymbolicLinksSync();
880 result[packageName] = [ 882 result[packageName] = [
881 PhysicalResourceProvider.INSTANCE.getFolder(realPath) 883 PhysicalResourceProvider.INSTANCE.getFolder(realPath)
882 ]; 884 ];
883 } 885 }
884 return result; 886 return result;
885 } 887 }
886 } 888 }
OLDNEW
« no previous file with comments | « pkg/analyzer/tool/task_dependency_graph/generate.dart ('k') | pkg/dev_compiler/lib/src/analyzer/context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698