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

Side by Side Diff: build.py

Issue 29345279: Noissue - Adapt quotes for compliance with our coding style in buildtools (Closed)
Patch Set: Created May 29, 2016, 1:27 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chainedconfigparser.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 os 5 import os
6 import sys 6 import sys
7 import re 7 import re
8 import subprocess 8 import subprocess
9 import shutil 9 import shutil
10 import buildtools 10 import buildtools
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if len(args) == 0: 439 if len(args) == 0:
440 print 'No version number specified for the release' 440 print 'No version number specified for the release'
441 usage(scriptName, type, 'release') 441 usage(scriptName, type, 'release')
442 return 442 return
443 version = args[0] 443 version = args[0]
444 if re.search(r'[^\d\.]', version): 444 if re.search(r'[^\d\.]', version):
445 print 'Wrong version number format' 445 print 'Wrong version number format'
446 usage(scriptName, type, 'release') 446 usage(scriptName, type, 'release')
447 return 447 return
448 448
449 if type == "gecko" and len(keyFiles) == 0: 449 if type == 'gecko' and len(keyFiles) == 0:
450 print >>sys.stderr, "Warning: no key file specified, creating an unsigne d release build\n" 450 print >>sys.stderr, 'Warning: no key file specified, creating an unsigne d release build\n'
451 elif type == "gecko" and len(keyFiles) > 1: 451 elif type == 'gecko' and len(keyFiles) > 1:
452 print >>sys.stderr, "Error: too many key files, only one required" 452 print >>sys.stderr, 'Error: too many key files, only one required'
453 usage(scriptName, type, 'release') 453 usage(scriptName, type, 'release')
454 return 454 return
455 elif type == "chrome" and len(keyFiles) != 2: 455 elif type == 'chrome' and len(keyFiles) != 2:
456 print >>sys.stderr, "Error: wrong number of key files specified, two key s (Chrome and Safari) required for the release" 456 print >>sys.stderr, 'Error: wrong number of key files specified, two key s (Chrome and Safari) required for the release'
457 usage(scriptName, type, 'release') 457 usage(scriptName, type, 'release')
458 return 458 return
459 459
460 import buildtools.releaseAutomation as releaseAutomation 460 import buildtools.releaseAutomation as releaseAutomation
461 releaseAutomation.run(baseDir, type, version, keyFiles, downloadsRepo) 461 releaseAutomation.run(baseDir, type, version, keyFiles, downloadsRepo)
462 462
463 463
464 def updatePSL(baseDir, scriptName, opts, args, type): 464 def updatePSL(baseDir, scriptName, opts, args, type):
465 import buildtools.publicSuffixListUpdater as publicSuffixListUpdater 465 import buildtools.publicSuffixListUpdater as publicSuffixListUpdater
466 publicSuffixListUpdater.updatePSL(baseDir) 466 publicSuffixListUpdater.updatePSL(baseDir)
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 524
525 with addCommand(generateDocs, 'docs') as command: 525 with addCommand(generateDocs, 'docs') as command:
526 command.shortDescription = 'Generate documentation (requires node.js)' 526 command.shortDescription = 'Generate documentation (requires node.js)'
527 command.description = 'Generate documentation files and write them into the specified directory. This operation requires JsDoc 3 to be installed.' 527 command.description = 'Generate documentation files and write them into the specified directory. This operation requires JsDoc 3 to be installed.'
528 command.addOption('Suppress JsDoc output', short='q', long='quiet') 528 command.addOption('Suppress JsDoc output', short='q', long='quiet')
529 command.params = '[options] <directory>' 529 command.params = '[options] <directory>'
530 command.supportedTypes = ('gecko', 'chrome') 530 command.supportedTypes = ('gecko', 'chrome')
531 531
532 with addCommand(runReleaseAutomation, 'release') as command: 532 with addCommand(runReleaseAutomation, 'release') as command:
533 command.shortDescription = 'Run release automation' 533 command.shortDescription = 'Run release automation'
534 command.description = 'Note: If you are not the project owner then you '\ 534 command.description = 'Note: If you are not the project owner then you ' "probably don't want to run this!\n\n" 'Runs release automation: crea tes downloads for the new version, tags ' 'source code repository as well as downloads and buildtools repository.'
535 'probably don\'t want to run this!\n\n'\
536 'Runs release automation: creates downloads for the new version, tags '\
537 'source code repository as well as downloads and buildtools repository.'
538 command.addOption('File containing private key and certificates required to sign the release. Note that for Chrome releases this option needs to be specifie d twice: first a key to sign Chrome builds, then another to sign the Safari buil d.', short='k', long='key', value='file', types=('gecko', 'chrome')) 535 command.addOption('File containing private key and certificates required to sign the release. Note that for Chrome releases this option needs to be specifie d twice: first a key to sign Chrome builds, then another to sign the Safari buil d.', short='k', long='key', value='file', types=('gecko', 'chrome'))
539 command.addOption('Directory containing downloads repository (if omitted ../ downloads is assumed)', short='d', long='downloads', value='dir') 536 command.addOption('Directory containing downloads repository (if omitted ../ downloads is assumed)', short='d', long='downloads', value='dir')
540 command.params = '[options] <version>' 537 command.params = '[options] <version>'
541 command.supportedTypes = ('gecko', 'chrome') 538 command.supportedTypes = ('gecko', 'chrome')
542 539
543 with addCommand(updatePSL, 'updatepsl') as command: 540 with addCommand(updatePSL, 'updatepsl') as command:
544 command.shortDescription = 'Updates Public Suffix List' 541 command.shortDescription = 'Updates Public Suffix List'
545 command.description = 'Downloads Public Suffix List (see http://publicsuffix .org/) and generates lib/publicSuffixList.js from it.' 542 command.description = 'Downloads Public Suffix List (see http://publicsuffix .org/) and generates lib/publicSuffixList.js from it.'
546 command.supportedTypes = ('chrome',) 543 command.supportedTypes = ('chrome',)
547 544
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 if option in ('-h', '--help'): 608 if option in ('-h', '--help'):
612 usage(scriptName, type, command) 609 usage(scriptName, type, command)
613 sys.exit() 610 sys.exit()
614 commands[command](baseDir, scriptName, opts, args, type) 611 commands[command](baseDir, scriptName, opts, args, type)
615 else: 612 else:
616 print 'Command %s is not supported for this application type' % comm and 613 print 'Command %s is not supported for this application type' % comm and
617 usage(scriptName, type) 614 usage(scriptName, type)
618 else: 615 else:
619 print 'Command %s is unrecognized' % command 616 print 'Command %s is unrecognized' % command
620 usage(scriptName, type) 617 usage(scriptName, type)
OLDNEW
« no previous file with comments | « no previous file | chainedconfigparser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld