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

confu_json version 1.0.1 #23940

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions recipes/confu_json/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
sources:
"1.0.0":
url: "https://github.com/werto87/confu_json/archive/refs/tags/v1.0.0.tar.gz"
sha256: "f165172220b440d37a7a8301e490cf791b3b25b0cc3f2a08b355609c5f777db0"
"0.0.10":
url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.10.tar.gz"
sha256: "b31aab1bce952c0dc0bfc1f955a7b88be5103350b5a5eee1a4586ccec0e51fc1"
"0.0.9":
url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.9.tar.gz"
sha256: "29b2940b939cb04f11fdab4964c86bcb23ac75c588550bf54048e024444d2718"
"0.0.5":
url: "https://github.com/werto87/confu_json/archive/refs/tags/v0.0.5.tar.gz"
sha256: "bc506d4b7836a7689b1c6a2d89bb0c3441f774c8f845fef79d85c71099df5bf9"
"1.0.1":
url: "https://github.com/werto87/confu_json/archive/refs/tags/v1.0.1.tar.gz"
sha256: "f109027dee5ca5b16829320a0e79615cd35167f4acef278204cd46932dd50af8"
31 changes: 13 additions & 18 deletions recipes/confu_json/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout
from conan.tools.microsoft import is_msvc
from conan.tools.scm import Version
from conan.tools.cmake import CMake, cmake_layout
import os

required_conan_version = ">=1.51.1"
Expand All @@ -19,11 +18,12 @@ class ConfuJson(ConanFile):
url = "https://github.com/conan-io/conan-center-index"
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
generators = "CMakeDeps", "CMakeToolchain"
no_copy_source = True

@property
def _min_cppstd(self):
return "20" if Version(self.version) < "1.0.0" else "17"
return "17"

@property
def _compilers_minimum_version(self):
Expand All @@ -43,30 +43,24 @@ def _compilers_minimum_version(self):
}.get(self._min_cppstd, {})
werto87 marked this conversation as resolved.
Show resolved Hide resolved

def layout(self):
basic_layout(self, src_folder="src")
cmake_layout(self, src_folder="src")

def requirements(self):
self.requires("boost/1.81.0")
self.requires("magic_enum/0.8.2")
self.requires("boost/1.84.0")
self.requires("magic_enum/[>=0.9.5 <10]")
werto87 marked this conversation as resolved.
Show resolved Hide resolved

def package_id(self):
self.info.clear()

def validate(self):
if self.settings.compiler == "apple-clang":
raise ConanInvalidConfiguration("apple-clang is not supported. Pull request welcome")

if self.settings.compiler == "gcc" and Version(self.version) < "1.0.0":
raise ConanInvalidConfiguration("gcc is only supported in versions greater than or equal 1.0.0.")

if is_msvc(self) and Version(self.version) < "0.0.9":
raise ConanInvalidConfiguration("Visual Studio is not supported in versions before confu_json/0.0.9")
raise ConanInvalidConfiguration("apple-clang is not supported. Pull request welcome. ")

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

minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
if minimum_version and Version(self.settings.compiler.version) < minimum_version:

if Version(self.settings.compiler.version) < self._min_cppstd:
raise ConanInvalidConfiguration(
f"{self.ref} requires C++{self._min_cppstd}, which your compiler does not support."
)
Expand All @@ -75,12 +69,13 @@ def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def build(self):
pass
cmake = CMake(self)
cmake.configure()

def package(self):
cmake = CMake(self)
cmake.install()
copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
copy(self, "*.h*", src=os.path.join(self.source_folder, "confu_json"),
dst=os.path.join(self.package_folder, "include", "confu_json"))

def package_info(self):
self.cpp_info.bindirs = []
Expand Down
8 changes: 1 addition & 7 deletions recipes/confu_json/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
versions:
"1.0.0":
folder: all
"0.0.10":
folder: all
"0.0.9":
folder: all
"0.0.5":
"1.0.1":
folder: all
Loading