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