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

[feature] Better set_version example in documentation #1920

Open
1 task done
klimkin opened this issue Nov 10, 2020 · 1 comment
Open
1 task done

[feature] Better set_version example in documentation #1920

klimkin opened this issue Nov 10, 2020 · 1 comment
Assignees

Comments

@klimkin
Copy link

klimkin commented Nov 10, 2020

It would be nice to have a set_version example in the documentation that promotes semver tags. This also matches version convention supported by CMake:

project(<PROJECT-NAME>
        [VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]
    def set_version(self):
        """ Set version from last Git tag v<major>.<minor>.<patch>.
        Extra commits on top of the tag add .<tweak> number for the final version.
        """
        git = tools.Git(folder=self.recipe_folder)
        tag = git.run('describe --match v*')
        m_release = re.search(r'v(\d+.\d+.\d+)', tag)
        m_develop = re.search(r'-(\d+)', tag)
        self.version = m_release.group(1)
        if m_develop:
            self.version += '.' + m_develop.group(1)
@memsharded
Copy link
Member

This seems a useful example, moving this to the docs repository.

@memsharded memsharded transferred this issue from conan-io/conan Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants