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 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
7 import 'package:analyzer/src/generated/java_io.dart'; | 7 import 'package:analyzer/src/generated/java_io.dart'; |
8 import 'package:analyzer/src/generated/source.dart'; | 8 import 'package:analyzer/src/generated/source.dart'; |
9 import 'package:analyzer/src/generated/source_io.dart'; | 9 import 'package:analyzer/src/generated/source_io.dart'; |
10 import 'package:path/path.dart' show join; | 10 import 'package:path/path.dart' show join; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 /// Expand `uri.path`, replacing dots in the package name with slashes. | 44 /// Expand `uri.path`, replacing dots in the package name with slashes. |
45 List<String> _expandPath(Uri uri) { | 45 List<String> _expandPath(Uri uri) { |
46 if (uri.scheme != 'package') return null; | 46 if (uri.scheme != 'package') return null; |
47 var path = uri.path; | 47 var path = uri.path; |
48 var slashPos = path.indexOf('/'); | 48 var slashPos = path.indexOf('/'); |
49 var packagePath = path.substring(0, slashPos).replaceAll(".", "/"); | 49 var packagePath = path.substring(0, slashPos).replaceAll(".", "/"); |
50 var filePath = path.substring(slashPos + 1); | 50 var filePath = path.substring(slashPos + 1); |
51 return ['$packagePath/lib/$filePath', '$packagePath/$filePath']; | 51 return ['$packagePath/lib/$filePath', '$packagePath/$filePath']; |
52 } | 52 } |
53 } | 53 } |
OLD | NEW |