Plugin for managing applications version (release, snapshot), based on git branch.
This plugin adds "-SNAPSHOT" suffix to given 'version'* if it is called from any other branch than 'release branch'*.
*version and release branch should be defined in plugin options
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-version-manager --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-version-manager');
In your project's Gruntfile, add a section named version_manager
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
version_manager: {
options: {
// Task-specific options go here.
}
}
});
Only two options are required - 'branch' and 'version'. You can add any other string options. They will be displayed with 'version' on the stdout.
Type: String
Default value: master
A string value that describes release branch.
Type: String
Default value: 0.0.0
A string value that describes version of your project.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
version_manager: {
options: {
branch: 'master',
version: '<%= pkg.version %>'
}
}
});
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
version_manager: {
options: {
branch: 'master',
version: '<%= pkg.version %>',
desc: 'some description',
author: 'some author'
}
}
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
(Nothing yet)