Index: packagerChrome.py |
=================================================================== |
--- a/packagerChrome.py |
+++ b/packagerChrome.py |
@@ -123,16 +123,20 @@ def createManifest(params): |
manifest = json.dumps(data, sort_keys=True, indent=2) |
return manifest.encode('utf-8') |
def createPoller(params): |
template = getTemplate('chromeDevenvPoller__.js.tmpl') |
return template.render(params).encode('utf-8'); |
+def createInfoModule(params): |
+ template = getTemplate('chromeInfo.js.tmpl') |
+ return template.render(params).encode('utf-8'); |
+ |
def convertJS(params, files): |
from jshydra.abp_rewrite import doRewrite |
for item in params['metadata'].items('convert_js'): |
file, sources = item |
baseDir = os.path.dirname(item.source) |
# Make sure the file is inside an included directory |
@@ -332,16 +336,21 @@ def createBuild(baseDir, type='chrome', |
convertJS(params, files) |
if metadata.has_section('import_locales'): |
importGeckoLocales(params, files) |
if devenv: |
files['devenvPoller__.js'] = createPoller(params) |
+ if (metadata.has_option('general', 'backgroundScripts') and |
+ 'lib/info.js' in re.split(r'\s+', metadata.get('general', 'backgroundScripts')) and |
+ 'lib/info.js' not in files): |
+ files['lib/info.js'] = createInfoModule(params) |
+ |
zipdata = files.zipToString() |
signature = None |
pubkey = None |
if keyFile != None: |
signature = signBinary(zipdata, keyFile) |
pubkey = getPublicKey(keyFile) |
writePackage(outFile, pubkey, signature, zipdata) |