From d7fdaa87602825225733575726ded88a7ec0fa50 Mon Sep 17 00:00:00 2001 From: Peter Moran Date: Thu, 19 Sep 2019 05:57:44 -0400 Subject: [PATCH 1/2] Allow conan's etl version metadata to automatically update via git tags (#150) --- conanfile.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/conanfile.py b/conanfile.py index ef713a36..79a6824d 100755 --- a/conanfile.py +++ b/conanfile.py @@ -1,18 +1,31 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +from conans import ConanFile, tools -from conans import ConanFile +def get_version_from_git_tag(): + """ + :returns: The git tag associated with the current commit, or None if it is not able to get the Git data. + + Returning None is necessary when the recipe is already in the Conan cache, and the Git repository may not be there. + A value of None makes Conan get the version from the metadata. + See: https://docs.conan.io/en/latest/howtos/capture_version.html + """ + try: + return tools.Git().get_tag() + except: + return None class EmbeddedTemplateLibraryConan(ConanFile): name = "embedded-template-library" - version = "14.28.2" + version = get_version_from_git_tag() license = "MIT" author = "John Wellbelove " url = "https://github.com/ETLCPP/etl" description = "A C++ template library for embedded applications" topics = ("embedded", "template", "container") - no_copy_source = True + + # Source info scm = { "type": "git", "url": "auto", From 188647667d3f78f4098d13ea5190d9f8cf7788d1 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 19 Sep 2019 10:59:53 +0100 Subject: [PATCH 2/2] Allow conan's etl version metadata to automatically update via git tags --- include/etl/version.h | 4 ++-- support/Release notes.txt | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/etl/version.h b/include/etl/version.h index 0b5561cd..3af0f196 100644 --- a/include/etl/version.h +++ b/include/etl/version.h @@ -38,8 +38,8 @@ SOFTWARE. ///\ingroup utilities #define ETL_VERSION_MAJOR 14 -#define ETL_VERSION_MINOR 29 -#define ETL_VERSION_PATCH 4 +#define ETL_VERSION_MINOR 30 +#define ETL_VERSION_PATCH 0 #define ETL_VERSION ETL_STRINGIFY(ETL_VERSION_MAJOR) ETL_STRINGIFY(ETL_VERSION_MINOR) ETL_STRINGIFY(ETL_VERSION_PATCH) #define ETL_VERSION_W ETL_WIDE_STRING(ETL_CONCAT(ETL_CONCAT(ETL_VERSION_MAJOR, ETL_VERSION_MINOR), ETL_VERSION_PATCH)) diff --git a/support/Release notes.txt b/support/Release notes.txt index 10c5c9dc..3c17f07e 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -1,3 +1,7 @@ +=============================================================================== +14.30.0 +Allow conan's etl version metadata to automatically update via git tags + =============================================================================== 14.29.4 Fixed unordered_map iterator operator* return type