Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 /** | 5 /** |
| 6 * Temporary deploy command used to create a version of the app that can be | 6 * Temporary deploy command used to create a version of the app that can be |
| 7 * compiled with dart2js and deployed. This library should go away once `pub | 7 * compiled with dart2js and deployed. This library should go away once `pub |
| 8 * deploy` can be configured to run barback transformers. | 8 * deploy` can be configured to run barback transformers. |
| 9 * | 9 * |
| 10 * From an application package you can run this program by calling dart with a | 10 * From an application package you can run this program by calling dart with a |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 _run(args['webdir'], outDir).then( | 33 _run(args['webdir'], outDir).then( |
| 34 (_) => print('Done! All files written to "$outDir"')); | 34 (_) => print('Done! All files written to "$outDir"')); |
| 35 } | 35 } |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * API exposed for testing purposes. Runs this deploy command but prentend that | 38 * API exposed for testing purposes. Runs this deploy command but prentend that |
| 39 * the sources under [webDir] belong to package 'test'. | 39 * the sources under [webDir] belong to package 'test'. |
| 40 */ | 40 */ |
| 41 Future runForTest(String webDir, String outDir) { | 41 Future runForTest(String webDir, String outDir) { |
| 42 _currentPackage = 'test'; | 42 _currentPackage = 'test'; |
| 43 | |
| 44 // associate package dirs with their location in the repo: | |
| 45 _packageDirs = {'test' : '.'}; | |
| 46 addPackages(String dir) { | |
|
Jennifer Messerly
2013/08/29 18:21:24
hmmm, not sure I understand this.
For todomvc, th
Siggi Cherem (dart-lang)
2013/08/30 00:00:41
Currently this is only working for test/run.sh whi
| |
| 47 for (var packageDir in new Directory(dir).listSync().map((d) => d.path)) { | |
| 48 _packageDirs[path.basename(packageDir)] = packageDir; | |
| 49 } | |
| 50 } | |
| 51 addPackages('..'); | |
| 52 addPackages('../third_party'); | |
| 53 addPackages('../../third_party/pkg'); | |
| 43 return _run(webDir, outDir); | 54 return _run(webDir, outDir); |
| 44 } | 55 } |
| 45 | 56 |
| 46 Future _run(String webDir, String outDir) { | 57 Future _run(String webDir, String outDir) { |
| 47 var barback = new Barback(new _PolymerDeployProvider()); | 58 var barback = new Barback(new _PolymerDeployProvider()); |
| 48 _initializeBarback(barback, webDir); | 59 _initializeBarback(barback, webDir); |
| 49 _attachListeners(barback); | 60 _attachListeners(barback); |
| 50 return _emitAllFiles(barback, webDir, outDir); | 61 return _emitAllFiles(barback, webDir, outDir); |
| 51 } | 62 } |
| 52 | 63 |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 print(e.message); | 247 print(e.message); |
| 237 _showUsage(parser); | 248 _showUsage(parser); |
| 238 return null; | 249 return null; |
| 239 } | 250 } |
| 240 } | 251 } |
| 241 | 252 |
| 242 _showUsage(parser) { | 253 _showUsage(parser) { |
| 243 print('Usage: dart package:polymer/deploy.dart [options]'); | 254 print('Usage: dart package:polymer/deploy.dart [options]'); |
| 244 print(parser.getUsage()); | 255 print(parser.getUsage()); |
| 245 } | 256 } |
| OLD | NEW |