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

Unified Diff: packagerChrome.py

Issue 29365583: Issue 4670 - Add a new build type for Gecko-based WebExtensions (Closed) Base URL: https://hg.adblockplus.org/buildtools
Patch Set: Split out info module into a Chrome and Gecko specific one Created Dec. 3, 2016, 7:02 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build.py ('k') | templates/geckoInfo.js.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerChrome.py
===================================================================
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -134,17 +134,20 @@ def createManifest(params, files):
if '_dummy' in data:
del data['_dummy']
manifest = json.dumps(data, sort_keys=True, indent=2)
return manifest.encode('utf-8')
def createInfoModule(params):
- template = getTemplate('chromeInfo.js.tmpl')
+ if params['type'] == 'gecko-webext':
+ template = getTemplate('geckoInfo.js.tmpl')
+ else:
+ template = getTemplate('chromeInfo.js.tmpl')
return template.render(params).encode('utf-8')
def convertJS(params, files):
from jshydra.abp_rewrite import rewrite_js
output_files = collections.OrderedDict()
args = collections.defaultdict(list)
@@ -330,17 +333,21 @@ def writePackage(outputFile, pubkey, sig
file.write(zipdata)
def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuild=False, keyFile=None, devenv=False):
metadata = readMetadata(baseDir, type)
version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum)
if outFile == None:
- outFile = getDefaultFileName(metadata, version, 'crx' if keyFile else 'zip')
+ if type == 'gecko-webext':
+ file_extension = 'xpi'
+ else:
+ file_extension = 'crx' if keyFile else 'zip'
+ outFile = getDefaultFileName(metadata, version, file_extension)
params = {
'type': type,
'baseDir': baseDir,
'releaseBuild': releaseBuild,
'version': version,
'devenv': devenv,
'metadata': metadata,
« no previous file with comments | « build.py ('k') | templates/geckoInfo.js.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld