| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /** Common methods used by transfomers. */ | 5 /** Common methods used by transfomers. */ |
| 6 library polymer.src.transform.common; | 6 library polymer.src.transform.common; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 | 9 |
| 10 import 'package:barback/barback.dart'; | 10 import 'package:barback/barback.dart'; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 package = segments[1]; | 65 package = segments[1]; |
| 66 targetPath = urlBuilder.join('asset', | 66 targetPath = urlBuilder.join('asset', |
| 67 urlBuilder.joinAll(segments.sublist(2))); | 67 urlBuilder.joinAll(segments.sublist(2))); |
| 68 } else { | 68 } else { |
| 69 package = source.package; | 69 package = source.package; |
| 70 targetPath = urlBuilder.normalize( | 70 targetPath = urlBuilder.normalize( |
| 71 urlBuilder.join(urlBuilder.dirname(source.path), url)); | 71 urlBuilder.join(urlBuilder.dirname(source.path), url)); |
| 72 } | 72 } |
| 73 return new AssetId(package, targetPath); | 73 return new AssetId(package, targetPath); |
| 74 } | 74 } |
| 75 |
| 76 /** Whether an asset with [id] is considered a primary entry point HTML file. */ |
| 77 Future<bool> isPrimaryHtml(AssetId id) => |
| 78 new Future.value(id.extension == '.html' && |
| 79 // Note: [id.path] is a relative path from the root of a package. |
| 80 (id.path.startsWith('web/') || id.path.startsWith('test/'))); |
| OLD | NEW |