forked from wmluke/angular-blocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
121 lines (114 loc) · 3.3 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
module.exports = function (grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
lifecycle: {
validate: [
'jshint'
],
compile: [],
test: [
'karma:phantom'
],
'package': [
'concat',
'uglify'
],
'integration-test': [],
verify: [],
install: [],
deploy: []
},
jshint: {
src: {
options: {
jshintrc: 'src/.jshintrc'
},
src: ['src/**/*.js']
},
test: {
options: {
jshintrc: 'test/.jshintrc'
},
src: ['test/**/*.js']
},
grunt: {
options: {
jshintrc: '.jshintrc'
},
src: ['Gruntfile.js']
}
},
karma: {
options: {
configFile: 'karma.conf.js'
},
unit: {
singleRun: true
},
phantom: {
singleRun: true,
browsers: ['PhantomJS']
},
debug: {
singleRun: false
}
},
concat: {
options: {
banner: ['/**! ',
' * <%= pkg.name %> v<%= pkg.version %>',
' * Copyright (c) 2013 <%= pkg.author.name %>. <%= pkg.homepage %>',
' * License: MIT',
' */\n'].join('\n')
},
scripts: {
src: [
'src/*.js'
],
dest: 'dist/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: ['/**! ',
' * <%= pkg.name %> v<%= pkg.version %>',
' * Copyright (c) 2013 <%= pkg.author.name %>. <%= pkg.homepage %>',
' * License: MIT',
' */\n'].join('\n')
},
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['<%= concat.scripts.dest %>']
}
}
},
regarde: {
scripts: {
files: ['src/**/*.js'],
tasks: ['concat', 'uglify']
}
},
bumpup: ['package.json', 'bower.json'],
exec: {
release_start: {
command: 'git flow release start <%= pkg.version %>'
},
release_finish: {
command: 'git flow release finish <%= pkg.version %>'
}
}
});
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('bump', function (type) {
type = type ? type : 'patch';
grunt.task.run('bumpup:' + type);
});
grunt.registerTask('test-phantom', ['karma:phantom']);
grunt.registerTask('test-start', ['karma:debug:start']);
grunt.registerTask('test-run', ['karma:debug:run']);
grunt.registerTask('build', ['install']);
grunt.registerTask('default', ['install']);
};