Chromium Code Reviews| Index: pkg/docgen/bin/upload_docgen.py |
| diff --git a/pkg/docgen/bin/upload_docgen.py b/pkg/docgen/bin/upload_docgen.py |
| index b7cdb924741401ae2830917cb908a1ba47351757..c2f9a536f9ec84eda30a3f4b694dedc7f45c7bc6 100644 |
| --- a/pkg/docgen/bin/upload_docgen.py |
| +++ b/pkg/docgen/bin/upload_docgen.py |
| @@ -8,6 +8,7 @@ |
| Google Cloud Storage for the documentation viewer. |
| """ |
| +import argparse |
|
Emily Fortuna
2013/07/19 22:49:28
Our buildbots actually still have python 2.6, and
janicejl
2013/07/22 16:56:11
Done.
|
| import os |
| from os.path import join, dirname, abspath, exists |
| import platform |
| @@ -21,8 +22,27 @@ from upload_sdk import ExecuteCommand |
| DART = abspath(join(dirname(__file__), '../../../%s/%s/dart-sdk/bin/dart' |
| % (utils.BUILD_ROOT[utils.GuessOS()], utils.GetBuildConf('release', |
| utils.GuessArchitecture())))) |
| +PACKAGE_ROOT = abspath(join(dirname(__file__), '../../../%s/%s/packages/' |
| + % (utils.BUILD_ROOT[utils.GuessOS()], utils.GetBuildConf('release', |
| + utils.GuessArchitecture())))) |
| GSUTIL = utils.GetBuildbotGSUtilPath() |
| GS_SITE = 'gs://dartlang-docgen' |
| +DESCRIPTION='Runs docgen.dart on the SDK libraries, and uploads them to Google \ |
| + Cloud Storage for the dartdoc-viewer. ' |
| + |
| + |
| +def GetOptions(): |
| + parser = argparse.ArgumentParser(description=DESCRIPTION) |
| + parser.add_argument('--package-root', action=SetPackageRoot, |
|
Emily Fortuna
2013/07/19 22:49:28
Instead of having the separate SetPackageRoot clas
janicejl
2013/07/22 16:56:11
Done.
|
| + help='Sets the package root for dart.') |
| + parser.parse_args() |
| + |
| + |
| +class SetPackageRoot(argparse.Action): |
| + def __call__(self, parser, namespace, values, option_string=None): |
| + global PACKAGE_ROOT |
| + if exists(values): |
| + PACKAGE_ROOT = abspath(values) |
| def SetGsutil(): |
| @@ -41,10 +61,13 @@ def Upload(source, target): |
| def main(): |
| + GetOptions() |
| + |
| SetGsutil() |
| # Execute Docgen.dart on the SDK. |
| - ExecuteCommand([DART, abspath(join(dirname(__file__), 'docgen.dart')), |
| + ExecuteCommand([DART, '--checked', '--package-root=' + PACKAGE_ROOT, |
| + abspath(join(dirname(__file__), 'docgen.dart')), |
| '--parse-sdk']) |
| # Use SVN Revision to get the revision number. |