-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.coffee
More file actions
92 lines (76 loc) · 2.23 KB
/
Copy pathgulpfile.coffee
File metadata and controls
92 lines (76 loc) · 2.23 KB
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
gulp = require 'gulp'
gutil = require 'gulp-util'
# watch = require 'gulp-watch'
sourcemaps = require 'gulp-sourcemaps'
coffee = require 'gulp-coffee'
jade = require 'gulp-jade'
stylus = require 'gulp-stylus'
nib = require 'nib'
NwBuilder = require 'nw-builder'
evb = require 'enigmavirtualbox'
paths =
jade: './views/*.jade'
stylus: './stylesheets/*.styl'
coffee: './lib/**/*.coffee'
build: ['./**/**', '!./stylesheets/**', '!./views/**', '!./node_modules/**', '!./lib/**', '!./build/**', '!./cache/**']
# main: './lib/main/**/*.coffee'
output =
jade: './dist/templates/'
stylus: './dist/css/'
coffee: './dist/js/'
# main: './main/'
gulp.task 'jade', ->
gulp.src paths.jade
.pipe jade()
.pipe gulp.dest(output.jade)
gulp.task 'stylus', ->
gulp.src paths.stylus
.pipe stylus({
use: nib()
compress: true
})
.pipe gulp.dest(output.stylus)
gulp.task 'coffee', ->
gulp.src paths.coffee
.pipe sourcemaps.init()
.pipe coffee().on('error', handleError)
.pipe sourcemaps.write()
.pipe gulp.dest(output.coffee)
gulp.task 'build', ->
nw = new NwBuilder {
files: paths.build
platforms: ['win64']
winIco: './icon.ico'
}
nw.on 'log', (msg) ->
console.log msg
return nw.build().catch (err) ->
console.error err
gulp.task 'vb', (done) ->
console.log 'Bundling files...'
evb
.gen 'build/PolyEdit/app.evb',
'build/PolyEdit/app-bundled.exe',
'build/PolyEdit/win64/PolyEdit.exe',
'build/PolyEdit/win64/nw.pak',
'build/PolyEdit/win64/icudtl.dat',
'build/PolyEdit/win64/ffmpegsumo.dll',
'build/PolyEdit/win64/libEGL.dll',
'build/PolyEdit/win64/libGLESv2.dll'
.then () ->
console.log 'Finished.'
console.log 'Packing bundle...'
evb.cli('build/PolyEdit/app.evb').then () ->
console.log 'Finished.'
done()
return
return
return
gulp.task 'default', ['jade', 'stylus', 'coffee']
gulp.task 'watch', ->
gulp.watch paths.jade, ['jade']
gulp.watch paths.stylus, ['stylus']
gulp.watch paths.coffee, ['coffee']
handleError = (err) ->
console.log err.toString()
this.emit 'end'