-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
77 lines (66 loc) · 1.89 KB
/
gulpfile.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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var less = require('gulp-less');
var electron = require('gulp-electron');
var install = require('gulp-install');
var react = require('gulp-react');
var path = require('path');
var runElectron = require('gulp-run-electron');
gulp.task('package', ['compile', 'install'], function() {
return gulp.src('')
.pipe(electron({
src: './dest',
packageJson: require('./dest/package.json'),
release: './release',
cache: './cache',
version: 'v0.27.2',
packaging: true,
platforms: ['darwin-x64', 'linux-x64']
}))
.pipe(gulp.dest(''));
});
gulp.task('run', ['compile', 'install'], function() {
return gulp.src('dest')
.pipe(runElectron([], {}));
});
gulp.task('install', ['compile'], function() {
return gulp.src('./dest/package.json')
.pipe(install({production: true}));
});
gulp.task('jshint', function() {
return gulp.src([
'!./src/js/components/*.js',
'!./src/js/app.js',
'./src/js/**/*.js',
'main.js'
])
.pipe(jshint())
.pipe(jshint.reporter('default'));
});
gulp.task('less', function() {
return gulp.src('./src/{player,playlist}/style/style.less')
.pipe(less({
paths: [ path.join(__dirname, 'src', 'shared', 'less')]
}))
.pipe(gulp.dest('dest/'));
});
gulp.task('scripts', ['jshint'], function() {
return gulp.src('./src/*/js/**/*.js')
.pipe(react())
.on('error', console.log.bind(console))
.pipe(gulp.dest('dest/'));
});
gulp.task('files', function() {
return gulp.src([
'./src/{player,playlist}/index.html',
'main.js',
'package.json'
])
.pipe(gulp.dest('dest'));
});
gulp.task('imgs', function() {
return gulp.src('./src/{player,playlist}/img/*.png', {base: './src/{player,playlist}'})
.pipe(gulp.dest('dest/img/'));
})
gulp.task('compile', ['scripts', 'files', 'imgs', 'less']);
gulp.task('default', ['jshint', 'compile', 'install', 'run']);