2 # Copyright Simon Lydell 2014.
4 # This file is part of VimFx.
6 # VimFx is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # VimFx is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with VimFx. If not, see <http://www.gnu.org/licenses/>.
21 path = require('path')
22 request = require('request')
23 gulp = require('gulp')
24 changed = require('gulp-changed')
25 coffee = require('gulp-coffee')
26 coffeelint = require('gulp-coffeelint')
27 util = require('gulp-util')
28 zip = require('gulp-zip')
29 rimraf = require('rimraf')
34 gulp.task('default', ['push'])
36 gulp.task('clean', (callback) ->
37 rimraf(DEST, callback)
41 gulp.src(['extension/**/!(*.coffee)', 'COPYING'])
43 .pipe(gulp.dest(DEST))
46 gulp.task('coffee', ->
47 gulp.src('extension/**/*.coffee')
48 .pipe(changed(DEST, {extension: '.coffee'}))
49 .pipe(coffee({bare: true}).on('error', util.log))
50 .pipe(gulp.dest(DEST))
53 gulp.task('build', ['copy', 'coffee'])
55 gulp.task('xpi', ['build'], ->
56 gulp.src("#{ DEST }/**/!(#{ XPI })")
57 .pipe(zip(XPI, {compress: false}))
58 .pipe(gulp.dest(DEST))
61 gulp.task('push', ['xpi'], ->
62 body = fs.readFileSync(path.join(DEST, XPI))
63 request.post({url: 'http://localhost:8888', body })
67 gulp.src(['extension/**/*.coffee', 'gulpfile.coffee'])
69 .pipe(coffeelint.reporter())