Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 # This Source Code Form is subject to the terms of the Mozilla Public | 1 # This Source Code Form is subject to the terms of the Mozilla Public |
2 # License, v. 2.0. If a copy of the MPL was not distributed with this | 2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
4 | 4 |
5 from __future__ import print_function | 5 from __future__ import print_function |
6 | 6 |
7 import os | 7 import os |
8 import re | 8 import re |
9 import codecs | 9 import codecs |
10 import subprocess | 10 import subprocess |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 rawMetadata = re.sub( | 133 rawMetadata = re.sub( |
134 r'^(\s*version\s*=\s*).*', r'\g<1>%s' % version, | 134 r'^(\s*version\s*=\s*).*', r'\g<1>%s' % version, |
135 rawMetadata, flags=re.I | re.M | 135 rawMetadata, flags=re.I | re.M |
136 ) | 136 ) |
137 | 137 |
138 file.seek(0) | 138 file.seek(0) |
139 file.write(rawMetadata) | 139 file.write(rawMetadata) |
140 file.truncate() | 140 file.truncate() |
141 | 141 |
142 # Read extension name from locale data | 142 # Read extension name from locale data |
143 locales_base = os.path.join(baseDir, 'adblockplus') | 143 default_locale_path = os.path.join('_locales', packager.defaultLocale, |
144 | 144 'messages.json') |
145 with open(os.path.join(locales_base, 'chrome', 'locale', | 145 with open(default_locale_path, 'r') as fp: |
Sebastian Noack
2017/10/04 22:22:18
This will no longer work since the "adblockplus" d
tlucas
2017/10/05 10:10:30
Done.
| |
146 packager.defaultLocale.replace('_', '-'), | |
147 'meta.json'), | |
148 'r') as fp: | |
149 extensionName = json.load(fp)['name'] | 146 extensionName = json.load(fp)['name'] |
150 | 147 |
151 # Now commit the change and tag it | 148 # Now commit the change and tag it |
152 subprocess.check_call(['hg', 'commit', '-R', baseDir, '-m', 'Releasing %s %s ' % (extensionName, version)]) | 149 subprocess.check_call(['hg', 'commit', '-R', baseDir, '-m', 'Releasing %s %s ' % (extensionName, version)]) |
153 tag_name = version | 150 tag_name = version |
154 if type in {'safari', 'edge'}: | 151 if type in {'safari', 'edge'}: |
155 tag_name = '{}-{}'.format(tag_name, type) | 152 tag_name = '{}-{}'.format(tag_name, type) |
156 subprocess.check_call(['hg', 'tag', '-R', baseDir, '-f', tag_name]) | 153 subprocess.check_call(['hg', 'tag', '-R', baseDir, '-f', tag_name]) |
157 | 154 |
158 # Create a release build | 155 # Create a release build |
(...skipping 21 matching lines...) Expand all Loading... | |
180 create_sourcearchive(baseDir, archivePath) | 177 create_sourcearchive(baseDir, archivePath) |
181 downloads.append(archivePath) | 178 downloads.append(archivePath) |
182 | 179 |
183 # Now add the downloads and commit | 180 # Now add the downloads and commit |
184 subprocess.check_call(['hg', 'add', '-R', downloadsRepo] + downloads) | 181 subprocess.check_call(['hg', 'add', '-R', downloadsRepo] + downloads) |
185 subprocess.check_call(['hg', 'commit', '-R', downloadsRepo, '-m', 'Releasing %s %s' % (extensionName, version)]) | 182 subprocess.check_call(['hg', 'commit', '-R', downloadsRepo, '-m', 'Releasing %s %s' % (extensionName, version)]) |
186 | 183 |
187 # Push all changes | 184 # Push all changes |
188 subprocess.check_call(['hg', 'push', '-R', baseDir]) | 185 subprocess.check_call(['hg', 'push', '-R', baseDir]) |
189 subprocess.check_call(['hg', 'push', '-R', downloadsRepo]) | 186 subprocess.check_call(['hg', 'push', '-R', downloadsRepo]) |
LEFT | RIGHT |