| 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 library ddc.src.checker.multi_package_resolver; | 5 library dev_compiler.src.checker.multi_package_resolver; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/java_io.dart'; | 9 import 'package:analyzer/src/generated/java_io.dart'; |
| 10 import 'package:analyzer/src/generated/source.dart'; | 10 import 'package:analyzer/src/generated/source.dart'; |
| 11 import 'package:analyzer/src/generated/source_io.dart'; | 11 import 'package:analyzer/src/generated/source_io.dart'; |
| 12 import 'package:path/path.dart' show join; | 12 import 'package:path/path.dart' show join; |
| 13 | 13 |
| 14 /// A package resolver that supports a non-standard package layout, where | 14 /// A package resolver that supports a non-standard package layout, where |
| 15 /// packages with dotted names are expanded to a hierarchy of directories, and | 15 /// packages with dotted names are expanded to a hierarchy of directories, and |
| (...skipping 26 matching lines...) Expand all Loading... |
| 42 /// Expand `uri.path`, replacing dots in the package name with slashes. | 42 /// Expand `uri.path`, replacing dots in the package name with slashes. |
| 43 String _expandPath(Uri uri) { | 43 String _expandPath(Uri uri) { |
| 44 if (uri.scheme != 'package') return null; | 44 if (uri.scheme != 'package') return null; |
| 45 var path = uri.path; | 45 var path = uri.path; |
| 46 var slashPos = path.indexOf('/'); | 46 var slashPos = path.indexOf('/'); |
| 47 var packagePath = path.substring(0, slashPos).replaceAll(".", "/"); | 47 var packagePath = path.substring(0, slashPos).replaceAll(".", "/"); |
| 48 var filePath = path.substring(slashPos + 1); | 48 var filePath = path.substring(slashPos + 1); |
| 49 return '${packagePath}/lib/${filePath}'; | 49 return '${packagePath}/lib/${filePath}'; |
| 50 } | 50 } |
| 51 } | 51 } |
| OLD | NEW |