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

Unified Diff: packager.py

Issue 29611593: Issue 5996 - Release consistent versions across WebExtensions (Closed) Base URL: https://codereview.adblockplus.org/29609559/
Patch Set: Refactoring release decision Created Nov. 23, 2017, 11:57 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 | « localeTools.py ('k') | packagerChrome.py » ('j') | releaseAutomation.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packager.py
diff --git a/packager.py b/packager.py
index 49f0af2b8826dc8c07f0e150c6bd1c393c7eaf20..06ea732acb71191ef28a0ac2ac27220d56e7d85b 100644
--- a/packager.py
+++ b/packager.py
@@ -16,11 +16,32 @@ from chainedconfigparser import ChainedConfigParser
import buildtools
+EXTENSIONS = {
+ 'edge': 'appx',
+ 'gecko': 'xpi',
+ 'chrome': {'unsigned': 'zip', 'signed': 'crx'},
+}
+
def getDefaultFileName(metadata, version, ext):
return '%s-%s.%s' % (metadata.get('general', 'basename'), version, ext)
+def get_extension(platform, has_key_file=False):
+ extension = EXTENSIONS[platform]
+
+ try:
+ if has_key_file:
+ key = 'signed'
+ else:
+ key = 'unsigned'
+ extension = extension[key]
+ except (KeyError, TypeError):
+ pass
+
+ return extension
+
+
def getMetadataPath(baseDir, type):
return os.path.join(baseDir, 'metadata.%s' % type)
« no previous file with comments | « localeTools.py ('k') | packagerChrome.py » ('j') | releaseAutomation.py » ('J')

Powered by Google App Engine
This is Rietveld