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

Side by Side Diff: lib/build/html_import_annotation_recorder.dart

Issue 981273002: fix relative @HtmlImport paths in deep folders in deployment mode (Closed) Base URL: git@github.com:dart-lang/web-components.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/normalize_path.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library web_components.build.html_import_recorder_inliner; 4 library web_components.build.html_import_recorder_inliner;
5 5
6 import 'package:analyzer/analyzer.dart'; 6 import 'package:analyzer/analyzer.dart';
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:initialize/transformer.dart'; 10 import 'package:initialize/transformer.dart';
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 var libPath; 72 var libPath;
73 var segments = element.source.uri.pathSegments; 73 var segments = element.source.uri.pathSegments;
74 var package = segments[0]; 74 var package = segments[0];
75 if (bootstrapId.package == package && 75 if (bootstrapId.package == package &&
76 bootstrapId.path.startsWith('${segments[1]}/')) { 76 bootstrapId.path.startsWith('${segments[1]}/')) {
77 package = null; 77 package = null;
78 libPath = path.url.relative( 78 libPath = path.url.relative(
79 path.url.joinAll(segments.getRange(1, segments.length)), 79 path.url.joinAll(segments.getRange(1, segments.length)),
80 from: path.url.dirname(path.url.join(bootstrapId.path))); 80 from: path.url.dirname(path.url.join(bootstrapId.path)));
81 } else if (segments[1] == 'lib') { 81 } else if (segments[1] == 'lib') {
82 libPath = path.url.joinAll(segments.getRange(1, segments.length)); 82 libPath = path.url.joinAll(segments.getRange(2, segments.length));
83 } else { 83 } else {
84 logger.error('Unable to import `${element.source.uri.path}` from ' 84 logger.error('Unable to import `${element.source.uri.path}` from '
85 '${bootstrapId}.'); 85 '${bootstrapId}.');
86 return null; 86 return null;
87 } 87 }
88 88
89 importPaths 89 importPaths
90 .add(normalizeHtmlImportPath(originalImportPath, package, libPath)); 90 .add(normalizeHtmlImportPath(originalImportPath, package, libPath));
91 91
92 // Don't emit an InitEntry. 92 // Don't emit an InitEntry.
93 return null; 93 return null;
94 } 94 }
95 } 95 }
OLDNEW
« no previous file with comments | « CHANGELOG.md ('k') | lib/src/normalize_path.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698