From 7435df8399a9580441f3940b35543ee2933a7b12 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 23 Jan 2016 20:02:52 +0200 Subject: [PATCH] Moved backends to their own module. --- mesonbuild/backend/__init__.py | 0 mesonbuild/{ => backend}/backends.py | 10 +++++----- mesonbuild/{ => backend}/ninjabackend.py | 14 +++++++------- mesonbuild/{ => backend}/vs2010backend.py | 11 ++++++----- mesonbuild/{ => backend}/xcodebackend.py | 9 +++++---- mesonbuild/mesonmain.py | 6 +++--- 6 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 mesonbuild/backend/__init__.py rename mesonbuild/{ => backend}/backends.py (99%) rename mesonbuild/{ => backend}/ninjabackend.py (99%) rename mesonbuild/{ => backend}/vs2010backend.py (99%) rename mesonbuild/{ => backend}/xcodebackend.py (99%) diff --git a/mesonbuild/backend/__init__.py b/mesonbuild/backend/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/mesonbuild/backends.py b/mesonbuild/backend/backends.py similarity index 99% rename from mesonbuild/backends.py rename to mesonbuild/backend/backends.py index c583a7b11..cab3b8f1a 100644 --- a/mesonbuild/backends.py +++ b/mesonbuild/backend/backends.py @@ -1,4 +1,4 @@ -# Copyright 2012-2014 The Meson development team +# Copyright 2012-2016 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,11 +13,11 @@ # limitations under the License. import os, pickle, re -from . import build -from . import dependencies -from . import mesonlib +from .. import build +from .. import dependencies +from .. import mesonlib import json -from .coredata import MesonException +from ..coredata import MesonException class InstallData(): def __init__(self, source_dir, build_dir, prefix, depfixer): diff --git a/mesonbuild/ninjabackend.py b/mesonbuild/backend/ninjabackend.py similarity index 99% rename from mesonbuild/ninjabackend.py rename to mesonbuild/backend/ninjabackend.py index a15ac68c8..e748def6b 100644 --- a/mesonbuild/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -13,14 +13,14 @@ # limitations under the License. from . import backends -from . import environment, mesonlib -from . import build -from . import mlog -from . import dependencies -from .mesonlib import File +from .. import environment, mesonlib +from .. import build +from .. import mlog +from .. import dependencies +from ..mesonlib import File from .backends import InstallData -from .build import InvalidArguments -from .coredata import MesonException +from ..build import InvalidArguments +from ..coredata import MesonException import os, sys, pickle, re import subprocess, shutil diff --git a/mesonbuild/vs2010backend.py b/mesonbuild/backend/vs2010backend.py similarity index 99% rename from mesonbuild/vs2010backend.py rename to mesonbuild/backend/vs2010backend.py index 84bad40f7..c9fe09f71 100644 --- a/mesonbuild/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -1,4 +1,4 @@ -# Copyright 2014-2015 The Meson development team +# Copyright 2014-2016 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,12 +14,13 @@ import os, sys import pickle -from . import backends, build -from . import dependencies -from . import mlog +from . import backends +from .. import build +from .. import dependencies +from .. import mlog import xml.etree.ElementTree as ET import xml.dom.minidom -from .coredata import MesonException +from ..coredata import MesonException class RegenInfo(): def __init__(self, source_dir, build_dir, depfiles, solutionfile): diff --git a/mesonbuild/xcodebackend.py b/mesonbuild/backend/xcodebackend.py similarity index 99% rename from mesonbuild/xcodebackend.py rename to mesonbuild/backend/xcodebackend.py index 8ac3f67b4..d874be9e4 100644 --- a/mesonbuild/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -1,4 +1,4 @@ -# Copyright 2014 The Meson development team +# Copyright 2014-2016 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,11 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from . import backends, build -from . import mesonlib +from . import backends +from .. import build +from .. import mesonlib import uuid, os, sys -from .coredata import MesonException +from ..coredata import MesonException class XCodeBackend(backends.Backend): def __init__(self, build): diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 6317c95a0..5cca0a5b1 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -138,13 +138,13 @@ itself as required.''' mlog.log('Build type:', mlog.bold('native build')) b = build.Build(env) if self.options.backend == 'ninja': - from . import ninjabackend + from .backend import ninjabackend g = ninjabackend.NinjaBackend(b) elif self.options.backend == 'vs2010': - from . import vs2010backend + from .backend import vs2010backend g = vs2010backend.Vs2010Backend(b) elif self.options.backend == 'xcode': - from . import xcodebackend + from .backend import xcodebackend g = xcodebackend.XCodeBackend(b) else: raise RuntimeError('Unknown backend "%s".' % self.options.backend)