Provides a more friendly way to update your application or plugin version.
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).
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:
- Make your changes
- Start writing the grails set-version command
- Forget which the current version was
- Check the application.properties (or *GrailsPlugin.groovy for plugins) file to get the current version
- Go back to your command and finish writing it
- Execute the command
- Make your changes
- Execute the grails version-update command
- Drink your coffee
How do you use it?
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:
grails version-update $param
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
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 values accordingly. Also, from version 1.5.0 of this plugin, there is a shortcut for combining these with the SNAPSHOT label.For example:
Old version: 0.2.4 Command: grails version-update 8.-.x New version: 8.1.4
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
Old version: 1.2.4 Command: grails version-update p s New version: 1.2.5-SNAPSHOT