-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.js
109 lines (103 loc) · 2.54 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
module.exports = function(grunt) {
"use strict";
var libFiles = ['lib/*.js'];
var srcFiles = ['src/Util.js', 'src/Automatune.js', 'src/*.js'];
var destFile = 'dist/automatune.js';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
all: {
options: {
base: 'dist',
port: 8000,
keepalive: true
}
}
},
concat: {
options: {
sourceMap: true,
sourceMapStyle: "inline"
},
all: {
src: libFiles.concat(srcFiles),
dest: destFile
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> Copyright (c) <%= grunt.template.today("yyyy") %> Maximillian Laumeister, see https://github.com/MaxLaumeister/automatune for license details */\n'
},
build: {
src: libFiles.concat(srcFiles),
dest: destFile
}
},
jshint: {
all: {
src: srcFiles.concat(['Gruntfile.js'])
},
options: {
expr: true,
strict: true,
newcap: true
}
},
jsdoc: {
public: {
src: srcFiles,
options: {
destination: 'doc',
private: false
}
},
private: {
src: srcFiles,
options: {
destination: 'doc',
private: true
}
}
},
todos: {
all: {
options: {
verbose: false
},
src: srcFiles
}
},
watch: {
all: {
files: libFiles.concat(srcFiles).concat(['Gruntfile.js']),
tasks: ['concat', 'newer:jshint:all', 'connect'],
options: {
interrupt: true,
atBegin: true
}
}
},
copy: {
main: {
files: [
{expand: true, cwd: 'src/static/', src: ['**'], dest: 'dist/'},
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-newer');
grunt.loadNpmTasks('grunt-todos');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['concat', 'jshint', 'copy']);
grunt.registerTask('min', ['jshint', 'uglify', 'copy']);
grunt.registerTask('dist', ['jshint', 'uglify', 'jsdoc:public', 'copy']);
grunt.registerTask('doc', ['jsdoc:public']);
grunt.registerTask('docprivate', ['jsdoc:private']);
};