-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathGruntfile.js
74 lines (58 loc) · 1.77 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
'use strict';
module.exports = function (grunt) {
require('time-grunt')(grunt);
require('jit-grunt')(grunt);
grunt.initConfig({
less: {
base: {
expand: true,
flatten: true,
src: 'test/less/*.less',
dest: 'test/tmp/css',
ext: '.css',
}
},
compare: {
src: '**/*.css',
dest: 'test/tmp/css',
cwd: 'test/css'
},
jshint: {
options: {
jshintrc: 'test/.jshintrc'
},
src: [
'lib/*.js',
'Gruntfile.js',
'test/compare.js'
],
},
clean: ['test/tmp']
});
grunt.registerTask('compare', require('./test/compare')(grunt));
var addLessTask = (function() {
var base = grunt.config('less.base'),
Plugin = require('../less-plugin-functions');
grunt.config.set('less.base', {});
return function(name, options) {
var task = 'less.' + name;
grunt.config.set(task, grunt.util
.recurse(base, function(value) {return value;}));
grunt.config.set(task + '.options.plugins', [new Plugin(options)]);
grunt.config.set(task + '.dest', base.dest + '/' + name);
};
})();
addLessTask('default', {});
addLessTask('globals-only', {globalsOnly: true});
addLessTask('always-override', {alwaysOverride: true});
grunt.registerTask('regression', [
'clean',
'less',
'compare'
]);
grunt.registerTask('test', [
'jshint',
'regression'
]);
grunt.registerTask('default', ['test']);
};