forked from TalAter/SpeechKITT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
109 lines (104 loc) · 3.29 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
module.exports = function(grunt) {
"use strict";
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
'src/speechkitt.js',
'Gruntfile.js',
'test/corti.js',
'test/spec/*Spec.js'
],
options: {
jshintrc: true
}
},
uglify: {
dist: {
options: {
preserveComments: /^\! /
},
files: {
'dist/speechkitt.min.js': ['src/speechkitt.js']
}
}
},
watch: {
files: ['src/speechkitt.js', 'test/*.js', 'test/spec/**.js', 'themes/**/*', '!**/node_modules/**'],
tasks: ['default']
},
sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'dist/themes/flat.css': 'themes/flat/flat.scss',
'dist/themes/flat-amethyst.css': 'themes/flat-amethyst/flat-amethyst.scss',
'dist/themes/flat-clouds.css': 'themes/flat-clouds/flat-clouds.scss',
'dist/themes/flat-concrete.css': 'themes/flat-concrete/flat-concrete.scss',
'dist/themes/flat-emerald.css': 'themes/flat-emerald/flat-emerald.scss',
'dist/themes/flat-midnight-blue.css': 'themes/flat-midnight-blue/flat-midnight-blue.scss',
'dist/themes/flat-orange.css': 'themes/flat-orange/flat-orange.scss',
'dist/themes/flat-pomegranate.css': 'themes/flat-pomegranate/flat-pomegranate.scss',
'dist/themes/flat-pumpkin.css': 'themes/flat-pumpkin/flat-pumpkin.scss',
'dist/themes/flat-turquoise.css': 'themes/flat-turquoise/flat-turquoise.scss',
'dist/themes/basic.css': 'themes/basic.scss'
}
}
},
markdox: {
target: {
files: [
{src: 'src/speechkitt.js', dest: 'docs/README.md'}
]
}
},
jasmine: {
testAndCoverage: {
src: ['src/speechkitt.js'],
options: {
specs: ['test/spec/*Spec.js'],
outfile: 'test/SpecRunner.html',
polyfills: ['test/vendor/corti.js', 'test/init_corti.js', 'test/vendor/annyang.min.js', 'test/helper_functions.js'],
vendor: ['test/vendor/jquery-2.1.4.min.js', 'test/vendor/jasmine-jquery.js'],
styles: ['dist/themes/basic.css'],
keepRunner: true,
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'test/coverage/coverage.json',
report: [
{
type: 'html',
options: {
dir: 'test/coverage'
}
},
{
type: 'text'
}
],
thresholds: {
lines: 50,
statements: 50,
branches: 50,
functions: 50
}
}
}
}
}
});
// Load NPM Tasks
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-markdox');
// Default task(s).
grunt.registerTask('default', ['jshint', 'uglify', 'sass', 'jasmine', 'markdox']);
// Test task
grunt.registerTask('test', ['jshint', 'jasmine']);
};