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

Unified Diff: packagerChrome.py

Issue 11180001: Automatically generate info pseudo-module for Chromium-based applications (Closed)
Patch Set: Created July 22, 2013, 1:26 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
« chromeInfo.js.tmpl ('K') | « chromeInfo.js.tmpl ('k') | no next file » | 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
@@ -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)
« chromeInfo.js.tmpl ('K') | « chromeInfo.js.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld