Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7bitdi: add version 3.3.0 #23964

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions recipes/7bitdi/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"3.3.0":
url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.3.0.tar.gz"
sha256: "b9ddb2fc263c79cb414544e97d44dcc8cd1e1a91b38129d96b7051728a4583b9"
"3.2.0":
url: "https://github.com/7bitcoder/7bitDI/archive/refs/tags/v3.2.0.tar.gz"
sha256: "4549b651a28b309a31cb3b879b7f31069cbca041cfb9ffad82ccc26f78b8e5e0"
Expand Down
17 changes: 10 additions & 7 deletions recipes/7bitdi/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout

Check warning on line 4 in recipes/7bitdi/all/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

Unused CMakeDeps imported from conan.tools.cmake
from conan.tools.files import get, copy, rmdir
from conan.tools.scm import Version
import os

required_conan_version = ">=1.53.0"


class SevenBitDIConan(ConanFile):
name = "7bitdi"
description = "a simple C++ dependency injection library."
license = "MIT"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://github.com/7bitcoder/7bitDI"
description = "7bitDI is a simple C++ dependency injection library."
topics = ("cpp17", "dependency-injector", "injector", "header-only")
url = "https://github.com/conan-io/conan-center-index"
license = "MIT"
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
options = {
Expand All @@ -29,6 +28,10 @@
"fPIC": True,
}

@property
def _min_cppstd(self):
return 17

@property
def _minimum_compilers_version(self):
return {
Expand All @@ -48,6 +51,7 @@
self.options.rm_safe("fPIC")
if self.options.header_only:
self.options.rm_safe("shared")
self.package_type = "header-library"
jcar87 marked this conversation as resolved.
Show resolved Hide resolved

def layout(self):
cmake_layout(self, src_folder="src")
Expand All @@ -61,12 +65,11 @@
compiler_name = str(compiler)

if compiler.get_safe("cppstd"):
check_min_cppstd(self, 17)

check_min_cppstd(self, self._min_cppstd)
minimum_version = self._minimum_compilers_version.get(compiler_name, False)
if minimum_version and Version(compiler.version) < minimum_version:
raise ConanInvalidConfiguration(
f"Requires compiler {compiler_name} minimum version: {minimum_version} with C++17 support."
f"{self.ref} requires compiler {compiler_name} minimum version: {minimum_version} with C++{self._min_cppstd} support."
)

def source(self):
Expand Down
2 changes: 2 additions & 0 deletions recipes/7bitdi/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"3.3.0":
folder: all
"3.2.0":
folder: all
"3.1.0":
Expand Down