OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * Common logic to make it easy to run the polymer linter and deploy tool. | 6 * Common logic to make it easy to run the polymer linter and deploy tool. |
7 * | 7 * |
8 * The functions in this library are designed to make it easier to create | 8 * The functions in this library are designed to make it easier to create |
9 * `build.dart` files. A `build.dart` file is a Dart script that can be invoked | 9 * `build.dart` files. A `build.dart` file is a Dart script that can be invoked |
10 * from the command line, but that can also invoked automatically by the Dart | 10 * from the command line, but that can also invoked automatically by the Dart |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 var transformOptions = new TransformOptions( | 188 var transformOptions = new TransformOptions( |
189 entryPoints: entryPoints, | 189 entryPoints: entryPoints, |
190 directlyIncludeJS: options.directlyIncludeJS, | 190 directlyIncludeJS: options.directlyIncludeJS, |
191 contentSecurityPolicy: options.contentSecurityPolicy, | 191 contentSecurityPolicy: options.contentSecurityPolicy, |
192 releaseMode: options.releaseMode); | 192 releaseMode: options.releaseMode); |
193 | 193 |
194 var phases = new PolymerTransformerGroup(transformOptions).phases; | 194 var phases = new PolymerTransformerGroup(transformOptions).phases; |
195 var barbackOptions = new BarbackOptions( | 195 var barbackOptions = new BarbackOptions( |
196 phases, options.outDir, currentPackage: currentPackage, | 196 phases, options.outDir, currentPackage: currentPackage, |
197 packageDirs: packageDirs, machineFormat: options.machineFormat, | 197 packageDirs: packageDirs, machineFormat: options.machineFormat, |
198 packagePhases: {'polymer' : phasesForPolymer}); | 198 // TODO(sigmund): include here also smoke transformer when it's on by |
| 199 // default. |
| 200 packagePhases: {'polymer': phasesForPolymer}); |
199 return runBarback(barbackOptions) | 201 return runBarback(barbackOptions) |
200 .then((_) => print('Done! All files written to "${options.outDir}"')); | 202 .then((_) => print('Done! All files written to "${options.outDir}"')); |
201 } | 203 } |
202 | 204 |
203 | 205 |
204 /** | 206 /** |
205 * Options that may be used either in build.dart or by the linter and deploy | 207 * Options that may be used either in build.dart or by the linter and deploy |
206 * tools. | 208 * tools. |
207 */ | 209 */ |
208 class CommandLineOptions { | 210 class CommandLineOptions { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 326 } |
325 if (res['help']) { | 327 if (res['help']) { |
326 print('A build script that invokes the polymer linter and deploy tools.'); | 328 print('A build script that invokes the polymer linter and deploy tools.'); |
327 showUsage(); | 329 showUsage(); |
328 exit(0); | 330 exit(0); |
329 } | 331 } |
330 return new CommandLineOptions(res['changed'], res['removed'], res['clean'], | 332 return new CommandLineOptions(res['changed'], res['removed'], res['clean'], |
331 res['full'], res['machine'], res['deploy'], res['out'], res['js'], | 333 res['full'], res['machine'], res['deploy'], res['out'], res['js'], |
332 res['csp'], !res['debug']); | 334 res['csp'], !res['debug']); |
333 } | 335 } |
OLD | NEW |