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

Side by Side Diff: pkg/polymer/lib/src/build/script_compactor.dart

Issue 50073007: fix barback and polymer build warnings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 /** Transfomer that combines multiple dart script tags into a single one. */ 5 /** Transfomer that combines multiple dart script tags into a single one. */
6 library polymer.src.build.script_compactor; 6 library polymer.src.build.script_compactor;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:convert'; 9 import 'dart:convert';
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 tag.remove(); 67 tag.remove();
68 continue; 68 continue;
69 } 69 }
70 mainLibraryId = resolve(id, src, logger, tag.sourceSpan); 70 mainLibraryId = resolve(id, src, logger, tag.sourceSpan);
71 mainScriptTag = tag; 71 mainScriptTag = tag;
72 } 72 }
73 73
74 if (mainScriptTag == null) { 74 if (mainScriptTag == null) {
75 // We didn't find any main library, nothing to do. 75 // We didn't find any main library, nothing to do.
76 transform.addOutput(transform.primaryInput); 76 transform.addOutput(transform.primaryInput);
77 return; 77 return null;
78 } 78 }
79 79
80 var bootstrapId = id.addExtension('_bootstrap.dart'); 80 var bootstrapId = id.addExtension('_bootstrap.dart');
81 mainScriptTag.attributes['src'] = 81 mainScriptTag.attributes['src'] =
82 path.url.basename(bootstrapId.path); 82 path.url.basename(bootstrapId.path);
83 83
84 // TODO(sigmund): stop renaming the file (see dartbug.com/14554) 84 // TODO(sigmund): stop renaming the file (see dartbug.com/14554)
85 var modifiedMainId = mainLibraryId.addExtension('_modified.dart'); 85 var modifiedMainId = mainLibraryId.addExtension('_modified.dart');
86 86
87 libraries.add(modifiedMainId); 87 libraries.add(modifiedMainId);
88 var urls = libraries.map((id) => assetUrlFor(id, bootstrapId, logger)) 88 var urls = libraries.map((id) => assetUrlFor(id, bootstrapId, logger))
89 .where((url) => url != null).toList(); 89 .where((url) => url != null).toList();
90 var buffer = new StringBuffer()..writeln(MAIN_HEADER); 90 var buffer = new StringBuffer()..writeln(MAIN_HEADER);
91 int i = 0; 91 int i = 0;
(...skipping 20 matching lines...) Expand all
112 }); 112 });
113 }); 113 });
114 } 114 }
115 } 115 }
116 116
117 const MAIN_HEADER = """ 117 const MAIN_HEADER = """
118 library app_bootstrap; 118 library app_bootstrap;
119 119
120 import 'package:polymer/polymer.dart'; 120 import 'package:polymer/polymer.dart';
121 """; 121 """;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698