Grails Application Version Update Plugin

6 votes
Dependency:
compile ":version-update:1.2.0"

 Documentation  Source  Issues

Summary

Provides a more friendly way to update your application or plugin version.

Installation

As you don't need this plugin to be in your WAR file, you can use 'provided' scope in the dependency declaration (since Grails 2.x).

provided ":version-update:x.x.x"

Description

Why should you use it?

When you have a bunch of applications to maintain and each of them needs to update its version with every change, and you combine that with your useless memory… you end up following always the same process:

  1. Make your changes
  2. Start writing the grails set-version command
  3. Forget which the current version was
  4. Check the application.properties (or *GrailsPlugin.groovy for plugins) file to get the current version
  5. Go back to your command and finish writing it
  6. Execute the command
So, when you get tired of that, you create a plugin for doing a little less steps and your process becomes:
  1. Make your changes
  2. Execute the grails version-update command
  3. Drink your coffee

How do you use it?

grails version-update $param

The idea is that you write the least possible. So by convention, if you don't type any params, the plugin will increase the last level of your version by one.

In case you type a param, it can be the exact version you want or you can do some tricks using a simple notation. Lets imagine that your current version is 0.2.4.6 and you want to keep the 0, increase the 2, decrease the 4 and change the 6 to 1. The param you should type (for this extremely complicated version change) would be: x.+.-.1. Each char meaning, default values and configuration is explained below.

Lets think of some more common examples:

Old version:  0.2.4
Command:      grails version-update
New version:  0.2.5

Old version:  0.2.4
Command:      grails version-update x.+.x
New version:  0.3.4

Old version:  0.2.4
Command:      grails version-update +.+.0
New version:  1.3.0

Old version:  0.2.4
Command:      grails version-update 8.-.x
New version:  8.1.4

Also, starting from version 1.2.0 of this plugin, you can use shortcuts to increase major, minor or patch versions and reset or keep the other accordingly.

For example:

Old version:  1.2.4
Command:      grails version-update M
New version:  2.0.0

Old version:  1.2.4
Command:      grails version-update m
New version:  1.3.0

Old version:  1.2.4
Command:      grails version-update p
New version:  1.2.5

Need more information?

For more information about this plugin, please visit the GitHub page