| Index: build.py |
| =================================================================== |
| --- a/build.py |
| +++ b/build.py |
| @@ -18,7 +18,7 @@ |
| import os, sys, re, subprocess, buildtools |
| from getopt import getopt, GetoptError |
| -knownTypes = ('gecko', 'chrome', 'opera') |
| +knownTypes = ('gecko', 'chrome', 'opera', 'safari') |
| class Command(object): |
| name = property(lambda self: self._name) |
| @@ -175,6 +175,7 @@ |
| releaseBuild = False |
| keyFile = None |
| experimentalAPI = False |
| + certs = [] |
| for option, value in opts: |
| if option in ('-l', '--locales'): |
| locales = value.split(',') |
| @@ -188,6 +189,8 @@ |
| releaseBuild = True |
| elif option == '--experimental': |
| experimentalAPI = True |
| + elif option == '--cert': |
| + certs.append(value) |
|
Wladimir Palant
2013/09/10 10:15:27
I suggest reusing the approach from the Gecko pack
|
| outFile = args[0] if len(args) > 0 else None |
| if type == 'gecko': |
| @@ -200,6 +203,10 @@ |
| packager.createBuild(baseDir, type=type, outFile=outFile, buildNum=buildNum, |
| releaseBuild=releaseBuild, keyFile=keyFile, |
| experimentalAPI=experimentalAPI) |
| + elif type == 'safari': |
| + import buildtools.packagerSafari as packager |
| + packager.createBuild(baseDir, type=type, outFile=outFile, buildNum=buildNum, releaseBuild=releaseBuild, keyFile=keyFile, certs=certs) |
| + |
| def runAutoInstall(baseDir, scriptName, opts, args, type): |
| @@ -425,11 +432,12 @@ |
| 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', 'opera')) |
| + command.addOption('File containing private key and certificates required to sign the package', short='k', long='key', value='file', types=('gecko', 'chrome', 'opera', 'safari')) |
| + command.addOption('File containing an X509 certificate to be inlcuded into the package. Can be given multiple times.', long='cert', value='file', types=('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.addOption('Enable use of experimental APIs', long='experimental') |
| - command.supportedTypes = ('gecko', 'chrome', 'opera') |
| + command.supportedTypes = ('gecko', 'chrome', 'opera', 'safari') |
| with addCommand(runAutoInstall, 'autoinstall') as command: |
| command.shortDescription = 'Install extension automatically' |