From bb0859d6c097912424e709618efcd5fae2f32bd8 Mon Sep 17 00:00:00 2001 From: Christian Kuster Date: Wed, 6 Apr 2016 21:47:38 +0200 Subject: [PATCH] Grunt file added --- Gruntfile.js | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 4 ++++ 2 files changed, 72 insertions(+) create mode 100644 Gruntfile.js diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..d713323 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,68 @@ +/** + * Grunt file for node-wifi-scanner + * + * Create a new bugfix version (x.y.++): + * grunt v:patch + * + * Create a new feature version (x.++.0) + * grunt v:minor + * + * Create a new major version (++.0.0) + * grunt v:major + * + * Created by kc on 06.04.16 + */ + +module.exports = function (grunt) { + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + + bump: { + options: { + files: ['package.json'], + updateConfigs: [], + commit: true, + commitMessage: 'New version added v%VERSION%', + commitFiles: ['-a'], + tagName: 'v%VERSION%', + tagMessage: 'Version %VERSION%', + push: true, + pushTo: 'git@github.com:ancasicolica/ZigBeeSiteSurvey.git', + gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d', + globalReplace: false, + prereleaseName: false, + regExp: false + } + }, + + zip: { + 'make': { + src: ['./**/**'], + dest: '../ZigBeeSiteSurvey_x.y.z_OS_.zip', + compression: 'DEFLATE' + } + }, + + compress: { + main: { + options: { + archive: 'dist/ZigBeeSiteSurvey-' + grunt.file.readJSON('package.json').version + '-Win-x64.zip' + }, + files: [{ + src: ['*.js', 'LICENSE', '*.json', 'node.exe', '*.md', 'lib/**', 'node_modules/**', 'public/**', 'routes/**', 'views/**'], + dest: 'ZigBeeSiteSurvey-' + grunt.file.readJSON('package.json').version + '-Win-x64' + }] + } + } + }); + + + grunt.loadNpmTasks('grunt-bump'); + grunt.loadNpmTasks('grunt-zip'); + grunt.loadNpmTasks('grunt-contrib-compress'); + grunt.registerTask('minify', ['concat', 'uglify:js']); + grunt.registerTask('v:patch', ['bump:patch']); + grunt.registerTask('v:minor', ['bump:minor']); + grunt.registerTask('v:major', ['bump:major']); + grunt.registerTask('make', ['zip:make']); +}; diff --git a/package.json b/package.json index 7a7957c..013bdd8 100644 --- a/package.json +++ b/package.json @@ -28,5 +28,9 @@ }, "dependencies": { "lodash": "4.8.1" + }, + "devDependencies": { + "grunt": "0.4.5", + "grunt-bump": "0.7.0" } }