| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 """ Run this script to generate documentation for a directory and serve | 7 """ Run this script to generate documentation for a directory and serve |
| 8 the results to localhost for viewing in the browser. | 8 the results to localhost for viewing in the browser. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 options = parser.parse_args() | 47 options = parser.parse_args() |
| 48 SetPackageRoot(options.pkg_root) | 48 SetPackageRoot(options.pkg_root) |
| 49 return options | 49 return options |
| 50 | 50 |
| 51 def main(): | 51 def main(): |
| 52 options = GetOptions() | 52 options = GetOptions() |
| 53 docgen = [DART, '--checked', '--package-root=' + PACKAGE_ROOT, | 53 docgen = [DART, '--checked', '--package-root=' + PACKAGE_ROOT, |
| 54 join(DIRECTORY, 'docgen.dart')] | 54 join(DIRECTORY, 'docgen.dart')] |
| 55 docgen.extend(options.options.split()) | 55 docgen.extend(options.options.split()) |
| 56 ExecuteCommand(docgen) | 56 ExecuteCommand(docgen) |
| 57 ExecuteCommand(['git', 'clone', '-b', 'dev', | 57 ExecuteCommand(['git', 'clone', '-b', 'master', |
| 58 'git://github.com/dart-lang/dartdoc-viewer.git']) | 58 'git://github.com/dart-lang/dartdoc-viewer.git']) |
| 59 ExecuteCommand(['mv', 'docs', 'dartdoc-viewer/client/local']) | 59 ExecuteCommand(['mv', 'docs', 'dartdoc-viewer/client/local']) |
| 60 os.chdir('dartdoc-viewer/client/') | 60 os.chdir('dartdoc-viewer/client/') |
| 61 subprocess.call([PUB, 'install']) | 61 subprocess.call([PUB, 'install']) |
| 62 subprocess.call([DART, 'build.dart']) | 62 subprocess.call([DART, 'build.dart']) |
| 63 subprocess.call([DART2JS, '-o', 'web/out/index.html_bootstrap.dart.js', | 63 subprocess.call([DART2JS, '-o', 'web/out/index.html_bootstrap.dart.js', |
| 64 './web/out/index.html_bootstrap.dart']) | 64 './web/out/index.html_bootstrap.dart']) |
| 65 server = subprocess.Popen(['python', | 65 server = subprocess.Popen(['python', |
| 66 join(abspath(join(dirname(__file__), options.gae_sdk)), 'dev_appserver.py'), | 66 join(abspath(join(dirname(__file__), options.gae_sdk)), 'dev_appserver.py'), |
| 67 '..']) | 67 '..']) |
| 68 print("\nPoint your browser to the address of the 'default' server below.") | 68 print("\nPoint your browser to the address of the 'default' server below.") |
| 69 raw_input("Press <RETURN> to terminate the server.\n\n") | 69 raw_input("Press <RETURN> to terminate the server.\n\n") |
| 70 server.terminate() | 70 server.terminate() |
| 71 os.chdir('../..') | 71 os.chdir('../..') |
| 72 subprocess.call(['rm', '-rf', 'dartdoc-viewer']) | 72 subprocess.call(['rm', '-rf', 'dartdoc-viewer']) |
| 73 | 73 |
| 74 if __name__ == '__main__': | 74 if __name__ == '__main__': |
| 75 main() | 75 main() |
| OLD | NEW |