Skip to content

Commit

Permalink
v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bigerl authored Feb 9, 2023
2 parents d3ce92e + 4eb397a commit 2c63869
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/conan_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ jobs:
run: |
VERSION=$(conan inspect . --raw version)
echo "$VERSION"
conan remove "$(conan inspect . --raw name)/$(conan inspect . --raw version)@dice-group/stable" -r dice-group -f
conan upload "$(conan inspect . --raw name)/$(conan inspect . --raw version)@dice-group/stable" --force --all -r dice-group
conan remove "$(conan inspect . --raw name)/$(conan inspect . --raw version)" -r dice-group -f
conan upload "$(conan inspect . --raw name)/$(conan inspect . --raw version)" --force --all -r dice-group
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)

project(
dice-hash
VERSION 0.4.0
VERSION 0.4.1
DESCRIPTION "dice-hash provides a framework to generate stable hashes. It provides state-of-the-art hash functions, supports STL containers out of the box and helps you to defines stable hashes for your own structs and classes."
HOMEPAGE_URL "https://dice-group.github.io/dice-hash/")

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ To use it with [conan](https://conan.io/) you need to add the repository:
conan remote add dice-group https://conan.dice-research.org/artifactory/api/conan/tentris
```

To use it add `dice-hash/0.4.0@dice-group/stable` to the `[requires]` section of your conan file.
To use it add `dice-hash/0.4.1` to the `[requires]` section of your conan file.

## build and run tests

Expand Down
39 changes: 22 additions & 17 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import re, os
from conans.tools import load
from conans import ConanFile, CMake, tools
from conans.util.files import rmdir

from conan import ConanFile
from conan.tools.cmake import CMake
from conan.tools.files import load, rmdir, copy


class DiceHashConan(ConanFile):
Expand All @@ -11,7 +12,7 @@ class DiceHashConan(ConanFile):
url = homepage
topics = ("hash", "wyhash", "xxh3", "robin-hood-hash", "C++", "C++20")
settings = "build_type", "compiler", "os", "arch"
generators = "cmake", "cmake_find_package", "cmake_paths"
generators = ("CMakeDeps", "CMakeToolchain")
exports = "LICENSE"
exports_sources = "include/*", "CMakeLists.txt", "cmake/*", "LICENSE"
no_copy_source = True
Expand All @@ -20,35 +21,39 @@ class DiceHashConan(ConanFile):

def set_name(self):
if not hasattr(self, 'name') or self.version is None:
cmake_file = load(os.path.join(self.recipe_folder, "CMakeLists.txt"))
cmake_file = load(self, os.path.join(self.recipe_folder, "CMakeLists.txt"))
self.name = re.search(r"project\(\s*([a-z\-]+)\s+VERSION", cmake_file).group(1)

def set_version(self):
if not hasattr(self, 'version') or self.version is None:
cmake_file = load(os.path.join(self.recipe_folder, "CMakeLists.txt"))
cmake_file = load(self, os.path.join(self.recipe_folder, "CMakeLists.txt"))
self.version = re.search(r"project\([^)]*VERSION\s+(\d+\.\d+.\d+)[^)]*\)", cmake_file).group(1)
if not hasattr(self, 'description') or self.description is None:
cmake_file = load(os.path.join(self.recipe_folder, "CMakeLists.txt"))
cmake_file = load(self, os.path.join(self.recipe_folder, "CMakeLists.txt"))
self.description = re.search(r"project\([^)]*DESCRIPTION\s+\"([^\"]+)\"[^)]*\)", cmake_file).group(1)

def set_version(self):
if not hasattr(self, 'version') or self.version is None:
cmake_file = load(os.path.join(self.recipe_folder, "CMakeLists.txt"))
cmake_file = load(self, os.path.join(self.recipe_folder, "CMakeLists.txt"))
self.version = re.search(r"project\([^)]*VERSION\s+(\d+\.\d+.\d+)[^)]*\)", cmake_file).group(1)

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

_cmake = None

def _configure_cmake(self):
if self._cmake:
return self._cmake
self._cmake = CMake(self)
self._cmake.configure()
return self._cmake

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

def package(self):
cmake = CMake(self)
cmake.configure()
cmake.install()
self._configure_cmake().install()
for dir in ("lib", "res", "share"):
rmdir(os.path.join(self.package_folder, dir))
self.copy(pattern="LICENSE*", dst="licenses", src=self.folders.source_folder)

rmdir(self, os.path.join(self.package_folder, dir))
copy(self, pattern="LICENSE*", dst="licenses", src=self.folders.source_folder)

0 comments on commit 2c63869

Please sign in to comment.