| Index: build.py |
| =================================================================== |
| --- a/build.py |
| +++ b/build.py |
| @@ -7,17 +7,17 @@ import sys |
| import re |
| import subprocess |
| import shutil |
| import buildtools |
| from getopt import getopt, GetoptError |
| from StringIO import StringIO |
| from zipfile import ZipFile |
| -knownTypes = ('gecko', 'chrome', 'safari', 'generic', 'edge') |
| +knownTypes = ('gecko', 'gecko-webext', 'chrome', 'safari', 'generic', 'edge') |
| class Command(object): |
| name = property(lambda self: self._name) |
| shortDescription = property( |
| lambda self: self._shortDescription, |
| lambda self, value: self.__dict__.update({'_shortDescription': value}) |
| ) |
| @@ -190,17 +190,17 @@ def runBuild(baseDir, scriptName, opts, |
| kwargs['multicompartment'] = True |
| elif option in {'-r', '--release'}: |
| kwargs['releaseBuild'] = True |
| if len(args) > 0: |
| kwargs['outFile'] = args[0] |
| if type == 'gecko': |
| import buildtools.packagerGecko as packager |
| - elif type == 'chrome': |
| + elif type in {'chrome', 'gecko-webext'}: |
| import buildtools.packagerChrome as packager |
| elif type == 'safari': |
| import buildtools.packagerSafari as packager |
| elif type == 'edge': |
| import buildtools.packagerEdge as packager |
| packager.createBuild(baseDir, type=type, **kwargs) |
| @@ -249,17 +249,17 @@ def readLocaleConfig(baseDir, type, meta |
| import buildtools.packagerGecko as packager |
| localeDir = packager.getLocalesDir(baseDir) |
| localeConfig = { |
| 'name_format': 'BCP-47', |
| 'file_format': 'gecko-dtd', |
| 'target_platforms': {'gecko'}, |
| 'default_locale': packager.defaultLocale |
| } |
| - elif type == 'chrome': |
| + elif type in {'chrome', 'gecko-webext'}: |
| import buildtools.packagerChrome as packager |
| localeDir = os.path.join(baseDir, '_locales') |
| localeConfig = { |
| 'name_format': 'ISO-15897', |
| 'file_format': 'chrome-json', |
| 'target_platforms': {'chrome'}, |
| 'default_locale': packager.defaultLocale, |
| } |
| @@ -462,29 +462,29 @@ with addCommand(runBuild, 'build') as co |
| command.shortDescription = 'Create a build' |
| command.description = 'Creates an extension build with given file name. If output_file is missing a default name will be chosen.' |
| command.params = '[options] [output_file]' |
| command.addOption('Only include the given locales (if omitted: all locales not marked as incomplete)', short='l', long='locales', value='l1,l2,l3', types=('gecko')) |
| command.addOption('Use given build number (if omitted the build number will be retrieved from Mercurial)', short='b', long='build', value='num') |
| command.addOption('File containing private key and certificates required to sign the package', short='k', long='key', value='file', types=('chrome', 'safari')) |
| command.addOption('Create a build for leak testing', short='m', long='multi-compartment', types=('gecko')) |
| command.addOption('Create a release build', short='r', long='release') |
| - command.supportedTypes = ('gecko', 'chrome', 'safari', 'edge') |
| + command.supportedTypes = ('gecko', 'gecko-webext', 'chrome', 'safari', 'edge') |
| with addCommand(runAutoInstall, 'autoinstall') as command: |
| command.shortDescription = 'Install extension automatically' |
| command.description = 'Will automatically install the extension in a browser running Extension Auto-Installer. If host parameter is omitted assumes that the browser runs on localhost.' |
| command.params = '[<host>:]<port>' |
| command.addOption('Create a build for leak testing', short='m', long='multi-compartment') |
| command.supportedTypes = ('gecko') |
| with addCommand(createDevEnv, 'devenv') as command: |
| command.shortDescription = 'Set up a development environment' |
| command.description = 'Will set up or update the devenv folder as an unpacked extension folder for development.' |
| - command.supportedTypes = ('chrome', 'safari') |
| + command.supportedTypes = ('gecko-webext', 'chrome', 'safari') |
| with addCommand(setupTranslations, 'setuptrans') as command: |
| command.shortDescription = 'Sets up translation languages' |
| command.description = 'Sets up translation languages for the project on crowdin.net.' |
| command.params = '[options] project-key' |
| command.supportedTypes = ('gecko', 'chrome', 'generic') |
| with addCommand(updateTranslationMaster, 'translate') as command: |