How to use the conan.packager.ConanMultiPackager function in conan

To help you get started, we’ve selected a few conan examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github conan-io / conan-package-tools / test / app_tests.py View on Github external
def setUp(self):
        self.runner = MockRunner()
        self.packager = ConanMultiPackager("--build missing -r conan.io",
                                           "lasote", "mychannel",
                                           runner=self.runner)
github conan-io / conan-package-tools / test / app_tests.py View on Github external
def testSerialize(self):
        self.packager.add({"os": "Windows", "compiler": "Visual Studio"},
                          {"option1": "value1", "option2": "value2"})

        serial = self.packager.serialize()
        self.assertEquals(serial, '{"username": "lasote", "builds": [[{"os": "Windows", "compiler": "Visual Studio"}, {"option2": "value2", "option1": "value1"}]], "args": "--build missing -r conan.io", "conan_pip_package": null, "channel": "mychannel", "docker_image": null}')
        mp = ConanMultiPackager.deserialize(serial, username="lasote")
        self.assertEqual(mp.conan_pip_package, None)

        self.packager.conan_pip_package = "conan==0.0.1rc7"
        serial = self.packager.serialize()
        mp = ConanMultiPackager.deserialize(serial, username="lasote")
        self.assertEqual(mp.conan_pip_package, "conan==0.0.1rc7")
github karasusan / OpenVDBForUnity / build.py View on Github external
import platform
from conan.packager import ConanMultiPackager

if __name__ == "__main__":
    builder = ConanMultiPackager()
    builder.add_common_builds(shared_option_name="OpenVDBNativePlugin:shared")

    # exclude packages that is dynamic library for Windows
    filtered_builds = []
    for settings, options, env_vars, build_requires, reference in builder.items:
        if platform.system() == "Windows" and not options["OpenVDBNativePlugin:shared"]:
            options["OpenVDBNativePlugin:shared"] = True
        if platform.system() != "Windows" and not options["OpenVDBNativePlugin:shared"]:
            continue
        filtered_builds.append([settings, options, env_vars, build_requires])
    builder.builds = filtered_builds
    builder.run()
github theodelrieu / conan-darwin-toolchain / build.py View on Github external
from conan.packager import ConanMultiPackager


if __name__ == "__main__":
    builder = ConanMultiPackager()
    builder.add(settings={"os": "Macos"})
    builder.add(settings={"os": "iOS", "os.version": "9.0"})
    builder.add(settings={"os": "watchOS", "os.version": "4.0"})
    builder.add(settings={"os": "tvOS", "os.version": "11.0"})
    builder.run()
github zhuhaow / libnekit / build.py View on Github external
from conan.packager import ConanMultiPackager

if __name__ == "__main__":
    builder = ConanMultiPackager()
    builder.add_common_builds(pure_c=False)
    builds = []
    for settings, options, env_vars, build_requires, reference in builder.items:
        settings["cppstd"] = 14
        builds.append([settings, options, env_vars, build_requires])
    builder.builds = builds
    builder.run()
github jonico / libzengithub / build.py View on Github external
from conan.packager import ConanMultiPackager
import platform


if __name__ == "__main__":
    builder = ConanMultiPackager(remotes=["https://api.bintray.com/conan/bincrafters/public-conan"], build_policy="missing")
    builder.add_common_builds(pure_c=True, shared_option_name="ZenGitHub:shared")
    builder.run()
github DEGoodmanWilson / luna / build.py View on Github external
# -*- coding: utf-8 -*-

from conan.packager import ConanMultiPackager
from bincrafters import build_shared

if __name__ == "__main__":
    name = build_shared.get_name_from_recipe()
    username, channel, version, login_username = build_shared.get_conan_vars()
    channel = channel or "unstable"
    is_unstable = (channel=="unstable")
    reference = "{0}/{1}".format(name, version)
    upload = "https://api.bintray.com/conan/{0}/opensource".format(username.lower())
    bincrafters = "https://api.bintray.com/conan/bincrafters/public-conan"
    vthiery = "https://api.bintray.com/conan/vthiery/conan-packages"

    builder = ConanMultiPackager(
        username=username,
        channel=channel,
        reference=reference,
        upload=upload,
        remotes=[upload, bincrafters, vthiery],
        upload_only_when_stable=is_unstable,
        # docker_entry_script='sudo apt-get -qq update && sudo apt-get -qq install -y curl',
        stable_branch_pattern="stable/*")

    builder.add_common_builds(shared_option_name=name + ":shared", pure_c=False)

    for build in builder.items:
        build.options["luna:build_luna_tests"] = True
        # TODO renable this at some point in the future
        # if os.getenv("GENERATE_COVERAGE") != None:
            # build.options["luna:build_luna_coverage"] = True
github silx-kit / hdf5plugin / src / c-blosc / build.py View on Github external
from conan.packager import ConanMultiPackager
import os

if __name__ == "__main__":
    version = os.getenv("TRAVIS_TAG") or os.getenv("APPVEYOR_REPO_TAG_NAME") or "dev"
    reference = "c-blosc/%s" % version
    upload = os.getenv("CONAN_UPLOAD") if (version != "dev") else False
    builder = ConanMultiPackager(reference=reference, upload=upload)
    builder.add_common_builds(shared_option_name="c-blosc:shared")
    builder.run()
github Dobiasd / FunctionalPlus / conan_build.py View on Github external
from conan.packager import ConanMultiPackager
import os

if __name__ == "__main__":
    if os.getenv("CXX") == "g++-7":
        version = os.getenv("TRAVIS_TAG")
        if not version:
            version = "dev"
        reference = "functionalplus/%s" % version
        username = "dobiasd"
        channel = "stable"
        upload_remote = "https://api.bintray.com/conan/dobiasd/public-conan" if version is not "dev" else None

        print("Conan package metadata:", reference, username, channel, upload_remote)

        builder = ConanMultiPackager(reference=reference,
                                    username=username,
                                    channel=channel,
                                    upload=upload_remote)
        builder.add(settings={
            'os': 'Linux',
            'compiler.version': '7',
            'compiler.libcxx': 'libstdc++11',
            'arch': 'x86_64',
            'build_type': 'Release',
            'compiler': 'gcc'
        })
        builder.run()
github conan-community / conan-boost / build.py View on Github external
from conan.packager import ConanMultiPackager
import copy
import os
import platform



if __name__ == "__main__":
    builder = ConanMultiPackager()

    if os.getenv("HEADER_ONLY"):

        builder.add({}, {"boost:header_only": True})
    else:
        builder.add_common_builds(shared_option_name="boost:shared", pure_c=False)

        if platform.system() == "Windows":
            filtered_builds = []
            for settings, options, env_vars, build_requires in builder.builds:

                # MinGW shared with linker errors. I don't have a clue
                if settings["compiler"] == "gcc" and options["boost:shared"] is True:
                    continue

                if ( ( settings["compiler"] == "Visual Studio" ) and ( int(settings["compiler.version"]) >= 14 ) ) and ( int(settings["compiler.version"]) <= 15 ):