-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathGruntfile.js
94 lines (85 loc) · 2.38 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
module.exports = function (grunt) {
'use strict';
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-jslint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jslint: { // configure the task
// lint your project's server code
server: {
src: [
'*.js',
'server/routes/*.js',
'server/js/**/*.js',
'server/models/*.js'
],
exclude: [
],
directives: { // example directives
node: true,
indent: 2,
todo: true
},
options: {
edition: 'latest', // specify an edition of jslint or use 'dir/mycustom-jslint.js' for own path
junit: 'out/server-junit.xml', // write the output to a JUnit XML
log: 'out/server-lint.log',
jslintXml: 'out/server-jslint.xml',
errorsOnly: true, // only display errors
failOnError: false, // defaults to true
checkstyle: 'out/server-checkstyle.xml' // write a checkstyle-XML
}
},
// lint your project's client code
client: {
src: [
'public/js/*.js'
],
directives: {
browser: true,
indent: 2,
predef: [
'jQuery'
]
},
options: {
junit: 'out/client-junit.xml'
}
}
},
electron: {
osxBuild: {
options: {
NODE_ENV: 'production',
name: 'PiPo',
dir: '.',
out: 'dist',
version: '0.36.5',
platform: 'darwin',
icon: 'public/img/pipo.icns',
arch: 'x64',
ignore: []
}
}
},
clean: {
build: ["out", "pipo.log"],
release: ["dist"]
}
//cleanall: {
// clean: {
// build: ["out", "pipo.log"],
// release: ["dist"],
// modules: ["node_modules"]
// }
//}
});
grunt.registerTask('default', 'Default task', ['lint']);
grunt.registerTask('build', 'Build for Electron', ['electron']);
grunt.registerTask('cleanall', 'Clean build files', ['clean']);
grunt.registerTask('cleanrelease', 'Clean release files', ['cleanrelease']);
//grunt.registerTask('cleanall', 'Clean all files', ['cleanall']);
grunt.registerTask('lint', 'Run linting', ['jslint']);
};