Chromium Code Reviews| Index: pkg/dev_compiler/lib/src/analyzer/context.dart |
| diff --git a/pkg/dev_compiler/lib/src/analyzer/context.dart b/pkg/dev_compiler/lib/src/analyzer/context.dart |
| index 3545bca8a5c43ba27ed99876b548c6c314be7885..bc47716a6446c1650d642aa64ec50b227b638527 100644 |
| --- a/pkg/dev_compiler/lib/src/analyzer/context.dart |
| +++ b/pkg/dev_compiler/lib/src/analyzer/context.dart |
| @@ -51,7 +51,7 @@ class AnalyzerOptions { |
| String dartSdkPath, |
| this.dartSdkSummaryPath, |
| this.customUrlMappings: const {}, |
| - this.packageRoot: 'packages/', |
| + this.packageRoot: null, |
|
Bob Nystrom
2016/09/28 16:02:47
You should be able to just omit this argument, rig
vsm
2016/09/28 16:10:03
Good point. Looking into whether I can just remov
|
| this.packagePaths: const []}) |
| : dartSdkPath = dartSdkPath ?? getSdkDir().path; |
| @@ -74,9 +74,7 @@ class AnalyzerOptions { |
| ..addOption('dart-sdk-summary', |
| help: 'Dart SDK Summary Path', defaultsTo: null) |
| ..addOption('package-root', |
| - abbr: 'p', |
| - help: 'Package root to resolve "package:" imports', |
| - defaultsTo: 'packages/') |
| + abbr: 'p', help: 'Package root to resolve "package:" imports') |
| ..addOption('url-mapping', |
| help: '--url-mapping=libraryUri,/path/to/library.dart uses\n' |
| 'library.dart as the source for an import of of "libraryUri".', |
| @@ -142,7 +140,9 @@ List<UriResolver> createFileResolvers(AnalyzerOptions options, |
| resourceProvider ??= PhysicalResourceProvider.INSTANCE; |
| UriResolver packageResolver() { |
| ContextBuilder builder = new ContextBuilder(resourceProvider, null, null); |
| - builder.defaultPackagesDirectoryPath = options.packageRoot; |
| + if (options.packageRoot != null) { |
| + builder.defaultPackagesDirectoryPath = options.packageRoot; |
| + } |
| return new PackageMapUriResolver(resourceProvider, |
| builder.convertPackagesToMap(builder.createPackageMap(''))); |
| } |