Ejemplo n.º 1
0
    def __init__(self, output, runner, display_name="", user=None, channel=None):
        # an output stream (writeln, info, warn error)
        self.output = ScopedOutput(display_name, output)
        self.display_name = display_name
        # something that can run commands, as os.sytem
        self._conan_runner = runner
        self._conan_user = user
        self._conan_channel = channel

        self.compatible_packages = []
        self._conan_using_build_profile = False
        self._conan_requester = None
        from conan.tools.env import Environment
        self.buildenv_info = Environment()
        self.runenv_info = Environment()
        # At the moment only for build_requires, others will be ignored
        self.conf_info = Conf()
        self._conan_buildenv = None  # The profile buildenv, will be assigned initialize()
        self._conan_node = None  # access to container Node object, to access info, context, deps...
        self._conan_new_cpp_info = None   # Will be calculated lazy in the getter
        self._conan_dependencies = None

        self.env_scripts = {}  # Accumulate the env scripts generated in order

        # layout() method related variables:
        self.folders = Folders()
        self.cpp = Infos()

        self.cpp.package.includedirs = ["include"]
        self.cpp.package.libdirs = ["lib"]
        self.cpp.package.bindirs = ["bin"]
        self.cpp.package.resdirs = ["res"]
        self.cpp.package.builddirs = [""]
        self.cpp.package.frameworkdirs = ["Frameworks"]
Ejemplo n.º 2
0
 def __init__(self, shared=None, options=None, options_values=None):
     options = options or ""
     self.command = None
     self.path = None
     self.settings = None
     self.options = Options(PackageOptions.loads(options))
     if options_values:
         for var, value in options_values.items():
             self.options._data[var] = value
     self.deps_cpp_info = MockDepsCppInfo(
     )  # ("deps_cpp_info", "sysroot")("/path/to/sysroot")
     self.deps_cpp_info.sysroot = "/path/to/sysroot"
     self.output = TestBufferConanOutput()
     self.in_local_cache = False
     if shared is not None:
         self.options = namedtuple("options", "shared")(shared)
     self.should_configure = True
     self.should_build = True
     self.should_install = True
     self.should_test = True
     self.generators = []
     self.captured_env = {}
     self.deps_env_info = DepsEnvInfo()
     self.env_info = EnvInfo()
     self.deps_user_info = DepsUserInfo()
     self._conan_env_values = EnvValues()
     self.folders = Folders()
     self.folders.set_base_source(".")
     self.folders.set_base_export_sources(".")
     self.folders.set_base_build(".")
     self.folders.set_base_install("myinstallfolder")
     self.folders.set_base_generators(".")
     self._conan_user = None
     self._conan_channel = None
     self.env_scripts = {}
     self.win_bash = None
     self.conf = ConfDefinition().get_conanfile_conf(None)
     self.cpp = Infos()