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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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': |
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 no_gecko_build = type not in {'gecko', 'gecko-webext'} | 185 no_gecko_build = type not in {'gecko', 'gecko-webext'} |
186 if no_gecko_build and not kwargs['buildNum'].isdigit(): | 186 if no_gecko_build and not kwargs['buildNum'].isdigit(): |
187 raise TypeError('Build number must be numerical') | 187 raise TypeError('Build number must be numerical') |
188 elif option in {'-k', '--key'}: | 188 elif option in {'-k', '--key'}: |
189 kwargs['keyFile'] = value | 189 kwargs['keyFile'] = value |
190 elif option in {'-m', '--multi-compartment'} and type == 'gecko': | 190 elif option in {'-m', '--multi-compartment'} and type == 'gecko': |
191 kwargs['multicompartment'] = True | 191 kwargs['multicompartment'] = True |
192 elif option in {'-r', '--release'}: | 192 elif option in {'-r', '--release'}: |
193 kwargs['releaseBuild'] = True | 193 kwargs['releaseBuild'] = True |
194 if len(args) > 0: | 194 if len(args) > 0: |
195 kwargs['outFile'] = args[0] | 195 kwargs['outFile'] = args[0] |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 if option in ('-h', '--help'): | 599 if option in ('-h', '--help'): |
600 usage(scriptName, type, command) | 600 usage(scriptName, type, command) |
601 sys.exit() | 601 sys.exit() |
602 commands[command](baseDir, scriptName, opts, args, type) | 602 commands[command](baseDir, scriptName, opts, args, type) |
603 else: | 603 else: |
604 print 'Command %s is not supported for this application type' % comm
and | 604 print 'Command %s is not supported for this application type' % comm
and |
605 usage(scriptName, type) | 605 usage(scriptName, type) |
606 else: | 606 else: |
607 print 'Command %s is unrecognized' % command | 607 print 'Command %s is unrecognized' % command |
608 usage(scriptName, type) | 608 usage(scriptName, type) |
LEFT | RIGHT |