corrade-nucleus-nucleons – Blame information for rev 20
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | /* jshint node: true */ |
2 | |||
3 | module.exports = function(grunt) { |
||
4 | "use strict"; |
||
5 | |||
6 | // Project configuration. |
||
7 | grunt.initConfig({ |
||
8 | |||
9 | // Metadata. |
||
10 | pkg: grunt.file.readJSON('package.json'), |
||
11 | banner: '/*!\n' + |
||
12 | ' * Validator v<%= pkg.version %> for Bootstrap 3, by @1000hz\n' + |
||
13 | ' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + |
||
14 | ' * Licensed under <%= _.pluck(pkg.licenses, "url").join(", ") %>\n' + |
||
15 | ' *\n' + |
||
16 | ' * https://github.com/1000hz/bootstrap-validator\n' + |
||
17 | ' */\n\n', |
||
18 | |||
19 | // Task configuration. |
||
20 | jshint: { |
||
21 | options: { |
||
22 | jshintrc: 'js/.jshintrc' |
||
23 | }, |
||
24 | gruntfile: { |
||
25 | src: 'Gruntfile.js' |
||
26 | }, |
||
27 | src: { |
||
28 | src: ['js/*.js'] |
||
29 | }, |
||
30 | test: { |
||
31 | src: ['js/tests/unit/*.js'] |
||
32 | } |
||
33 | }, |
||
34 | |||
35 | concat: { |
||
36 | options: { |
||
37 | banner: '<%= banner %>', |
||
38 | stripBanners: true |
||
39 | }, |
||
40 | dist: { |
||
41 | src: ['js/validator.js'], |
||
42 | dest: 'dist/validator.js' |
||
43 | } |
||
44 | }, |
||
45 | |||
46 | copy: { |
||
47 | docs: { |
||
48 | expand: true, |
||
49 | cwd: './dist', |
||
50 | src: '*', |
||
51 | dest: 'docs/dist' |
||
52 | } |
||
53 | }, |
||
54 | |||
55 | uglify: { |
||
56 | options: { |
||
57 | banner: '<%= banner %>', |
||
58 | report: 'min' |
||
59 | }, |
||
60 | min: { |
||
61 | src: ['js/validator.js'], |
||
62 | dest: 'dist/validator.min.js' |
||
63 | } |
||
64 | }, |
||
65 | |||
66 | qunit: { |
||
67 | options: { |
||
68 | inject: 'js/tests/unit/phantom.js' |
||
69 | }, |
||
70 | files: ['js/tests/*.html'] |
||
71 | }, |
||
72 | |||
73 | watch: { |
||
74 | src: { |
||
75 | files: '<%= jshint.src.src %>', |
||
76 | tasks: ['jshint:src', 'qunit'] |
||
77 | }, |
||
78 | test: { |
||
79 | files: '<%= jshint.test.src %>', |
||
80 | tasks: ['jshint:test', 'qunit'] |
||
81 | } |
||
82 | }, |
||
83 | |||
84 | jekyll: { |
||
85 | docs: {} |
||
86 | }, |
||
87 | |||
88 | validation: { |
||
89 | options: { |
||
90 | reset: true, |
||
91 | relaxerror: [ |
||
92 | "Bad value X-UA-Compatible for attribute http-equiv on element meta.", |
||
93 | "Element img is missing required attribute src." |
||
94 | ] |
||
95 | }, |
||
96 | files: { |
||
97 | src: ["_gh_pages/**/*.html"] |
||
98 | } |
||
99 | } |
||
100 | }); |
||
101 | |||
102 | |||
103 | // These plugins provide necessary tasks. |
||
104 | grunt.loadNpmTasks('grunt-contrib-concat'); |
||
105 | grunt.loadNpmTasks('grunt-contrib-copy'); |
||
106 | grunt.loadNpmTasks('grunt-contrib-jshint'); |
||
107 | grunt.loadNpmTasks('grunt-contrib-qunit'); |
||
108 | grunt.loadNpmTasks('grunt-contrib-uglify'); |
||
109 | grunt.loadNpmTasks('grunt-contrib-watch'); |
||
110 | grunt.loadNpmTasks('grunt-jekyll'); |
||
111 | grunt.loadNpmTasks('grunt-html-validation'); |
||
112 | grunt.loadNpmTasks('grunt-sed'); |
||
113 | |||
114 | // Docs HTML validation task |
||
115 | grunt.registerTask('validate-html', ['jekyll', 'validation']); |
||
116 | |||
117 | // Test task. |
||
118 | grunt.registerTask('test', ['jshint', 'qunit']); |
||
119 | |||
120 | // Docs distribution task. |
||
121 | grunt.registerTask('dist-docs', 'copy:docs'); |
||
122 | |||
123 | // Distribution task. |
||
124 | grunt.registerTask('dist', ['concat', 'uglify', 'dist-docs']); |
||
125 | |||
126 | // Default task. |
||
127 | grunt.registerTask('default', ['test', 'dist']); |
||
128 | |||
129 | // Version numbering task. |
||
130 | // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z |
||
131 | // This can be overzealous, so its changes should always be manually reviewed! |
||
132 | grunt.registerTask('change-version-number', ['sed']); |
||
133 | }; |