forked from jdewit/bootstrap-timepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grunt.js
132 lines (128 loc) · 3.36 KB
/
grunt.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*global module:false*/
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-jasmine-runner');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-reload');
grunt.initConfig({
meta: {
project: 'Bootstrap-Timepicker',
version: '0.1.0',
banner: '/*! <%= meta.project %> v<%= meta.version %> \n' +
'* http://jdewit.github.com/bootstrap-timepicker \n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> Joris de Wit \n' +
'* MIT License \n' +
'*/'
},
lint: {
files: ['js/bootstrap-timepicker.js', 'grunt.js', 'package.json', 'spec/js/*Spec.js']
},
less: {
development: {
options: {
paths: ['css']
},
files: {
'css/bootstrap-timepicker.css': 'less/*.less'
}
},
production: {
options: {
paths: ['css'],
yuicompress: true
},
files: {
'css/bootstrap-timepicker.min.css': ['less/*.less']
}
}
},
min: {
dist: {
src: ['<banner:meta.banner>','js/bootstrap-timepicker.js'],
dest: 'js/bootstrap-timepicker.min.js'
}
},
jshint: {
options: {
browser: true,
camelcase: true,
curly: true,
eqeqeq: true,
eqnull: true,
immed: true,
indent: 2,
latedef: true,
newcap: true,
noarg: true,
quotmark: true,
sub: true,
strict: true,
trailing: true,
undef: true,
unused: true,
white: false
},
globals: {
jQuery: true,
$: true,
expect: true,
it: true,
beforeEach: true,
afterEach: true,
describe: true,
loadFixtures: true,
console: true
}
},
uglify: {},
watch: {
master: {
files: ['spec/js/*Spec.js', 'js/bootstrap-timepicker.js'],
tasks: ['lint', 'jasmine'],
options: {
interrupt: true
}
},
ghPages: {
files: ['index.html'],
tasks: ['reload'],
options: {
interrupt: true
}
}
},
jasmine: {
src : ['spec/js/libs/jquery/jquery.min.js', 'spec/js/libs/bootstrap/js/bootstrap.min.js', 'spec/js/libs/autotype/index.js', 'js/bootstrap-timepicker.js'],
specs : 'spec/js/*Spec.js',
helpers : 'spec/js/helpers/*.js',
timeout : 100,
phantomjs : {
'ignore-ssl-errors' : true
}
},
reload: {
port: 3000,
proxy: {
host: 'localhost'
}
},
exec: {
dump: {
command: 'grunt lint; grunt min; grunt exec:deleteAssets; grunt less:production;'
},
copyAssets: {
command: 'git checkout gh-pages -q; git checkout master css/bootstrap-timepicker.min.css; git checkout master js/bootstrap-timepicker.min.js;'
},
deleteAssets: {
command: 'rm -rf css/bootstrap-timepicker.css; rm -rf css/bootstrap-timepicker.min.css; rm -rf js/bootstrap-timepicker.min.js;'
}
}
});
// Default task.
grunt.registerTask('default', 'watch:master');
grunt.registerTask('test', 'jasmine lint');
grunt.registerTask('dump', 'min less:production less:development');
grunt.registerTask('copy', 'exec:copyAssets');
};