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

Side by Side Diff: sitescripts/extensions/bin/createNightlies.py

Issue 29337977: Issue 3758 - Removed Opera Extensions related logic (Closed)
Patch Set: Created March 8, 2016, 5:15 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This file is part of the Adblock Plus web scripts, 3 # This file is part of the Adblock Plus web scripts,
4 # Copyright (C) 2006-2016 Eyeo GmbH 4 # Copyright (C) 2006-2016 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 self.certificateID = packager.get_developer_identifier(certs) 216 self.certificateID = packager.get_developer_identifier(certs)
217 self.version = packager.getBuildVersion(self.tempdir, metadata, False, self. revision) 217 self.version = packager.getBuildVersion(self.tempdir, metadata, False, self. revision)
218 self.shortVersion = metadata.get("general", "version") 218 self.shortVersion = metadata.get("general", "version")
219 self.basename = metadata.get("general", "basename") 219 self.basename = metadata.get("general", "basename")
220 self.updatedFromGallery = False 220 self.updatedFromGallery = False
221 221
222 def writeUpdateManifest(self): 222 def writeUpdateManifest(self):
223 """ 223 """
224 Writes update.rdf file for the current build 224 Writes update.rdf file for the current build
225 """ 225 """
226 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) 226 if self.config.type == 'safari':
227 if not os.path.exists(baseDir):
228 os.makedirs(baseDir)
229 if self.config.type == 'chrome' or self.config.type == 'opera':
Sebastian Noack 2016/03/08 17:23:05 Update manifest aren't used for Chrome anymore, bu
230 manifestPath = os.path.join(baseDir, "updates.xml")
231 templateName = 'chromeUpdateManifest'
232 elif self.config.type == 'safari':
233 manifestPath = os.path.join(baseDir, "updates.plist") 227 manifestPath = os.path.join(baseDir, "updates.plist")
234 templateName = 'safariUpdateManifest' 228 templateName = 'safariUpdateManifest'
235 elif self.config.type == 'android': 229 elif self.config.type == 'android':
236 manifestPath = os.path.join(baseDir, "updates.xml") 230 manifestPath = os.path.join(baseDir, "updates.xml")
237 templateName = 'androidUpdateManifest' 231 templateName = 'androidUpdateManifest'
232 else:
233 return
238 234
239 # ABP for Android used to have its own update manifest format. We need to 235 baseDir = os.path.join(self.config.nightliesDirectory, self.basename)
240 # generate both that and the new one in the libadblockplus format as long 236 if not os.path.exists(baseDir):
241 # as a significant amount of users is on an old version. 237 os.makedirs(baseDir)
238
239 # ABP for Android used to have its own update manifest format. We need to
240 # generate both that and the new one in the libadblockplus format as long
241 # as a significant amount of users is on an old version.
242 if self.config.type == 'android':
242 newManifestPath = os.path.join(baseDir, "update.json") 243 newManifestPath = os.path.join(baseDir, "update.json")
243 writeAndroidUpdateManifest(newManifestPath, [{ 244 writeAndroidUpdateManifest(newManifestPath, [{
244 'basename': self.basename, 245 'basename': self.basename,
245 'version': self.version, 246 'version': self.version,
246 'updateURL': self.updateURL 247 'updateURL': self.updateURL
247 }]) 248 }])
248 else:
249 manifestPath = os.path.join(baseDir, "update.rdf")
Sebastian Noack 2016/03/08 17:23:05 Update manifests are also not used anymore for Fir
250 templateName = 'geckoUpdateManifest'
251 249
252 template = get_template(get_config().get('extensions', templateName)) 250 template = get_template(get_config().get('extensions', templateName))
253 template.stream({'extensions': [self]}).dump(manifestPath) 251 template.stream({'extensions': [self]}).dump(manifestPath)
254 252
255 def writeIEUpdateManifest(self, versions): 253 def writeIEUpdateManifest(self, versions):
256 """ 254 """
257 Writes update.json file for the latest IE build 255 Writes update.json file for the latest IE build
258 """ 256 """
259 if len(versions) == 0: 257 if len(versions) == 0:
260 return 258 return
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 except ConfigParser.NoOptionError: 300 except ConfigParser.NoOptionError:
303 port = '22' 301 port = '22'
304 buildCommand = ['ssh', '-p', port, get_config().get('extensions', 'andro idBuildHost')] 302 buildCommand = ['ssh', '-p', port, get_config().get('extensions', 'andro idBuildHost')]
305 buildCommand.extend(map(pipes.quote, ['/home/android/bin/makedebugbuild. py', '--revision', self.revision, '--version', self.version, '--stdout'])) 303 buildCommand.extend(map(pipes.quote, ['/home/android/bin/makedebugbuild. py', '--revision', self.revision, '--version', self.version, '--stdout']))
306 subprocess.check_call(buildCommand, stdout=apkFile, close_fds=True) 304 subprocess.check_call(buildCommand, stdout=apkFile, close_fds=True)
307 except: 305 except:
308 # clear broken output if any 306 # clear broken output if any
309 if os.path.exists(self.path): 307 if os.path.exists(self.path):
310 os.remove(self.path) 308 os.remove(self.path)
311 raise 309 raise
312 elif self.config.type == 'chrome' or self.config.type == 'opera': 310 elif self.config.type == 'chrome':
313 import buildtools.packagerChrome as packager 311 import buildtools.packagerChrome as packager
314 packager.createBuild(self.tempdir, type=self.config.type, outFile=self.pat h, buildNum=self.revision, keyFile=self.config.keyFile, experimentalAPI=self.con fig.experimental) 312 packager.createBuild(self.tempdir, type=self.config.type, outFile=self.pat h, buildNum=self.revision, keyFile=self.config.keyFile, experimentalAPI=self.con fig.experimental)
315 elif self.config.type == 'safari': 313 elif self.config.type == 'safari':
316 import buildtools.packagerSafari as packager 314 import buildtools.packagerSafari as packager
317 packager.createBuild(self.tempdir, type=self.config.type, outFile=self.pat h, buildNum=self.revision, keyFile=self.config.keyFile) 315 packager.createBuild(self.tempdir, type=self.config.type, outFile=self.pat h, buildNum=self.revision, keyFile=self.config.keyFile)
318 else: 316 else:
319 import buildtools.packagerGecko as packager 317 import buildtools.packagerGecko as packager
320 packager.createBuild(self.tempdir, outFile=self.path, buildNum=self.revisi on, keyFile=self.config.keyFile) 318 packager.createBuild(self.tempdir, outFile=self.path, buildNum=self.revisi on, keyFile=self.config.keyFile)
321 319
322 if not os.path.exists(self.path): 320 if not os.path.exists(self.path):
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 # We cannot build IE builds, simply list the builds already in 554 # We cannot build IE builds, simply list the builds already in
557 # the directory. Basename has to be deduced from the repository name. 555 # the directory. Basename has to be deduced from the repository name.
558 self.basename = os.path.basename(self.config.repository) 556 self.basename = os.path.basename(self.config.repository)
559 else: 557 else:
560 # copy the repository into a temporary directory 558 # copy the repository into a temporary directory
561 self.copyRepository() 559 self.copyRepository()
562 560
563 # get meta data from the repository 561 # get meta data from the repository
564 if self.config.type == 'android': 562 if self.config.type == 'android':
565 self.readAndroidMetadata() 563 self.readAndroidMetadata()
566 elif self.config.type == 'chrome' or self.config.type == 'opera': 564 elif self.config.type == 'chrome':
567 self.readChromeMetadata() 565 self.readChromeMetadata()
568 elif self.config.type == 'safari': 566 elif self.config.type == 'safari':
569 self.readSafariMetadata() 567 self.readSafariMetadata()
570 else: 568 else:
571 self.readGeckoMetadata() 569 self.readGeckoMetadata()
572 570
573 # create development build 571 # create development build
574 self.build() 572 self.build()
575 573
576 # write out changelog 574 # write out changelog
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 except Exception, ex: 621 except Exception, ex:
624 logging.error("The build for %s failed:", repo) 622 logging.error("The build for %s failed:", repo)
625 logging.exception(ex) 623 logging.exception(ex)
626 624
627 file = open(nightlyConfigFile, 'wb') 625 file = open(nightlyConfigFile, 'wb')
628 nightlyConfig.write(file) 626 nightlyConfig.write(file)
629 627
630 628
631 if __name__ == '__main__': 629 if __name__ == '__main__':
632 main() 630 main()
OLDNEW

Powered by Google App Engine
This is Rietveld