Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: build.py

Issue 29609559: Issue 6021 - Refactoring build.py (Closed) Base URL: https://hg.adblockplus.org/buildtools/file/79688f4a4aff
Left Patch Set: Making platform-param required again Created Nov. 17, 2017, 2:30 p.m.
Right Patch Set: Fixing a regression in 'docs' Created Nov. 20, 2017, 9:17 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | tests/test_packagerWebExt.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # This Source Code Form is subject to the terms of the Mozilla Public 1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this 2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 4
5 import argparse 5 import argparse
6 import logging 6 import logging
7 import os 7 import os
8 import re 8 import re
9 import shutil 9 import shutil
10 import subprocess 10 import subprocess
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 locale_config = read_locale_config(base_dir, platform, metadata) 289 locale_config = read_locale_config(base_dir, platform, metadata)
290 290
291 import buildtools.localeTools as localeTools 291 import buildtools.localeTools as localeTools
292 localeTools.getTranslations(locale_config, basename, project_key) 292 localeTools.getTranslations(locale_config, basename, project_key)
293 293
294 294
295 @argparse_command( 295 @argparse_command(
296 valid_platforms={'chrome'}, 296 valid_platforms={'chrome'},
297 arguments=( 297 arguments=(
298 make_argument('target_dir'), 298 make_argument('target_dir'),
299 make_argument('-q', '--quiet', help='Suppress JsDoc output'), 299 make_argument('-q', '--quiet', help='Suppress JsDoc output',
300 action='store_true', default=False),
300 ) 301 )
301 ) 302 )
302 def docs(base_dir, target_dir, quiet, platform, **kwargs): 303 def docs(base_dir, target_dir, quiet, platform, **kwargs):
303 """ 304 """
304 Generate documentation (requires node.js). 305 Generate documentation (requires node.js).
305 306
306 Generate documentation files and write them into the specified directory. 307 Generate documentation files and write them into the specified directory.
307 """ 308 """
308 source_dir = os.path.join(base_dir, 'lib') 309 source_dir = os.path.join(base_dir, 'lib')
309 310
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 if build_available_subcommands(base_dir): 392 if build_available_subcommands(base_dir):
392 MAIN_PARSER.set_defaults(base_dir=base_dir) 393 MAIN_PARSER.set_defaults(base_dir=base_dir)
393 394
394 # If no args are provided, this module is run directly from the command 395 # If no args are provided, this module is run directly from the command
395 # line. argparse will take care of consuming sys.argv. 396 # line. argparse will take care of consuming sys.argv.
396 arguments = MAIN_PARSER.parse_args(args if len(args) > 0 else None) 397 arguments = MAIN_PARSER.parse_args(args if len(args) > 0 else None)
397 398
398 function = arguments.function 399 function = arguments.function
399 del arguments.function 400 del arguments.function
400 function(**vars(arguments)) 401 function(**vars(arguments))
LEFTRIGHT

Powered by Google App Engine
This is Rietveld