LEFT | RIGHT |
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 from getopt import getopt, GetoptError | 10 from getopt import getopt, GetoptError |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 380 |
381 | 381 |
382 with addCommand(lambda baseDir, scriptName, opts, args, type: usage(scriptName,
type), ('help', '-h', '--help')) as command: | 382 with addCommand(lambda baseDir, scriptName, opts, args, type: usage(scriptName,
type), ('help', '-h', '--help')) as command: |
383 command.shortDescription = 'Show this message' | 383 command.shortDescription = 'Show this message' |
384 | 384 |
385 with addCommand(runBuild, 'build') as command: | 385 with addCommand(runBuild, 'build') as command: |
386 command.shortDescription = 'Create a build' | 386 command.shortDescription = 'Create a build' |
387 command.description = 'Creates an extension build with given file name. If o
utput_file is missing a default name will be chosen.' | 387 command.description = 'Creates an extension build with given file name. If o
utput_file is missing a default name will be chosen.' |
388 command.params = '[options] [output_file]' | 388 command.params = '[options] [output_file]' |
389 command.addOption('Use given build number (if omitted the build number will
be retrieved from Mercurial)', short='b', long='build', value='num') | 389 command.addOption('Use given build number (if omitted the build number will
be retrieved from Mercurial)', short='b', long='build', value='num') |
390 command.addOption('File containing private key and certificates required to
sign the package', short='k', long='key', value='file', types=('chrome')) | 390 command.addOption('File containing private key and certificates required to
sign the package', short='k', long='key', value='file', types=('chrome',)) |
391 command.addOption('Create a release build', short='r', long='release') | 391 command.addOption('Create a release build', short='r', long='release') |
392 command.supportedTypes = ('gecko-webext', 'chrome', 'edge') | 392 command.supportedTypes = ('gecko-webext', 'chrome', 'edge') |
393 | 393 |
394 with addCommand(createDevEnv, 'devenv') as command: | 394 with addCommand(createDevEnv, 'devenv') as command: |
395 command.shortDescription = 'Set up a development environment' | 395 command.shortDescription = 'Set up a development environment' |
396 command.description = 'Will set up or update the devenv folder as an unpacke
d extension folder for development.' | 396 command.description = 'Will set up or update the devenv folder as an unpacke
d extension folder for development.' |
397 command.supportedTypes = ('gecko-webext', 'chrome') | 397 command.supportedTypes = ('gecko-webext', 'chrome') |
398 | 398 |
399 with addCommand(setupTranslations, 'setuptrans') as command: | 399 with addCommand(setupTranslations, 'setuptrans') as command: |
400 command.shortDescription = 'Sets up translation languages' | 400 command.shortDescription = 'Sets up translation languages' |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 if option in ('-h', '--help'): | 503 if option in ('-h', '--help'): |
504 usage(scriptName, type, command) | 504 usage(scriptName, type, command) |
505 sys.exit() | 505 sys.exit() |
506 commands[command](baseDir, scriptName, opts, args, type) | 506 commands[command](baseDir, scriptName, opts, args, type) |
507 else: | 507 else: |
508 print 'Command %s is not supported for this application type' % comm
and | 508 print 'Command %s is not supported for this application type' % comm
and |
509 usage(scriptName, type) | 509 usage(scriptName, type) |
510 else: | 510 else: |
511 print 'Command %s is unrecognized' % command | 511 print 'Command %s is unrecognized' % command |
512 usage(scriptName, type) | 512 usage(scriptName, type) |
LEFT | RIGHT |