Index: pkg/polymer/lib/src/transform/common.dart |
diff --git a/pkg/polymer/lib/src/transform/common.dart b/pkg/polymer/lib/src/transform/common.dart |
index 73d0a191453ff073add344626df7ca3e1ae9ff9f..8e62d48a53bf168a8a78a6e1af332ca6bd2982cb 100644 |
--- a/pkg/polymer/lib/src/transform/common.dart |
+++ b/pkg/polymer/lib/src/transform/common.dart |
@@ -39,17 +39,19 @@ class TransformOptions { |
String currentPackage; |
List<String> entryPoints; |
- TransformOptions([this.currentPackage, this.entryPoints]); |
+ TransformOptions([this.currentPackage, entryPoints]) |
+ : entryPoints = entryPoints == null ? null |
+ : entryPoints.map(_systemToAssetPath).toList(); |
/** Whether an asset with [id] is an entry point HTML file. */ |
bool isHtmlEntryPoint(AssetId id) { |
if (id.extension != '.html') return false; |
// Note: [id.path] is a relative path from the root of a package. |
- if (!id.path.startsWith('web/') && |
- !id.path.startsWith('test/')) return false; |
+ if (currentPackage == null || entryPoints == null) { |
Siggi Cherem (dart-lang)
2013/09/12 22:11:29
this change is not needed, but I think it's better
|
+ return id.path.startsWith('web/') || id.path.startsWith('test/'); |
+ } |
- if (currentPackage == null || entryPoints == null) return true; |
return id.package == currentPackage && entryPoints.contains(id.path); |
} |
} |
@@ -148,3 +150,10 @@ String assetUrlFor(AssetId id, AssetId sourceId, TransformLogger logger, |
return builder.relative(builder.join('/', id.path), |
from: builder.join('/', builder.dirname(sourceId.path))); |
} |
+ |
+ |
+/** Convert system paths to asset paths (asset paths are posix style). */ |
+String _systemToAssetPath(String assetPath) { |
+ if (path.Style.platform != path.Style.windows) return assetPath; |
+ return path.posix.joinAll(path.split(assetPath)); |
+} |