| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 options = parseOptions([]); | 184 options = parseOptions([]); |
| 185 } | 185 } |
| 186 if (currentPackage == null) currentPackage = readCurrentPackageFromPubspec(); | 186 if (currentPackage == null) currentPackage = readCurrentPackageFromPubspec(); |
| 187 | 187 |
| 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 barbackOptions = new BarbackOptions( | 195 var barbackOptions = new BarbackOptions( |
| 195 new PolymerTransformerGroup(transformOptions).phases, | 196 phases, options.outDir, currentPackage: currentPackage, |
| 196 options.outDir, currentPackage: currentPackage, | 197 packageDirs: packageDirs, machineFormat: options.machineFormat, |
| 197 packageDirs: packageDirs, machineFormat: options.machineFormat); | 198 packagePhases: {'polymer' : polymerPhases}); |
| 198 return runBarback(barbackOptions) | 199 return runBarback(barbackOptions) |
| 199 .then((_) => print('Done! All files written to "${options.outDir}"')); | 200 .then((_) => print('Done! All files written to "${options.outDir}"')); |
| 200 } | 201 } |
| 201 | 202 |
| 202 | 203 |
| 203 /** | 204 /** |
| 204 * Options that may be used either in build.dart or by the linter and deploy | 205 * Options that may be used either in build.dart or by the linter and deploy |
| 205 * tools. | 206 * tools. |
| 206 */ | 207 */ |
| 207 class CommandLineOptions { | 208 class CommandLineOptions { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } | 324 } |
| 324 if (res['help']) { | 325 if (res['help']) { |
| 325 print('A build script that invokes the polymer linter and deploy tools.'); | 326 print('A build script that invokes the polymer linter and deploy tools.'); |
| 326 showUsage(); | 327 showUsage(); |
| 327 exit(0); | 328 exit(0); |
| 328 } | 329 } |
| 329 return new CommandLineOptions(res['changed'], res['removed'], res['clean'], | 330 return new CommandLineOptions(res['changed'], res['removed'], res['clean'], |
| 330 res['full'], res['machine'], res['deploy'], res['out'], res['js'], | 331 res['full'], res['machine'], res['deploy'], res['out'], res['js'], |
| 331 res['csp'], !res['debug']); | 332 res['csp'], !res['debug']); |
| 332 } | 333 } |
| OLD | NEW |