How to use the conan.build.BuilderSettings 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 taocpp / PEGTL / .conan / build.py View on Github external
def reference(self):
        """ Read project version from CMake file to create Conan referece
        """
        pattern = re.compile(r"project\(pegtl VERSION (\d+\.\d+\.\d+) LANGUAGES CXX\)")
        version = None
        with open('CMakeLists.txt') as file:
            for line in file:
                result = pattern.match(line)
                if result:
                    version = result.group(1)
        if not version:
            raise Exception("Could not find version in CMakeLists.txt")
        return os.getenv("CONAN_REFERENCE", "pegtl/{}@taocpp/stable".format(version))

if __name__ == "__main__":
    settings = BuilderSettings()
    builder = ConanMultiPackager(
        reference=settings.reference,
        username=settings.username,
        upload=settings.upload,
        upload_only_when_stable=settings.upload_only_when_stable,
        stable_branch_pattern=settings.stable_branch_pattern,
        test_folder=os.path.join(".conan", "test_package"))
    builder.add()
    builder.run()
github taocpp / sequences / .conan / build.py View on Github external
def reference(self):
        """ Read project version from CMake file to create Conan referece
        """
        pattern = re.compile(r"project \(taocpp-sequences VERSION (\d+\.\d+\.\d+) LANGUAGES CXX\)")
        version = None
        with open('CMakeLists.txt') as file:
            for line in file:
                result = pattern.match(line)
                if result:
                    version = result.group(1)
        if not version:
            raise Exception("Could not find version in CMakeLists.txt")
        return os.getenv("CONAN_REFERENCE", "sequences/{}@{}/{}".format(version, self.username, self.channel))

if __name__ == "__main__":
    settings = BuilderSettings()
    builder = ConanMultiPackager(
        reference=settings.reference,
        username=settings.username,
        upload=settings.upload,
        channel=settings.channel,
        upload_only_when_tag=settings.upload_only_when_tag,
        test_folder=os.path.join(".conan", "test_package"))
    builder.add()
    builder.run()
github civetweb / civetweb / conan / build.py View on Github external
    @property
    def version(self):
        regex = re.compile(self.stable_branch_pattern)
        match = regex.match(self.branch)
        if match:
            return match.group(1)
        return "latest"

    @property
    def reference(self):
        """ Read project version from branch name to create Conan referece
        """
        return os.getenv("CONAN_REFERENCE", "civetweb/{}".format(self.version))

if __name__ == "__main__":
    settings = BuilderSettings()
    builder = ConanMultiPackager(
        reference=settings.reference,
        username=settings.username,
        upload=settings.upload,
        upload_only_when_stable=settings.upload_only_when_stable,
        stable_branch_pattern=settings.stable_branch_pattern,
        test_folder=os.path.join("conan", "test_package"))
    builder.add_common_builds(pure_c=False)
    builder.run()
github taocpp / operators / .conan / build.py View on Github external
def reference(self):
        """ Read project version from CMake file to create Conan referece
        """
        pattern = re.compile(r"project\(taocpp-operators VERSION (\d+\.\d+\.\d+) LANGUAGES CXX\)")
        version = None
        with open('CMakeLists.txt') as file:
            for line in file:
                result = pattern.match(line)
                if result:
                    version = result.group(1)
        if not version:
            raise Exception("Could not find version in CMakeLists.txt")
        return os.getenv("CONAN_REFERENCE", "operators/{}@taocpp/stable".format(version))

if __name__ == "__main__":
    settings = BuilderSettings()
    builder = ConanMultiPackager(
        reference=settings.reference,
        username=settings.username,
        upload=settings.upload,
        upload_only_when_stable=settings.upload_only_when_stable,
        stable_branch_pattern=settings.stable_branch_pattern,
        test_folder=os.path.join(".conan", "test_package"))
    builder.add()
    builder.run()
github tcbrindle / NanoRange / .conan / build.py View on Github external
def channel(self):
        """ Default Conan package channel when not stable
        """
        return os.getenv("CONAN_CHANNEL", "testing")

    @property
    def _branch(self):
        """ Get branch name from CI manager
        """
        printer = Printer(None)
        ci_manager = CIManager(printer)
        return ci_manager.get_branch()


if __name__ == "__main__":
    settings = BuilderSettings()
    builder = ConanMultiPackager(
        channel=settings.channel,
        upload=settings.upload,
        upload_only_when_stable=settings.upload_only_when_stable,
        stable_branch_pattern=settings.stable_branch_pattern,
        login_username=settings.login_username,
        username=settings.username,
        test_folder=os.path.join(".conan", "test_package"))
    builder.add()
    builder.run()
github catchorg / Catch2 / .conan / build.py View on Github external
result = pattern.search(line)
                if result:
                    version = result.group(1)
        return version

    @property
    def _branch(self):
        """ Get branch name from CI manager
        """
        printer = Printer(None)
        ci_manager = CIManager(printer)
        return ci_manager.get_branch()


if __name__ == "__main__":
    settings = BuilderSettings()
    builder = ConanMultiPackager(
        reference=settings.reference,
        channel=settings.channel,
        upload=settings.upload,
        upload_only_when_stable=settings.upload_only_when_stable,
        stable_branch_pattern=settings.stable_branch_pattern,
        login_username=settings.login_username,
        username=settings.username,
        test_folder=os.path.join(".conan", "test_package"))
    builder.add()
    builder.run()
github taocpp / json / .conan / build.py View on Github external
def reference(self):
        """ Read project version from CMake file to create Conan referece
        """
        pattern = re.compile(r"project \(taocpp-json VERSION (\d+\.\d+\.\d+) LANGUAGES CXX\)")
        version = None
        with open('CMakeLists.txt') as file:
            for line in file:
                result = pattern.match(line)
                if result:
                    version = result.group(1)
        if not version:
            raise Exception("Could not find version in CMakeLists.txt")
        return os.getenv("CONAN_REFERENCE", "json/{}".format(version))

if __name__ == "__main__":
    settings = BuilderSettings()
    builder = ConanMultiPackager(
        reference=settings.reference,
        username=settings.username,
        upload=settings.upload,
        upload_only_when_stable=settings.upload_only_when_stable,
        stable_branch_pattern=settings.stable_branch_pattern,
        test_folder=os.path.join(".conan", "test_package"))
    builder.add()
    builder.run()