Bug 795769 - Add "bootstrap" command to mach; r=ted
authorGregory Szorc <gps@mozilla.com>
Wed, 10 Oct 2012 17:17:00 -0700
changeset 111889 c6ccd1d30c1541f4b855655aeb7f6c193bdb74b7
parent 111888 7a52ba9b15428708096c21d37d7eb1193c7edf83
child 111905 5bd5bb168eb1d25d43ad61dde8fed56d2a4346a9
child 111995 ff32bc769775544251c9a4e45977a0686e1f2860
child 112095 f9c735a139b1ecd59f94f59f56c37553d638fd3f
push id23780
push usergszorc@mozilla.com
push dateWed, 31 Oct 2012 21:24:08 +0000
treeherdermozilla-central@c6ccd1d30c15 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs795769
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 795769 - Add "bootstrap" command to mach; r=ted The command is currently just a proxy into mozboot. DONTBUILD (NPOTB)
mach
python/mozboot/mozboot/mach_commands.py
--- a/mach
+++ b/mach
@@ -15,16 +15,17 @@ import sys
 if sys.version_info[0] == 2 and sys.version_info[1] < 7:
     print('Python 2.7 or above is required to run mach.')
     print('You are running', platform.python_version())
     sys.exit(1)
 
 # TODO Bug 794506 Integrate with the in-tree virtualenv configuration.
 SEARCH_PATHS = [
     'python/mach',
+    'python/mozboot',
     'python/mozbuild',
     'build',
     'build/pymake',
     'python/blessings',
     'python/psutil',
     'python/which',
     'other-licenses/ply',
     'xpcom/idl-parser',
@@ -32,16 +33,17 @@ SEARCH_PATHS = [
     'testing/xpcshell',
     'testing/mozbase/mozprocess',
     'testing/mozbase/mozinfo',
 ]
 
 # Individual files providing mach commands.
 MACH_MODULES = [
     'layout/tools/reftest/mach_commands.py',
+    'python/mozboot/mozboot/mach_commands.py',
     'testing/mochitest/mach_commands.py',
     'testing/xpcshell/mach_commands.py',
 ]
 
 our_dir = os.path.dirname(os.path.abspath(__file__))
 
 try:
     import mach.main
new file mode 100644
--- /dev/null
+++ b/python/mozboot/mozboot/mach_commands.py
@@ -0,0 +1,23 @@
+# 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/.
+
+from __future__ import unicode_literals
+
+from mozbuild.base import MozbuildObject
+
+from mach.base import CommandArgument
+from mach.base import CommandProvider
+from mach.base import Command
+
+@CommandProvider
+class Bootstrap(MozbuildObject):
+    """Bootstrap system and mach for optimal development experience."""
+
+    @Command('bootstrap',
+        help='Install required system packages for building.')
+    def bootstrap(self):
+        from mozboot.bootstrap import Bootstrapper
+
+        bootstrapper = Bootstrapper()
+        bootstrapper.bootstrap()