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

Unified Diff: pkg/polymer/lib/deploy.dart

Issue 29823005: fixes to polymer, gets tests back to a stable state (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « pkg/polymer/lib/builder.dart ('k') | pkg/polymer/lib/platform.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/deploy.dart
diff --git a/pkg/polymer/lib/deploy.dart b/pkg/polymer/lib/deploy.dart
index 7d096906036f49d805e5135fecc3a1a9bf3bf16c..c4752a46ccf2ff464758322116bfd06484bffd0f 100644
--- a/pkg/polymer/lib/deploy.dart
+++ b/pkg/polymer/lib/deploy.dart
@@ -37,9 +37,14 @@ main() {
var test = args['test'];
var outDir = args['out'];
+
+ var transformOps = new TransformOptions(
+ directlyIncludeJS: args['js'],
+ contentSecurityPolicy: args['csp']);
+
var options = (test == null)
- ? new BarbackOptions(createDeployPhases(new TransformOptions()), outDir)
- : _createTestOptions(test, outDir);
+ ? new BarbackOptions(createDeployPhases(transformOps), outDir)
+ : _createTestOptions(transformOps, test, outDir);
if (options == null) exit(1);
print('polymer/deploy.dart: creating a deploy target for '
@@ -52,7 +57,8 @@ main() {
createDeployPhases(options) => new PolymerTransformerGroup(options).phases;
-BarbackOptions _createTestOptions(String testFile, String outDir) {
+BarbackOptions _createTestOptions(TransformOptions transformOps,
+ String testFile, String outDir) {
var testDir = path.normalize(path.dirname(testFile));
// A test must be allowed to import things in the package.
@@ -65,8 +71,8 @@ BarbackOptions _createTestOptions(String testFile, String outDir) {
return null;
}
- var phases = createDeployPhases(new TransformOptions(
- [path.relative(testFile, from: pubspecDir)]));
+ transformOps.entryPoints = [path.relative(testFile, from: pubspecDir)];
+ var phases = createDeployPhases(transformOps);
return new BarbackOptions(phases, outDir,
currentPackage: '_test',
packageDirs: {'_test' : pubspecDir},
@@ -98,7 +104,14 @@ ArgResults _parseArgs(arguments) {
defaultsTo: 'out')
..addOption('test', help: 'Deploy the test at the given path.\n'
'Note: currently this will deploy all tests in its directory,\n'
- 'but it will eventually deploy only the specified test.');
+ 'but it will eventually deploy only the specified test.')
+ ..addFlag('js', help:
+ 'deploy replaces *.dart scripts with *.dart.js. This flag \n'
+ 'leaves "packages/browser/dart.js" to do the replacement at runtime.',
+ defaultsTo: true)
+ ..addFlag('csp', help:
+ 'replaces *.dart with *.dart.precompiled.js to comply with \n'
+ 'Content Security Policy restrictions.');
try {
var results = parser.parse(arguments);
if (results['help']) {
« no previous file with comments | « pkg/polymer/lib/builder.dart ('k') | pkg/polymer/lib/platform.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698