-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.coffee
64 lines (55 loc) · 1.63 KB
/
gulpfile.coffee
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
gulp = require 'gulp'
del = require 'del'
runSequence = require 'run-sequence'
coffee = require 'gulp-coffee'
packager = require 'gulp-atom-shell'
sketch = require 'gulp-sketch'
iconutil = require 'gulp-iconutil'
gif = require 'gulp-if'
shell = require 'gulp-shell'
$ =
coffee: ['./src/**/*.coffee']
iconapp: ['./src/app.sketch']
icontray: ['./src/tray.sketch']
meta: ['./src/package.json']
package: ['./dist/**']
dist: './dist/'
#gulp.task 'default', (cb) -> runSequence 'clean', 'prebuild', 'package', cb
#gulp.task 'prebuild', (cb) -> runSequence ['icon-app', 'icon-tray', 'coffee', 'meta'], 'npm', cb
gulp.task 'default', (cb) -> runSequence 'prebuild', 'package', cb
gulp.task 'prebuild', (cb) -> runSequence ['coffee', 'meta'], 'npm', cb
gulp.task 'clean', (cb) -> del $.dist, -> cb()
gulp.task 'coffee', ->
gulp.src $.coffee
.pipe coffee()
.pipe gulp.dest $.dist
gulp.task 'meta', ->
gulp.src $.meta
.pipe gulp.dest $.dist
gulp.task 'npm', shell.task 'npm install', cwd: 'dist', quiet: true
gulp.task 'package', ->
gulp.src $.package
.pipe packager
version: '0.22.1'
platform: 'darwin'
darwinIcon: 'dist/app.icns'
.pipe packager.zfsdest 'app.zip'
#
# Generating icons (you need to have sketchtool)
#
gulp.task 'icon-tray', ->
gulp.src $.icontray
.pipe sketch
export: 'artboards'
scales: '1.0,2.0'
formats: 'png'
.pipe gulp.dest $.dist
gulp.task 'icon-app', ->
gulp.src $.iconapp
.pipe sketch
export: 'artboards'
scales: '1.0'
formats: 'png'
.pipe gulp.dest $.dist
.pipe iconutil 'app.icns'
.pipe gulp.dest $.dist