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: add v1.1.0 #25374

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
18 changes: 6 additions & 12 deletions recipes/confu_json/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
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.1.0":
url: "https://github.com/werto87/confu_json/archive/refs/tags/v1.1.0.tar.gz"
sha256: "0a993543edfb41923bd4190c14b5c7a1f1e1062c539d42eadcead66959401929"
"1.0.1":
url: "https://github.com/werto87/confu_json/archive/refs/tags/v1.0.1.tar.gz"
sha256: "f109027dee5ca5b16829320a0e79615cd35167f4acef278204cd46932dd50af8"
51 changes: 15 additions & 36 deletions recipes/confu_json/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
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
import os

Expand All @@ -13,58 +12,40 @@
class ConfuJson(ConanFile):
name = "confu_json"
homepage = "https://github.com/werto87/confu_json"
description = "uses boost::fusion to help with serialization; json <-> user defined type"
topics = ("json parse", "serialization", "user defined type")
description = "Uses boost::fusion to help with serialization; json <-> user defined type"
topics = ("json", "serialization", "user-defined-type", "header-only")
license = "BSL-1.0"
url = "https://github.com/conan-io/conan-center-index"
package_type = "header-library"
settings = "os", "arch", "compiler", "build_type"
no_copy_source = True

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

@property
def _compilers_minimum_version(self):
return {
"17": {
"Visual Studio": "17",
"msvc": "193",
"gcc": "7",
"clang": "7",
},
"20": {
"Visual Studio": "17",
"msvc": "193",
"gcc": "10",
"clang": "10",
},
}.get(self._min_cppstd, {})
"Visual Studio": "17",
"msvc": "193",
"gcc": "10",
"clang": "10",
"apple-clang": "13",
}

def layout(self):
basic_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.85.0")
self.requires("magic_enum/0.9.6")

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")

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:
raise ConanInvalidConfiguration(
Expand All @@ -74,14 +55,12 @@ def validate(self):
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def build(self):
pass

def package(self):
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"))
copy(self, "LICENSE.md", self.source_folder, os.path.join(self.package_folder, "licenses"))
copy(self, "*.h*", os.path.join(self.source_folder, "confu_json"),
os.path.join(self.package_folder, "include", "confu_json"))

def package_info(self):
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
self.cpp_info.requires = ["boost::headers", "magic_enum::magic_enum"]
8 changes: 2 additions & 6 deletions recipes/confu_json/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
cmake_minimum_required(VERSION 3.12)
cmake_minimum_required(VERSION 3.15)
project(test_package LANGUAGES CXX)

find_package(confu_json REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE confu_json::confu_json)
if(confu_json_VERSION VERSION_LESS "1.0.0")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
else()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
endif()
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
8 changes: 2 additions & 6 deletions recipes/confu_json/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
versions:
"1.0.0":
"1.1.0":
folder: all
"0.0.10":
folder: all
"0.0.9":
folder: all
"0.0.5":
"1.0.1":
folder: all
Loading