-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
executable file
·88 lines (73 loc) · 2.23 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
var isWin = /^win/.test(process.platform);
var isMac = /^darwin/.test(process.platform);
var isLinux32 = /^linux/.test(process.platform);
var isLinux64 = /^linux64/.test(process.platform);
var os = "unknown";
if (isWin)
os = "win";
if (isMac)
os = "mac";
if (isLinux32)
os = "linux32";
if (isLinux64)
os = "linux64";
var nwVer = '0.9.2';
var nwExec = "";
if (!isMac)
nwExec = "cd cache/" + os + "/" + nwVer + " && nw ../../../src";
else
nwExec = "cd cache/" + os + "/" + nwVer + " && open -n -a node-webkit ../../../src";
console.log("OS: " + os);
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('./package.json'),
less: {
'./src/css/app.css': ['./src/css/app.less']
},
nodewebkit: {
options: {
version: nwVer,
build_dir: './',
mac: isMac,
win: isWin,
linux32: isLinux32,
linux64: isLinux64,
keep_nw: false,
zip: false,
mac_icns:'./src/images/fluent-ffmpeg-ui.icns'
},
src: ['./src/**/*']
},
clean: ["./releases/**/*"],
shell: {
install: {
command: function() {
return 'bower cache clean && bower install && cd src && npm install';
},
options: {
stdout: true,
stderr: true,
stdin: true
}
},
run: {
command: function() {
return nwExec;
},
options: {
stdout: true,
stderr: true,
stdin: true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-node-webkit-builder');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['less', 'shell:run']);
grunt.registerTask('run', ['default']);
grunt.registerTask('install', ['shell:install', 'nodewebkit']);
grunt.registerTask('build', ['less', 'nodewebkit']);
};