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

Unified Diff: sitescripts/extensions/bin/createNightlies.py

Issue 9044061: Nightly builds: prepared for the change in the Chrome build process (Closed)
Patch Set: Current build tools Created Dec. 29, 2012, 8:10 p.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 | « .hgsubstate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/extensions/bin/createNightlies.py
===================================================================
--- a/sitescripts/extensions/bin/createNightlies.py
+++ b/sitescripts/extensions/bin/createNightlies.py
@@ -82,17 +82,17 @@ class NightlyBuild(object):
date, author, revision, description = change.split('\0')
yield {'date': date, 'author': author, 'revision': revision, 'description': description}
def copyRepository(self):
'''
Create a repository copy in a temporary directory
'''
self.tempdir = tempfile.mkdtemp(prefix=self.config.repositoryName)
- command = ['hg', 'archive', '-R', self.config.repository, '-r', 'default', self.tempdir]
+ command = ['hg', 'archive', '-S', '-R', self.config.repository, '-r', 'default', self.tempdir]
subprocess.Popen(command).communicate()
def writeChangelog(self, changes):
"""
write the changelog file into the cloned repository
"""
baseDir = os.path.join(self.config.nightliesDirectory, self.basename)
if not os.path.exists(baseDir):
@@ -144,45 +144,42 @@ class NightlyBuild(object):
self.version = '%s.%s' % (self.version, self.revision)
usesSdk = manifest.getElementsByTagName('uses-sdk')[0]
self.minSdkVersion = usesSdk.attributes["android:minSdkVersion"].value
self.basename = os.path.basename(self.config.repository)
def readChromeMetadata(self):
"""
- Read Chrome-specific metadata from manifest.json file. It will also
+ Read Chrome-specific metadata from metadata file. This will also
calculate extension ID from the private key.
"""
# Calculate extension ID from public key
# (see http://supercollider.dk/2010/01/calculating-chrome-extension-id-from-your-private-key-233)
import buildtools.packagerChrome as packager
publicKey = packager.getPublicKey(self.config.keyFile)
hash = hashlib.sha256()
hash.update(publicKey)
self.extensionID = hash.hexdigest()[0:32]
self.extensionID = ''.join(map(lambda c: chr(97 + int(c, 16)), self.extensionID))
- # Now read manifest.json
- manifestFile = open(os.path.join(self.tempdir, 'manifest.json'), 'rb')
- manifest = json.load(manifestFile)
- manifestFile.close()
-
- self.version = manifest['version']
+ # Now read metadata file
+ metadata = packager.readMetadata(self.tempdir)
+ self.version = metadata.get("general", "version")
while self.version.count('.') < 2:
self.version += '.0'
self.version = '%s.%s' % (self.version, self.revision)
- self.basename = os.path.basename(self.config.repository)
+ self.basename = metadata.get("general", "basename")
if self.config.experimental:
self.basename += '-experimental'
self.compat = []
- if 'minimum_chrome_version' in manifest:
- self.compat.append({'id': 'chrome', 'minVersion': manifest['minimum_chrome_version']})
+ if metadata.has_section('compat') and metadata.has_option('compat', 'chrome'):
+ self.compat.append({'id': 'chrome', 'minVersion': metadata.get('compat', 'chrome')})
def writeUpdateManifest(self):
"""
Writes update.rdf file for the current build
"""
baseDir = os.path.join(self.config.nightliesDirectory, self.basename)
if not os.path.exists(baseDir):
os.makedirs(baseDir)
@@ -295,17 +292,17 @@ class NightlyBuild(object):
template = get_template(get_config().get('extensions', 'nightlyIndexPage'))
template.stream({'config': self.config, 'links': links}).dump(outputPath)
def updateDocs(self):
if not self.config.type == 'gecko':
return
docsdir = tempfile.mkdtemp(prefix='jsdoc')
- command = ['hg', 'archive', '-R', get_config().get('extensions', 'jsdocRepository'), '-r', 'default', docsdir]
+ command = ['hg', 'archive', '-S', '-R', get_config().get('extensions', 'jsdocRepository'), '-r', 'default', docsdir]
subprocess.Popen(command).communicate()
try:
outputPath = os.path.join(self.config.docsDirectory, self.basename)
command = ['perl', os.path.join(docsdir, 'jsrun.pl'),
'-t=' + os.path.join(docsdir, 'templates', 'jsdoc'),
'-d=' + outputPath,
'-a',
« no previous file with comments | « .hgsubstate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld