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

Unified Diff: packagerChrome.py

Issue 29743581: Issue 6552 - Support arbitrary manifest values (Closed) Base URL: https://hg.adblockplus.org/buildtools/file/a3db4a1a49e8
Patch Set: Created April 5, 2018, 10:21 a.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 | « no previous file | templates/manifest.json.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerChrome.py
diff --git a/packagerChrome.py b/packagerChrome.py
index 6f09e9ccf95e7a7903097cbd31c642d63018886e..49b9b18e4d0beaf8612ff85184ea8310d986dfa6 100644
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -13,6 +13,7 @@ import subprocess
import sys
import random
import posixpath
+import ConfigParser
from packager import (readMetadata, getDefaultFileName, getBuildVersion,
getTemplate, get_extension, Files, get_app_id)
@@ -122,6 +123,27 @@ def createManifest(params, files):
templateData['webAccessible'] = metadata.get('general',
'webAccessible').split()
+ for key in ['externallyConnectable_matches', 'externallyConnectable_ids']:
+ try:
+ values = metadata.get('general', key)
+ if values == '':
+ continue
+
+ sub_key = key.split('_', 1)[1]
+ templateData.setdefault('externallyConnectable', {})
+ templateData['externallyConnectable'][sub_key] = values.split()
+ except ConfigParser.NoOptionError:
+ continue
+
+ # We don't need to configure accept_ts_channel_id if nothing can connect
+ if 'externallyConnectable' in templateData.keys():
+ try:
+ key = 'accepts_tls_channel_id'
+ val = metadata.get('general', 'externallyConnectable_' + key)
+ templateData['externallyConnectable'][key] = val == 'true'
+ except ConfigParser.NoOptionError:
+ pass
+
if metadata.has_section('contentScripts'):
contentScripts = []
for run_at, scripts in metadata.items('contentScripts'):
« no previous file with comments | « no previous file | templates/manifest.json.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld