Index: build.py |
=================================================================== |
--- a/build.py |
+++ b/build.py |
@@ -7,17 +7,17 @@ |
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') |
+knownTypes = ('gecko', '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}) |
) |
@@ -171,49 +171,43 @@ |
'name': command.name, |
'params': command.params, |
'description': description, |
'options': '\n'.join(options) |
} |
def runBuild(baseDir, scriptName, opts, args, type): |
Vasily Kuznetsov
2016/06/13 12:57:30
Add support for `type = "edge"` and removing unnec
|
- locales = None |
- buildNum = None |
- multicompartment = False |
- releaseBuild = False |
- keyFile = None |
+ kwargs = {} |
for option, value in opts: |
- if option in ('-l', '--locales'): |
- locales = value.split(',') |
+ if option in ('-l', '--locales') and type == 'gecko': |
+ kwargs['locales'] = value.split(',') |
elif option in ('-b', '--build'): |
- buildNum = value |
- if type != 'gecko' and not re.search(r'^\d+$', buildNum): |
+ kwargs['buildNum'] = value |
+ if type != 'gecko' and not re.search(r'^\d+$', kwargs['buildNum']): |
raise TypeError('Build number must be numerical') |
elif option in ('-k', '--key'): |
- keyFile = value |
- elif option in ('-m', '--multi-compartment'): |
- multicompartment = True |
+ kwargs['keyFile'] = value |
+ elif option in ('-m', '--multi-compartment') and type == 'gecko': |
+ kwargs['multicompartment'] = True |
elif option in ('-r', '--release'): |
- releaseBuild = True |
- outFile = args[0] if len(args) > 0 else None |
+ kwargs['releaseBuild'] = True |
+ if len(args) > 0: |
+ kwargs['outFile'] = args[0] |
if type == 'gecko': |
import buildtools.packagerGecko as packager |
- packager.createBuild(baseDir, type=type, outFile=outFile, locales=locales, buildNum=buildNum, |
- releaseBuild=releaseBuild, keyFile=keyFile, |
- multicompartment=multicompartment) |
elif type == 'chrome': |
import buildtools.packagerChrome as packager |
- packager.createBuild(baseDir, type=type, outFile=outFile, buildNum=buildNum, |
- releaseBuild=releaseBuild, keyFile=keyFile) |
elif type == 'safari': |
import buildtools.packagerSafari as packager |
- packager.createBuild(baseDir, type=type, outFile=outFile, buildNum=buildNum, |
- releaseBuild=releaseBuild, keyFile=keyFile) |
+ elif type == 'edge': |
+ import buildtools.packagerEdge as packager |
+ |
+ packager.createBuild(baseDir, type=type, **kwargs) |
def runAutoInstall(baseDir, scriptName, opts, args, type): |
if len(args) == 0: |
print 'Port of the Extension Auto-Installer needs to be specified' |
usage(scriptName, type, 'autoinstall') |
return |
@@ -474,17 +468,17 @@ |
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=('gecko', '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') |
+ command.supportedTypes = ('gecko', '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') |