| Left: | ||
| Right: |
| 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 import buildtools | 10 import buildtools |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 'name': command.name, | 171 'name': command.name, |
| 172 'params': command.params, | 172 'params': command.params, |
| 173 'description': description, | 173 'description': description, |
| 174 'options': '\n'.join(options) | 174 'options': '\n'.join(options) |
| 175 } | 175 } |
| 176 | 176 |
| 177 | 177 |
| 178 def runBuild(baseDir, scriptName, opts, args, type): | 178 def runBuild(baseDir, scriptName, opts, args, type): |
| 179 kwargs = {} | 179 kwargs = {} |
| 180 for option, value in opts: | 180 for option, value in opts: |
| 181 if option in ('-l', '--locales') and type == 'gecko': | 181 if option in {'-l', '--locales'} and type == 'gecko': |
|
Sebastian Noack
2016/10/04 19:58:04
While refactoring this code anyway, this should be
Vasily Kuznetsov
2016/10/11 15:58:27
Done.
| |
| 182 kwargs['locales'] = value.split(',') | 182 kwargs['locales'] = value.split(',') |
| 183 elif option in ('-b', '--build'): | 183 elif option in {'-b', '--build'}: |
| 184 kwargs['buildNum'] = value | 184 kwargs['buildNum'] = value |
| 185 if type != 'gecko' and not kwargs['buildNum'].isdigit(): | 185 if type != 'gecko' and not kwargs['buildNum'].isdigit(): |
| 186 raise TypeError('Build number must be numerical') | 186 raise TypeError('Build number must be numerical') |
| 187 elif option in ('-k', '--key'): | 187 elif option in {'-k', '--key'}: |
| 188 kwargs['keyFile'] = value | 188 kwargs['keyFile'] = value |
| 189 elif option in ('-m', '--multi-compartment') and type == 'gecko': | 189 elif option in {'-m', '--multi-compartment'} and type == 'gecko': |
| 190 kwargs['multicompartment'] = True | 190 kwargs['multicompartment'] = True |
| 191 elif option in ('-r', '--release'): | 191 elif option in {'-r', '--release'}: |
| 192 kwargs['releaseBuild'] = True | 192 kwargs['releaseBuild'] = True |
| 193 if len(args) > 0: | 193 if len(args) > 0: |
| 194 kwargs['outFile'] = args[0] | 194 kwargs['outFile'] = args[0] |
| 195 | 195 |
| 196 if type == 'gecko': | 196 if type == 'gecko': |
| 197 import buildtools.packagerGecko as packager | 197 import buildtools.packagerGecko as packager |
| 198 elif type == 'chrome': | 198 elif type == 'chrome': |
| 199 import buildtools.packagerChrome as packager | 199 import buildtools.packagerChrome as packager |
| 200 elif type == 'safari': | 200 elif type == 'safari': |
| 201 import buildtools.packagerSafari as packager | 201 import buildtools.packagerSafari as packager |
| 202 elif type == 'edge': | 202 elif type == 'edge': |
| 203 import buildtools.packagerEdge as packager | 203 import buildtools.packagerEdge as packager |
| 204 | 204 |
| 205 packager.createBuild(baseDir, type=type, **kwargs) | 205 packager.createBuild(baseDir, type=type, **kwargs) |
|
Sebastian Noack
2016/10/04 19:58:05
Since you are apparently changing the calling code
Vasily Kuznetsov
2016/10/11 15:58:27
That's a lot of unrelated changes to pull in. Also
Sebastian Noack
2016/10/12 11:07:48
I was only talking about packagerEdge.create_build
Vasily Kuznetsov
2016/10/12 14:13:42
I tried doing it, but unfortunately we still can't
Sebastian Noack
2016/10/12 14:43:26
I guess, let's leave it as is for now. We still sh
Vasily Kuznetsov
2016/10/13 11:56:35
Fully agree.
| |
| 206 | 206 |
| 207 | 207 |
| 208 def runAutoInstall(baseDir, scriptName, opts, args, type): | 208 def runAutoInstall(baseDir, scriptName, opts, args, type): |
| 209 if len(args) == 0: | 209 if len(args) == 0: |
| 210 print 'Port of the Extension Auto-Installer needs to be specified' | 210 print 'Port of the Extension Auto-Installer needs to be specified' |
| 211 usage(scriptName, type, 'autoinstall') | 211 usage(scriptName, type, 'autoinstall') |
| 212 return | 212 return |
| 213 | 213 |
| 214 multicompartment = False | 214 multicompartment = False |
| 215 for option, value in opts: | 215 for option, value in opts: |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 598 if option in ('-h', '--help'): | 598 if option in ('-h', '--help'): |
| 599 usage(scriptName, type, command) | 599 usage(scriptName, type, command) |
| 600 sys.exit() | 600 sys.exit() |
| 601 commands[command](baseDir, scriptName, opts, args, type) | 601 commands[command](baseDir, scriptName, opts, args, type) |
| 602 else: | 602 else: |
| 603 print 'Command %s is not supported for this application type' % comm and | 603 print 'Command %s is not supported for this application type' % comm and |
| 604 usage(scriptName, type) | 604 usage(scriptName, type) |
| 605 else: | 605 else: |
| 606 print 'Command %s is unrecognized' % command | 606 print 'Command %s is unrecognized' % command |
| 607 usage(scriptName, type) | 607 usage(scriptName, type) |
| LEFT | RIGHT |