| 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 /// **Note**: If you already have a `build.dart` in your application, we | 5 /// **Note**: If you already have a `build.dart` in your application, we |
| 6 /// recommend to use the `package:polymer/builder.dart` library instead. | 6 /// recommend to use the `package:polymer/builder.dart` library instead. |
| 7 | 7 |
| 8 /// Temporary deploy command used to create a version of the app that can be | 8 /// Temporary deploy command used to create a version of the app that can be |
| 9 /// compiled with dart2js and deployed. Following pub layout conventions, this | 9 /// compiled with dart2js and deployed. Following pub layout conventions, this |
| 10 /// script will treat any HTML file under a package 'web/' and 'test/' | 10 /// script will treat any HTML file under a package 'web/' and 'test/' |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 defaultsTo: null) | 153 defaultsTo: null) |
| 154 ..addOption('test', help: 'Deploy the test at the given path.\n' | 154 ..addOption('test', help: 'Deploy the test at the given path.\n' |
| 155 'Note: currently this will deploy all tests in its directory,\n' | 155 'Note: currently this will deploy all tests in its directory,\n' |
| 156 'but it will eventually deploy only the specified test.') | 156 'but it will eventually deploy only the specified test.') |
| 157 ..addFlag('js', help: | 157 ..addFlag('js', help: |
| 158 'deploy replaces *.dart scripts with *.dart.js. This flag \n' | 158 'deploy replaces *.dart scripts with *.dart.js. This flag \n' |
| 159 'leaves "packages/browser/dart.js" to do the replacement at runtime.', | 159 'leaves "packages/browser/dart.js" to do the replacement at runtime.', |
| 160 defaultsTo: true) | 160 defaultsTo: true) |
| 161 ..addFlag('debug', help: | 161 ..addFlag('debug', help: |
| 162 'run in debug mode. For example, use the debug polyfill \n' | 162 'run in debug mode. For example, use the debug polyfill \n' |
| 163 'web_components/platform.concat.js instead of the minified one.\n', | 163 'web_components/webcomponents.js instead of the minified one.\n', |
| 164 defaultsTo: false) | 164 defaultsTo: false) |
| 165 ..addFlag('csp', help: | 165 ..addFlag('csp', help: |
| 166 'extracts inlined JavaScript code to comply with \n' | 166 'extracts inlined JavaScript code to comply with \n' |
| 167 'Content Security Policy restrictions.'); | 167 'Content Security Policy restrictions.'); |
| 168 try { | 168 try { |
| 169 var results = parser.parse(arguments); | 169 var results = parser.parse(arguments); |
| 170 if (results['help']) { | 170 if (results['help']) { |
| 171 _showUsage(parser); | 171 _showUsage(parser); |
| 172 return null; | 172 return null; |
| 173 } | 173 } |
| 174 return results; | 174 return results; |
| 175 } on FormatException catch (e) { | 175 } on FormatException catch (e) { |
| 176 print(e.message); | 176 print(e.message); |
| 177 _showUsage(parser); | 177 _showUsage(parser); |
| 178 return null; | 178 return null; |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 | 181 |
| 182 _showUsage(parser) { | 182 _showUsage(parser) { |
| 183 print('Usage: dart --package-root=packages/ ' | 183 print('Usage: dart --package-root=packages/ ' |
| 184 'package:polymer/deploy.dart [options]'); | 184 'package:polymer/deploy.dart [options]'); |
| 185 print(parser.getUsage()); | 185 print(parser.getUsage()); |
| 186 } | 186 } |
| OLD | NEW |