| Index: lib/src/mirror_loader.dart
|
| diff --git a/lib/src/mirror_loader.dart b/lib/src/mirror_loader.dart
|
| index 1512ec9b63f4f82506e3b26c581e70eb32214f18..f3e268904e6e45f903b1a7861760eaca5643e3ca 100644
|
| --- a/lib/src/mirror_loader.dart
|
| +++ b/lib/src/mirror_loader.dart
|
| @@ -145,7 +145,22 @@ class InitializationCrawler {
|
| annotatedValue = (declaration.owner as ObjectMirror)
|
| .getField(declaration.simpleName).reflectee;
|
| } else if (declaration is LibraryMirror) {
|
| - annotatedValue = declaration.qualifiedName;
|
| + var package;
|
| + var filePath;
|
| + Uri uri = declaration.uri;
|
| + if (uri.scheme == 'file' || uri.scheme.startsWith('http')) {
|
| + filePath = path.url.relative(
|
| + uri.path, from: path.url.dirname(_root.uri.path));
|
| + } else if (uri.scheme == 'package') {
|
| + var segments = uri.pathSegments;
|
| + package = segments[0];
|
| + filePath = path.url.joinAll(segments.getRange(1, segments.length));
|
| + } else {
|
| + throw new UnsupportedError('Unsupported uri scheme ${uri.scheme} for '
|
| + 'library ${declaration}.');
|
| + }
|
| + annotatedValue =
|
| + new LibraryIdentifier(declaration.qualifiedName, package, filePath);
|
| } else {
|
| throw _UNSUPPORTED_DECLARATION;
|
| }
|
|
|