-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
107 lines (97 loc) · 3.11 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
build: {
src: [
'src/utils/Callback.js',
'src/utils/Command.js',
'src/utils/CommandManager.js',
'src/utils/Utility.js',
'src/geom/Transform.js',
'src/display/Bitmap.js',
'src/display/Text.js',
'src/display/Line.js',
'src/display/Circle.js',
'src/display/Triangle.js',
'src/display/Rect.js',
'src/display/Ellipse.js',
'src/display/PolyStar.js',
'src/display/RoundRect.js',
'src/display/Frame.js',
'src/display/Stage.js'
],
dest: 'lib/jscanvasninja.min.js'
}
},
jshint: {
all: ['Gruntfile.js', 'src/**/*.js', 'src-test/**/*.js']
},
jasmine: {
all: {
src: 'src/**/*.js',
options: {
specs: 'test/**/*Spec.js',
vendor: [
'lib/easeljs-0.5.0.min.js',
'http://raw.github.com/andrewplummer/Sugar/master/release/sugar.min.js',
'https://raw.githubusercontent.com/velesin/jasmine-jquery/master/vendor/jquery/jquery.js',
'https://raw.githubusercontent.com/velesin/jasmine-jquery/master/lib/jasmine-jquery.js'
]
}
},
istanbul: {
src: '<%= jasmine.all.src %>',
options: {
vendor: '<%= jasmine.all.options.vendor %>',
specs: '<%= jasmine.all.options.specs %>',
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'coverage/json/coverage.json',
report: [
{type: 'html', options: {dir: 'coverage/html'}},
{type: 'lcov', options: {dir: 'coverage/lcov'}}
]
}
}
}
},
coveralls: {
options: {
// LCOV coverage file relevant to every target
src: 'coverage/lcov/lcov.info',
// When true, grunt-coveralls will only print a warning rather than
// an error, to prevent CI builds from failing unnecessarily (e.g. if
// coveralls.io is down). Optional, defaults to false.
force: false
},
your_target: {
// Target-specific LCOV coverage file
src: 'coverage/lcov/lcov.info'
}
},
jsdoc : {
dist : {
src: ['src/**/*.js'],
options: {
destination: 'doc'
}
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
// Load the plugin that provides the "jshint" task.
grunt.loadNpmTasks('grunt-contrib-jshint');
// Load the plugin that provides the "jasmine" task.
grunt.loadNpmTasks('grunt-contrib-jasmine');
// Load the plugin that provides the "coveralls" task.
grunt.loadNpmTasks('grunt-coveralls');
// Load the plugin that provides the "jsdoc" task.
grunt.loadNpmTasks('grunt-jsdoc');
// Default task(s).
grunt.registerTask('default', ['uglify']);
// Test task(s).
grunt.registerTask('test', ['jasmine:istanbul']);
};