OLD | NEW |
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This file is part of the Adblock Plus build tools, | 3 # This file is part of the Adblock Plus build tools, |
4 # Copyright (C) 2006-2012 Eyeo GmbH | 4 # Copyright (C) 2006-2012 Eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 print 'Wrong version number format' | 398 print 'Wrong version number format' |
399 usage(scriptName, type, 'release') | 399 usage(scriptName, type, 'release') |
400 return | 400 return |
401 | 401 |
402 if keyFile == None: | 402 if keyFile == None: |
403 print 'Warning: no key file specified, creating an unsigned release build\
n' | 403 print 'Warning: no key file specified, creating an unsigned release build\
n' |
404 | 404 |
405 import buildtools.releaseAutomationGecko as releaseAutomation | 405 import buildtools.releaseAutomationGecko as releaseAutomation |
406 releaseAutomation.run(baseDir, version, keyFile, downloadsRepo) | 406 releaseAutomation.run(baseDir, version, keyFile, downloadsRepo) |
407 | 407 |
408 def syncLocales(baseDir, scriptName, opts, args, type): | |
409 if len(args) == 0: | |
410 print 'Please specify the directory of the source Firefox extension as a par
ameter' | |
411 usage(scriptName, type, 'synclocales') | |
412 return | |
413 sourceDir = args[0] | |
414 | |
415 import buildtools.localeSyncChrome as localeSync | |
416 localeSync.run(baseDir, sourceDir) | |
417 | |
418 def updatePSL(baseDir, scriptName, opts, args, type): | 408 def updatePSL(baseDir, scriptName, opts, args, type): |
419 import buildtools.publicSuffixListUpdater as publicSuffixListUpdater | 409 import buildtools.publicSuffixListUpdater as publicSuffixListUpdater |
420 publicSuffixListUpdater.updatePSL(baseDir) | 410 publicSuffixListUpdater.updatePSL(baseDir) |
421 | 411 |
422 with addCommand(lambda baseDir, scriptName, opts, args, type: usage(scriptName,
type), ('help', '-h', '--help')) as command: | 412 with addCommand(lambda baseDir, scriptName, opts, args, type: usage(scriptName,
type), ('help', '-h', '--help')) as command: |
423 command.shortDescription = 'Show this message' | 413 command.shortDescription = 'Show this message' |
424 | 414 |
425 with addCommand(runBuild, 'build') as command: | 415 with addCommand(runBuild, 'build') as command: |
426 command.shortDescription = 'Create a build' | 416 command.shortDescription = 'Create a build' |
427 command.description = 'Creates an extension build with given file name. If out
put_file is missing a default name will be chosen.' | 417 command.description = 'Creates an extension build with given file name. If out
put_file is missing a default name will be chosen.' |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 command.shortDescription = 'Run release automation' | 478 command.shortDescription = 'Run release automation' |
489 command.description = 'Note: If you are not the project owner then you '\ | 479 command.description = 'Note: If you are not the project owner then you '\ |
490 'probably don\'t want to run this!\n\n'\ | 480 'probably don\'t want to run this!\n\n'\ |
491 'Runs release automation: creates downloads for the new version, tags '\ | 481 'Runs release automation: creates downloads for the new version, tags '\ |
492 'source code repository as well as downloads and buildtools repository.' | 482 'source code repository as well as downloads and buildtools repository.' |
493 command.addOption('File containing private key and certificates required to si
gn the release', short='k', long='key', value='file', types=('gecko')) | 483 command.addOption('File containing private key and certificates required to si
gn the release', short='k', long='key', value='file', types=('gecko')) |
494 command.addOption('Directory containing downloads repository (if omitted ../do
wnloads is assumed)', short='d', long='downloads', value='dir') | 484 command.addOption('Directory containing downloads repository (if omitted ../do
wnloads is assumed)', short='d', long='downloads', value='dir') |
495 command.params = '[options] <version>' | 485 command.params = '[options] <version>' |
496 command.supportedTypes = ('gecko') | 486 command.supportedTypes = ('gecko') |
497 | 487 |
498 with addCommand(syncLocales, 'synclocales') as command: | |
499 command.shortDescription = 'Sync locales with a Firefox extension' | |
500 command.description = 'Updates locale files with strings from a Firefox extens
ion corresponding to the entries in [locale_sync] metadata section.' | |
501 command.params = '<firefox_addon_directory>' | |
502 command.supportedTypes = ('chrome') | |
503 | |
504 with addCommand(updatePSL, 'updatepsl') as command: | 488 with addCommand(updatePSL, 'updatepsl') as command: |
505 command.shortDescription = 'Updates Public Suffix List' | 489 command.shortDescription = 'Updates Public Suffix List' |
506 command.description = 'Downloads Public Suffix List (see http://publicsuffix.o
rg/) and generates lib/publicSuffixList.js from it.' | 490 command.description = 'Downloads Public Suffix List (see http://publicsuffix.o
rg/) and generates lib/publicSuffixList.js from it.' |
507 command.supportedTypes = ('chrome') | 491 command.supportedTypes = ('chrome') |
508 | 492 |
509 def getType(baseDir, scriptName, args): | 493 def getType(baseDir, scriptName, args): |
510 # Look for an explicit type parameter (has to be the first parameter) | 494 # Look for an explicit type parameter (has to be the first parameter) |
511 if len(args) >= 2 and args[0] == '-t': | 495 if len(args) >= 2 and args[0] == '-t': |
512 type = args[1] | 496 type = args[1] |
513 del args[1] | 497 del args[1] |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 if option in ('-h', '--help'): | 554 if option in ('-h', '--help'): |
571 usage(scriptName, type, command) | 555 usage(scriptName, type, command) |
572 sys.exit() | 556 sys.exit() |
573 commands[command](baseDir, scriptName, opts, args, type) | 557 commands[command](baseDir, scriptName, opts, args, type) |
574 else: | 558 else: |
575 print 'Command %s is not supported for this application type' % command | 559 print 'Command %s is not supported for this application type' % command |
576 usage(scriptName, type) | 560 usage(scriptName, type) |
577 else: | 561 else: |
578 print 'Command %s is unrecognized' % command | 562 print 'Command %s is unrecognized' % command |
579 usage(scriptName, type) | 563 usage(scriptName, type) |
OLD | NEW |