Bug 794509 - Part 2: Move mach command modules into a mach.commands sub-module; r=jhammel
authorGregory Szorc <gps@mozilla.com>
Fri, 05 Oct 2012 12:13:18 -0700
changeset 109361 d04782dc009156e114f27da3a468321a99edc47b
parent 109360 15c2bcb1a982e748f9f88be3976096cf5d31b07c
child 109362 533f124453a058598ca736065ff277a1146385f0
push id1145
push userpastithas@mozilla.com
push dateMon, 08 Oct 2012 14:21:16 +0000
treeherderfx-team@e7f2e2c944b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhammel
bugs794509
milestone18.0a1
Bug 794509 - Part 2: Move mach command modules into a mach.commands sub-module; r=jhammel This patch on its own will break mach. Part 3 will refactor mach's loader to discover and load modules using a modified module finding method.
mach
python/mach/mach/build.py
python/mach/mach/commands/__init__.py
python/mach/mach/commands/settings.py
python/mach/mach/main.py
python/mach/mach/settings.py
python/mach/mach/testing.py
python/mach/mach/warnings.py
python/mozbuild/mach/__init__.py
python/mozbuild/mach/commands/__init__.py
python/mozbuild/mach/commands/build.py
python/mozbuild/mach/commands/testing.py
python/mozbuild/mach/commands/warnings.py
python/mozbuild/setup.py
--- a/mach
+++ b/mach
@@ -33,16 +33,15 @@ SEARCH_PATHS = [
     'testing/mozbase/mozinfo',
 ]
 
 our_dir = os.path.dirname(os.path.abspath(__file__))
 
 try:
     import mach.main
 except ImportError:
-    SEARCH_PATHS.reverse()
     sys.path[0:0] = [os.path.join(our_dir, path) for path in SEARCH_PATHS]
 
     import mach.main
 
 # All of the code is in a module because EVERYTHING IS A LIBRARY.
 mach = mach.main.Mach(our_dir)
 sys.exit(mach.run(sys.argv[1:]))
new file mode 100644
rename from python/mach/mach/settings.py
rename to python/mach/mach/commands/settings.py
--- a/python/mach/mach/main.py
+++ b/python/mach/mach/main.py
@@ -17,21 +17,20 @@ from mozbuild.base import BuildConfig
 from mozbuild.config import ConfigSettings
 from mozbuild.logger import LoggingManager
 
 from mach.registrar import populate_argument_parser
 
 # Import sub-command modules
 # TODO Bug 794509 do this via auto-discovery. Update README once this is
 # done.
-from mach.build import Build
-from mach.settings import Settings
-from mach.testing import Testing
-from mach.warnings import Warnings
-
+from mach.commands.build import Build
+from mach.commands.settings import Settings
+from mach.commands.testing import Testing
+from mach.commands.warnings import Warnings
 
 # Classes inheriting from ConfigProvider that provide settings.
 # TODO this should come from auto-discovery somehow.
 SETTINGS_PROVIDERS = [
     BuildConfig,
 ]
 
 # Settings for argument parser that don't get proxied to sub-module. i.e. these
new file mode 100644
new file mode 100644
rename from python/mach/mach/build.py
rename to python/mozbuild/mach/commands/build.py
rename from python/mach/mach/testing.py
rename to python/mozbuild/mach/commands/testing.py
rename from python/mach/mach/warnings.py
rename to python/mozbuild/mach/commands/warnings.py
--- a/python/mozbuild/setup.py
+++ b/python/mozbuild/setup.py
@@ -5,11 +5,11 @@
 from setuptools import setup
 
 VERSION = '0.1'
 
 setup(
     name='mozbuild',
     description='Mozilla build system functionality.',
     license='MPL 2.0',
-    packages=['mozbuild'],
+    packages=['mach', 'mozbuild'],
     version=VERSION
 )