Bug 1275437 - Added placeholder for Windows bootstrapper. r=gps

Created a WindowsBootstrapper class that raises a NotImplementedError when initialized.

As WindowsBootstrapper is implemented, set $MOZ_WINDOWS_BOOTSTRAP to '1' in your environment to test it.

Bootstrapper now detects if the system is being run on Windows, and if it is dispatches to the WindowsBootstrapper.

MozReview-Commit-ID: 3x6PDPuLtzs

--HG--
extra : rebase_source : 250232493a19f20cf3c2218618373cd9ae4b966f
This commit is contained in:
Nathan Hakkakzadeh 2016-05-25 16:32:09 -07:00
parent 4e10dcb863
commit 7bfde45213
2 changed files with 22 additions and 0 deletions

View File

@ -18,6 +18,7 @@ from mozboot.gentoo import GentooBootstrapper
from mozboot.osx import OSXBootstrapper
from mozboot.openbsd import OpenBSDBootstrapper
from mozboot.archlinux import ArchlinuxBootstrapper
from mozboot.windows import WindowsBootstrapper
APPLICATION_CHOICE = '''
Please choose the version of Firefox you want to build:
@ -139,6 +140,9 @@ class Bootstrapper(object):
args['version'] = platform.release()
args['flavor'] = platform.system()
elif sys.platform.startswith('win32') or sys.platform.startswith('msys'):
cls = WindowsBootstrapper
if cls is None:
raise NotImplementedError('Bootstrap support is not yet available '
'for your OS.')

View File

@ -0,0 +1,18 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
from mozboot.base import BaseBootstrapper
class WindowsBootstrapper(BaseBootstrapper):
'''Bootstrapper for msys2 based environments for building in Windows.'''
def __init__(self, **kwargs):
if 'MOZ_WINDOWS_BOOTSTRAP' not in os.environ or os.environ['MOZ_WINDOWS_BOOTSTRAP'] != '1':
raise NotImplementedError('Bootstrap support for Windows is under development. For now, use MozillaBuild '
'to set up a build environment on Windows. If you are testing Windows Bootstrap support, '
'try `export MOZ_WINDOWS_BOOTSTRAP=1`')
BaseBootstrapper.__init__(self, **kwargs)
raise NotImplementedError('Bootstrap support is not yet available for Windows. '
'For now, use MozillaBuild to set up a build environment on Windows.')