-
Notifications
You must be signed in to change notification settings - Fork 72
/
Gruntfile.js
101 lines (87 loc) · 2.08 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
99
100
101
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
meta: {
banner: '/*\n' +
' * <%= pkg.title || pkg.name %> - v<%= pkg.version %>\n' +
' * <%= pkg.description %>\n' +
' * <%= pkg.homepage %>\n' +
' *\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %>\n' +
' * MIT License\n' +
' */\n'
},
bump: {
options: {
files: ['bower.json', 'github.jquery.json'],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['bower.json', 'github.jquery.json', 'dist'],
createTag: true,
tagName: '%VERSION%',
tagMessage: '',
push: true,
pushTo: 'origin'
}
},
concat: {
options: {
banner: '<%= meta.banner %>'
},
dist: {
src: ['src/jquery.github.js'],
dest: 'dist/jquery.github.js'
}
},
lintspaces: {
all: {
src: [
'*', 'src/*', 'spec/*', 'demo/*', 'assets/base.css', '!package.json'
],
options: {
newline: true,
trailingspaces: true,
indentation: 'tabs',
spaces: 2
}
}
},
jasmine: {
src: 'src/jquery.github.js',
options: {
specs: 'spec/*spec.js',
helpers: 'spec/helpers/*.js',
vendor: 'lib/jquery.min.js'
}
},
jshint: {
files: ['src/jquery.github.js'],
options: {
jshintrc: ".jshintrc"
}
},
uglify: {
options: {
banner: '<%= meta.banner %>'
},
my_target: {
src: ['dist/jquery.github.js'],
dest: 'dist/jquery.github.min.js'
}
},
watch: {
files: ['**/*'],
tasks: ['jshint', 'concat', 'uglify'],
}
});
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-lintspaces');
grunt.registerTask('default', ['lintspaces', 'jshint', 'concat', 'uglify']);
grunt.registerTask('release', ['bump-only:patch', 'default', 'bump-commit']);
grunt.registerTask('test', ['lintspaces', 'jshint', 'jasmine']);
};