-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
98 lines (85 loc) · 2.2 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* assemble-less
* http://github.com/assemble/assemble-less
*
* Copyright (c) 2013 Assemble
* MIT License
*/
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
// Metadata for templates
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*\n' +
' * <%= pkg.name %> v<%= pkg.version %>\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' *\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= _.capitalize(pkg.author.name) %>\n' +
' * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n' +
' */\n'
},
variables: {
main: {
options: {
banner: '<%= meta.banner %>',
variables: grunt.file.readJSON('test/vars.json')
},
files: {
'tmp/main.less': ['test/fixtures/**/*.less']
}
},
bootstrap: {
options: {
variables: {
background: 'red',
margin: 0,
color: 'blue'
}
},
files: {
'tmp/bootstrap.less': ['test/fixtures/**/*.less']
}
},
overrides: {
options: {
banner: '<%= meta.banner %>',
variables: grunt.file.readJSON('test/vars.json')
},
files: {
'tmp/overrides.less': ['test/fixtures/**/*.less']
}
}
},
// Unit tests.
nodeunit: {
tests: ['test/*_test.js']
},
jshint: {
files: [
'Gruntfile.js',
'lib/**/*.js',
'tasks/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
// Clean out files from last run,
// before creating new ones.
clean: {
tests: { src: 'test/css/**/*.css' }
}
});
// Load npm plugins to provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// Default tasks to be run.
grunt.registerTask('default', ['jshint', 'clean', 'variables']);
// Tests to be run.
grunt.registerTask('test', ['default', 'nodeunit']);
};