Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: build.py

Issue 11544056: Prepared buildtools for Safari (Closed)
Patch Set: Made "Chrome" be not replaced with "Safari" in the warning on the first run page Created Oct. 25, 2013, 4:55 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This file is part of the Adblock Plus build tools, 3 # This file is part of the Adblock Plus build tools,
4 # Copyright (C) 2006-2013 Eyeo GmbH 4 # Copyright (C) 2006-2013 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details. 13 # GNU General Public License for more details.
14 # 14 #
15 # You should have received a copy of the GNU General Public License 15 # You should have received a copy of the GNU General Public License
16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
17 17
18 import os, sys, re, subprocess, buildtools 18 import os, sys, re, subprocess, buildtools
19 from getopt import getopt, GetoptError 19 from getopt import getopt, GetoptError
20 20
21 knownTypes = ('gecko', 'chrome', 'opera') 21 knownTypes = ('gecko', 'chrome', 'opera', 'safari')
22 22
23 class Command(object): 23 class Command(object):
24 name = property(lambda self: self._name) 24 name = property(lambda self: self._name)
25 shortDescription = property(lambda self: self._shortDescription, 25 shortDescription = property(lambda self: self._shortDescription,
26 lambda self, value: self.__dict__.update({'_shortDescription': value})) 26 lambda self, value: self.__dict__.update({'_shortDescription': value}))
27 description = property(lambda self: self._description, 27 description = property(lambda self: self._description,
28 lambda self, value: self.__dict__.update({'_description': value})) 28 lambda self, value: self.__dict__.update({'_description': value}))
29 params = property(lambda self: self._params, 29 params = property(lambda self: self._params,
30 lambda self, value: self.__dict__.update({'_params': value})) 30 lambda self, value: self.__dict__.update({'_params': value}))
31 supportedTypes = property(lambda self: self._supportedTypes, 31 supportedTypes = property(lambda self: self._supportedTypes,
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 if type == 'gecko': 193 if type == 'gecko':
194 import buildtools.packagerGecko as packager 194 import buildtools.packagerGecko as packager
195 packager.createBuild(baseDir, type=type, outFile=outFile, locales=locales, b uildNum=buildNum, 195 packager.createBuild(baseDir, type=type, outFile=outFile, locales=locales, b uildNum=buildNum,
196 releaseBuild=releaseBuild, keyFile=keyFile, 196 releaseBuild=releaseBuild, keyFile=keyFile,
197 multicompartment=multicompartment) 197 multicompartment=multicompartment)
198 elif type == 'chrome' or type == 'opera': 198 elif type == 'chrome' or type == 'opera':
199 import buildtools.packagerChrome as packager 199 import buildtools.packagerChrome as packager
200 packager.createBuild(baseDir, type=type, outFile=outFile, buildNum=buildNum, 200 packager.createBuild(baseDir, type=type, outFile=outFile, buildNum=buildNum,
201 releaseBuild=releaseBuild, keyFile=keyFile, 201 releaseBuild=releaseBuild, keyFile=keyFile,
202 experimentalAPI=experimentalAPI) 202 experimentalAPI=experimentalAPI)
203 elif type == 'safari':
204 import buildtools.packagerSafari as packager
205 packager.createBuild(baseDir, type=type, outFile=outFile, buildNum=buildNum, releaseBuild=releaseBuild, keyFile=keyFile)
Wladimir Palant 2013/10/30 13:36:01 Nit: restricting line length to 80 characters here
203 206
204 207
205 def runAutoInstall(baseDir, scriptName, opts, args, type): 208 def runAutoInstall(baseDir, scriptName, opts, args, type):
206 if len(args) == 0: 209 if len(args) == 0:
207 print 'Port of the Extension Auto-Installer needs to be specified' 210 print 'Port of the Extension Auto-Installer needs to be specified'
208 usage(scriptName, type, 'autoinstall') 211 usage(scriptName, type, 'autoinstall')
209 return 212 return
210 213
211 multicompartment = False 214 multicompartment = False
212 for option, value in opts: 215 for option, value in opts:
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 421
419 with addCommand(lambda baseDir, scriptName, opts, args, type: usage(scriptName, type), ('help', '-h', '--help')) as command: 422 with addCommand(lambda baseDir, scriptName, opts, args, type: usage(scriptName, type), ('help', '-h', '--help')) as command:
420 command.shortDescription = 'Show this message' 423 command.shortDescription = 'Show this message'
421 424
422 with addCommand(runBuild, 'build') as command: 425 with addCommand(runBuild, 'build') as command:
423 command.shortDescription = 'Create a build' 426 command.shortDescription = 'Create a build'
424 command.description = 'Creates an extension build with given file name. If out put_file is missing a default name will be chosen.' 427 command.description = 'Creates an extension build with given file name. If out put_file is missing a default name will be chosen.'
425 command.params = '[options] [output_file]' 428 command.params = '[options] [output_file]'
426 command.addOption('Only include the given locales (if omitted: all locales not marked as incomplete)', short='l', long='locales', value='l1,l2,l3', types=('ge cko')) 429 command.addOption('Only include the given locales (if omitted: all locales not marked as incomplete)', short='l', long='locales', value='l1,l2,l3', types=('ge cko'))
427 command.addOption('Use given build number (if omitted the build number will be retrieved from Mercurial)', short='b', long='build', value='num') 430 command.addOption('Use given build number (if omitted the build number will be retrieved from Mercurial)', short='b', long='build', value='num')
428 command.addOption('File containing private key and certificates required to si gn the package', short='k', long='key', value='file', types=('gecko', 'chrome', 'opera')) 431 command.addOption('File containing private key and certificates required to si gn the package', short='k', long='key', value='file', types=('gecko', 'chrome', 'opera', 'safari'))
429 command.addOption('Create a build for leak testing', short='m', long='multi-co mpartment', types=('gecko')) 432 command.addOption('Create a build for leak testing', short='m', long='multi-co mpartment', types=('gecko'))
430 command.addOption('Create a release build', short='r', long='release') 433 command.addOption('Create a release build', short='r', long='release')
431 command.addOption('Enable use of experimental APIs', long='experimental') 434 command.addOption('Enable use of experimental APIs', long='experimental')
432 command.supportedTypes = ('gecko', 'chrome', 'opera') 435 command.supportedTypes = ('gecko', 'chrome', 'opera', 'safari')
433 436
434 with addCommand(runAutoInstall, 'autoinstall') as command: 437 with addCommand(runAutoInstall, 'autoinstall') as command:
435 command.shortDescription = 'Install extension automatically' 438 command.shortDescription = 'Install extension automatically'
436 command.description = 'Will automatically install the extension in a browser r unning Extension Auto-Installer. If host parameter is omitted assumes that the b rowser runs on localhost.' 439 command.description = 'Will automatically install the extension in a browser r unning Extension Auto-Installer. If host parameter is omitted assumes that the b rowser runs on localhost.'
437 command.params = '[<host>:]<port>' 440 command.params = '[<host>:]<port>'
438 command.addOption('Create a build for leak testing', short='m', long='multi-co mpartment') 441 command.addOption('Create a build for leak testing', short='m', long='multi-co mpartment')
439 command.supportedTypes = ('gecko') 442 command.supportedTypes = ('gecko')
440 443
441 with addCommand(createDevEnv, 'devenv') as command: 444 with addCommand(createDevEnv, 'devenv') as command:
442 command.shortDescription = 'Set up a development environment' 445 command.shortDescription = 'Set up a development environment'
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 if option in ('-h', '--help'): 565 if option in ('-h', '--help'):
563 usage(scriptName, type, command) 566 usage(scriptName, type, command)
564 sys.exit() 567 sys.exit()
565 commands[command](baseDir, scriptName, opts, args, type) 568 commands[command](baseDir, scriptName, opts, args, type)
566 else: 569 else:
567 print 'Command %s is not supported for this application type' % command 570 print 'Command %s is not supported for this application type' % command
568 usage(scriptName, type) 571 usage(scriptName, type)
569 else: 572 else:
570 print 'Command %s is unrecognized' % command 573 print 'Command %s is unrecognized' % command
571 usage(scriptName, type) 574 usage(scriptName, type)
OLDNEW
« no previous file with comments | « background.html.tmpl ('k') | imageConversion.py » ('j') | imageConversion.py » ('J')

Powered by Google App Engine
This is Rietveld