1 |
|
2 | module.exports = function (grunt) {
|
3 | require('time-grunt')(grunt);
|
4 |
|
5 | grunt.initConfig({
|
6 | pkg: grunt.file.readJSON('package.json'),
|
7 | lineending: {
|
8 | index: {
|
9 | options: {
|
10 | eol: 'lf'
|
11 | },
|
12 | files: {
|
13 | 'index.js': 'index.js'
|
14 | }
|
15 | }
|
16 | },
|
17 | jshint: {
|
18 | options: {
|
19 | reporter: require('jshint-stylish'),
|
20 |
|
21 | ignores: [
|
22 | 'src/html-generation/assets/jquery-2.0.0.min.js',
|
23 | 'src/html-generation/assets/jquery.tooltipster.min.js',
|
24 | 'src/**/test/**/*.js',
|
25 | 'src/**/cover/**'
|
26 | ],
|
27 | '-W015': true,
|
28 | '-W084': true,
|
29 | '-W093': true
|
30 | },
|
31 | 'default': {
|
32 | src: [ 'index.js', 'src/**/*.js' ]
|
33 | }
|
34 | },
|
35 | jsonlint: {
|
36 | all: {
|
37 | src: ['*.json']
|
38 | }
|
39 | },
|
40 | complexity: {
|
41 | all: grunt.file.readJSON('complexity.json')
|
42 | },
|
43 | 'nice-package': {
|
44 | all: {
|
45 | options: {}
|
46 | }
|
47 | },
|
48 | readme: {
|
49 | options: {
|
50 | readme: './docs/README.tmpl.md',
|
51 | docs: '.',
|
52 | templates: './docs'
|
53 | }
|
54 | },
|
55 | |
56 |
|
57 |
|
58 | bump: {
|
59 | options: {
|
60 | commit: true,
|
61 | commitMessage: 'Release v%VERSION%',
|
62 | commitFiles: ['-a'],
|
63 | createTag: true,
|
64 | tagName: '%VERSION%',
|
65 | tagMessage: 'Version %VERSION%',
|
66 | push: true,
|
67 | pushTo: 'origin'
|
68 | }
|
69 | }
|
70 | });
|
71 |
|
72 | var plugins = require('matchdep').filterDev('grunt-*');
|
73 | plugins.forEach(grunt.loadNpmTasks);
|
74 |
|
75 | grunt.registerTask('pre-check', ['deps-ok', 'jsonlint',
|
76 | 'jshint', 'jshint-solid', 'nice-package', 'complexity']);
|
77 | grunt.registerTask('default', ['pre-check', 'lineending']);
|
78 | grunt.registerTask('release', ['bump-only:patch', 'readme', 'bump-commit']);
|
79 | };
|