-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathGruntfile.js
103 lines (91 loc) · 3.16 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
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner: '// <%= pkg.name %> Version <%= pkg.version %> \n' +
'// Last built <%= grunt.template.today("yyyy-mm-dd") %>\n' +
'// Distributed Under MIT License\n' +
'// (c) 2013 Bart Wood \n\n',
// This file set is pretty small, I don't need anything fancy for dependencies like requireJS - especially if
// it forces people to include yet another library just to use Kojak.
// The order here is important. Don't change it.
sourceFiles: [
'src/contains_shim.js',
'src/Core.js',
'src/Config.js',
'src/Formatter.js',
'src/FunctionProfile.js',
'src/Instrumentor.js',
'src/NetProfile.js',
'src/NetProfileCall.js',
'src/NetWatcher.js',
'src/Report.js',
'src/Start.js'
],
jasmine: {
core: {
src: 'src/Core.js',
options: {
specs: 'spec/unit/CoreSpec.js'
}
},
config: {
src: ['src/Core.js', 'src/Config.js'],
options: {
specs: 'spec/unit/ConfigSpec.js'
}
},
functionProfile: {
src: ['src/Core.js', 'src/FunctionProfile.js'],
options: {
specs: 'spec/unit/FunctionProfileSpec.js'
}
},
instrumentBasic: {
src: ['src/contains_shim.js', 'src/Core.js', 'src/Config.js', 'src/FunctionProfile.js', 'src/Instrumentor.js'],
options: {
specs: 'spec/integration/InstrumentBasicSpec.js'
}
}
},
watch: {
scripts: {
files: ['<%= sourceFiles %>', 'spec/unit/**Spec.js', 'spec/integration/**Spec.js'],
tasks: ['buildDev'],
options: {
spawn: false
}
}
},
jshint: {
beforeconcat: '<%= sourceFiles %>'
},
concat: {
options: {
stripBanners: true,
banner: '<%= banner %>'
},
dist: {
src: '<%= sourceFiles %>',
dest: '<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '<%= banner %>'
},
build: {
src: '<%= pkg.name %>.js',
dest: '<%= pkg.name %>.min.js'
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
// Default task(s). (also grunt watch)
grunt.registerTask('buildDev', ['jshint', 'jasmine', 'concat']);
grunt.registerTask('buildProd', ['jshint', 'jasmine', 'concat', 'uglify']);
};