From 9b198e67a79ebbca9f6abefeb72523b718eeb6ac Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Thu, 19 Dec 2019 15:48:35 +0100 Subject: [PATCH] Include git commit in conan version --- conanfile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/conanfile.py b/conanfile.py index 1c10183..8a5d65f 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,9 +1,8 @@ -from conans import ConanFile, CMake +from conans import ConanFile, CMake, tools class HelloConan(ConanFile): name = "CreatureLib" - version = "0.1" license = "TODO" url = "https://git.p-epsilon.com/Deukhoofd/CreatureLib" description = "The core implementation for turn based battling using creatures." @@ -13,6 +12,10 @@ class HelloConan(ConanFile): generators = "cmake" exports_sources = "*" + def set_version(self): + git = tools.Git(folder=self.recipe_folder) + self.version = "%s_%s" % (git.get_branch(), git.get_revision()) + def build(self): cmake = CMake(self) cmake.configure(source_folder=".")