Grunt plugin to bump the version entry inside an assembly info file
This plugin requires Grunt ~0.4.4
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-bump-assemblyinfo --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-bump-assemblyinfo');
In your project's Gruntfile, add a section named bump_assemblyinfo
to the data object passed into grunt.initConfig()
.
bump_assemblyinfo: {
sharedAssembly: {
options: { },
src: "./pathToFile/AssemblyInfo.cs",
dest: "./pathToFile/AssemblyInfo.out.cs",
}
},
Type: String
Default value: ''
The hard wired version number to use.
Type: Boolean
Default value: true
A flag to determine if the version should be taken from the package.json file. If this value is true the version option will be ignored.
Type: String
Default value: ./package.json
A path and file name of the package.json file which contains the version to use for the bump. If this file path and name is not correct an error will be thrown.
Type: String Array
Default value: ['AssemblyVersion','AssemblyFileVersion']
A set of values that will be searched for inside the assembly file. The deafaults should always work, but you can add your own if you like.
In this example, the default options and will update the version values in the files
grunt.initConfig({
bump_assemblyinfo: {
sharedAssembly: {
options: { },
src: "./pathToFile/AssemblyInfo.cs",
dest: "./pathToFile/AssemblyInfo.out.cs",
}
},
});
In this example, we going turn off the use of the package.json version and supply the version directly.
grunt.initConfig({
bump_assemblyinfo: {
sharedAssembly: {
options: {
usePackageVersion: false,
version: "2.2.3.4"
},
src: "./test/files/AssemblyInfo.cs",
dest: "./test/files/AssemblyInfo.out.cs",
}
},
});
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)