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