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

Unified Diff: pkg/polymer/lib/src/transform/common.dart

Issue 24126002: Latest attempt to polymer-build scripts in fix windows (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
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));
+}

Powered by Google App Engine
This is Rietveld 408576698