Bug 1236111 - part 4: actually add Windows support to artifact code, r=nalexander,gps

--HG--
extra : commitid : 6cE49rCkabN
extra : rebase_source : 00d203e5dfba88ad82d0b0dfad3e3e07d1cba84e
This commit is contained in:
Gijs Kruitbosch 2016-01-05 14:58:22 +00:00
Родитель e9063e1fa3
Коммит 06bd7d5a5b
2 изменённых файлов: 42 добавлений и 5 удалений

Просмотреть файл

@ -223,6 +223,32 @@ class MacArtifactJob(ArtifactJob):
pass
class WinArtifactJob(ArtifactJob):
def process_artifact(self, filename, processed_filename):
with JarWriter(file=processed_filename, optimize=False, compress_level=5) as writer:
prefix = 'firefox/'
whitelist = {
'dependentlibs.list',
'platform.ini',
'application.ini',
}
for f in JarReader(filename):
if not f.filename.startswith(prefix):
raise ValueError('Archive format changed! Filename should start with "firefox/"; was "{filename}"'.format(filename=f.filename))
basename = f.filename[len(prefix):]
if not basename.endswith('.dll') and \
not basename.endswith('.exe') and \
basename not in whitelist:
continue
self.log(logging.INFO, 'artifact',
{'basename': basename},
'Adding {basename} to processed archive')
writer.add(basename.encode('utf-8'), f)
# Keep the keys of this map in sync with the |mach artifact| --job options.
JOB_DETAILS = {
# 'android-api-9': (AndroidArtifactJob, 'public/build/fennec-(.*)\.android-arm\.apk'),
@ -231,6 +257,8 @@ JOB_DETAILS = {
# 'linux': (ArtifactJob, 'public/build/firefox-(.*)\.linux-i686\.tar\.bz2'),
# 'linux64': (ArtifactJob, 'public/build/firefox-(.*)\.linux-x86_64\.tar\.bz2'),
'macosx64': (MacArtifactJob, 'public/build/firefox-(.*)\.mac\.dmg'),
'win32': (WinArtifactJob, 'public/build/firefox-(.*)\.win32.zip'),
'win64': (WinArtifactJob, 'public/build/firefox-(.*)\.win64.zip'),
}
def get_job_details(job, log=None):
@ -344,7 +372,7 @@ class PushHeadCache(CacheManager):
def pushheads(self, tree, parent):
pushheads = subprocess.check_output([self._hg, 'log',
'--template', '{node}\n',
'-r', 'last(pushhead({tree}) and ::{parent}, {num})'.format(
'-r', 'last(pushhead("{tree}") and ::"{parent}", {num})'.format(
tree=tree, parent=parent, num=NUM_PUSHHEADS_TO_QUERY_PER_PARENT)])
pushheads = pushheads.strip().split('\n')
return pushheads

Просмотреть файл

@ -1397,10 +1397,17 @@ class MachDebug(MachCommandBase):
class ArtifactSubCommand(SubCommand):
def __call__(self, func):
after = SubCommand.__call__(self, func)
jobchoices = {
'android-api-11',
'android-x86',
'macosx64',
'win32',
'win64'
}
args = [
CommandArgument('--tree', metavar='TREE', type=str,
help='Firefox tree.'),
CommandArgument('--job', metavar='JOB', choices=['android-api-11', 'android-x86', 'macosx64'],
CommandArgument('--job', metavar='JOB', choices=jobchoices,
help='Build job.'),
CommandArgument('--verbose', '-v', action='store_true',
help='Print verbose output.'),
@ -1463,12 +1470,14 @@ class PackageFrontend(MachCommandBase):
return (tree, job)
if self.substs.get('MOZ_BUILD_APP', '') == 'mobile/android':
if self.substs['ANDROID_CPU_ARCH'] == 'x86':
return (tree, 'android-x86')
return (tree, 'android-api-11')
return tree, 'android-x86'
return tree, 'android-api-11'
if self.defines.get('XP_MACOSX', False):
# TODO: check for 64 bit builds. We'd like to use HAVE_64BIT_BUILD
# but that relies on the compile environment.
return (tree, 'macosx64')
return tree, 'macosx64'
if self.defines.get('XP_WIN', False):
return tree, 'win32'
raise Exception('Cannot determine default tree and job for |mach artifact|!')
@ArtifactSubCommand('artifact', 'install',