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) |