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

Unified Diff: packagerGecko.py

Issue 29397581: Issue 5049 - Allow embedded WebExtensions in gecko packager (Closed) Base URL: https://hg.adblockplus.org/buildtools/
Patch Set: Created March 29, 2017, 9:56 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/bootstrap.js.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerGecko.py
===================================================================
--- a/packagerGecko.py
+++ b/packagerGecko.py
@@ -50,17 +50,20 @@ def getChromeSubdirs(baseDir, locales):
for subdir in ('content', 'skin'):
result[subdir] = os.path.join(chromeDir, subdir)
for locale in locales:
result['locale/%s' % locale] = os.path.join(chromeDir, 'locale', locale)
return result
def getPackageFiles(params):
- result = set(('chrome', 'components', 'modules', 'lib', 'resources', 'chrome.manifest', 'icon.png', 'icon64.png',))
+ result = {
+ 'chrome', 'components', 'modules', 'lib', 'resources', 'webextension',
+ 'chrome.manifest', 'icon.png', 'icon64.png'
+ }
baseDir = params['baseDir']
for file in os.listdir(baseDir):
if file.endswith('.js') or file.endswith('.xml'):
result.add(file)
return result
@@ -236,16 +239,17 @@ def addMissingFiles(params, files):
templateData = {
'hasChrome': False,
'hasChromeRequires': False,
'hasShutdownHandlers': False,
'chromeWindows': [],
'requires': set(),
'jsonRequires': params['jsonRequires'],
'metadata': params['metadata'],
+ 'hasWebExtension': params['hasWebExtension'],
'multicompartment': params['multicompartment'],
'applications': dict((v, k) for k, v in KNOWN_APPS.iteritems()),
}
def checkScript(name):
content = files[name]
for match in re.finditer(r'(?:^|\s)require\(\s*"([\w\-]+)"\s*\)', content):
templateData['requires'].add(match.group(1))
@@ -301,16 +305,17 @@ def createBuild(baseDir, type='gecko', o
params = {
'baseDir': baseDir,
'locales': locales,
'releaseBuild': releaseBuild,
'version': version.encode('utf-8'),
'metadata': metadata,
'contributors': contributors,
'multicompartment': multicompartment,
+ 'hasWebExtension': os.path.isdir(os.path.join(baseDir, 'webextension')),
'jsonRequires': {},
}
mapped = metadata.items('mapping') if metadata.has_section('mapping') else []
skip = [opt for opt, _ in mapped] + ['chrome']
files = Files(getPackageFiles(params), getIgnoredFiles(params),
process=lambda path, data: processFile(path, data, params))
files['install.rdf'] = createManifest(params)
« no previous file with comments | « no previous file | templates/bootstrap.js.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld