defmodule VersionTasks do @moduledoc""" A set of Mix Tasks for managing your version numbers ## Information Tasks The following tasks just report back information about your project without actually changing it. Here's the basic usage MIX_QUIET=1 mix version. Notice the MIX_QUIET=1, can sometimes be important if you are using this within a `dev` environment where additional debugging output might be included The examples below will omit the `MIX_QUIET=1`for brevity, and as it isn't strictly required. ### mix version.current To retrieve the current version of your application, run mix version.current The call back returns the current version of your project, for example 1.2.3 This is based on your mix.exs file. ### mix version.next To retrieve the _next_ version of your application, run mix version.next ? The default increment step is patch, here are a few examples from the version above mix version.next 1.2.4 mix version.next patch 1.2.4 mix version.next minor 1.3.0 mix version.next major 2.0.0 ### mix version.name After an upgrade, you might want to trigger additional actions, such as run tests create a release and deploy an update. You can ask for the `name` of the version using: # For anything like X.0.0, that's a major release mix version.name major # For anything like X.Y.0, that's a minor release mix version.name minor # For all other releases, like X.Y.Z, that's a patch release mix version.name patch ## Local Editing Tasks The following tasks will edit your local files, but will not commit or push any of those changes. ### mix version.inc Increment your project to the next version, this will update your mix.exs AND your README.md file. mix version.inc ? Your `mix.exs` MUST HAVE a variable named as follows for this to work @version "1.2.3" This is the default is based on a template from [Dave Thomas](https://pragdave.me/) with his `mix gen