forked from music-encoding/sibmei
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
63 lines (54 loc) · 1.6 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
/* jshint node:true */
'use strict'
var gulp = require('gulp');
var child = require('child_process');
var c = require('ansi-colors');
var l = require('fancy-log');
var Q = require('q');
var plgconf = require('./plgconfig');
function build()
{
var deferred = Q.defer();
l.info(c.blue('Copying "linked" libraries'));
gulp.src('lib/*.plg')
.pipe(gulp.dest('build/'));
var build = child.exec('buildPlg', function(err, stdout, stderr)
{
if (err)
{
l.error(c.red("Build failed with error code: " + err.code));
}
l.info(c.blue('Output: ') + '\n' + stdout);
});
var buildTest = child.exec('buildPlg test', function(err, stdout, stderr)
{
if (err)
{
l.error(c.red("Test Build failed with error code: " + err.code));
}
l.info(c.blue('Output: ') + '\n' + stdout);
deferred.resolve();
});
l.info(c.blue('Copying test data'));
const destPath = plgconf.plgPath + '/' + plgconf.plgCategory + '/sibmeiTestSibs';
gulp.src('test/sibmeiTestSibs/*.sib', {base: 'test/sibmeiTestSibs'})
.pipe(gulp.dest(destPath));
return deferred.promise;
};
function deploy (cb)
{
var deploy = child.exec('deployPlg', function(err, stdout, stderr)
{
if (err)
{
l.error(c.red("Deploy failed with error code: " + err.code));
}
l.info(c.blue('Output: ') + '\n' + stdout);
});
cb();
};
function develop() {
gulp.watch(['src/**/*', 'test/**/*', 'lib/**/*.plg'], gulp.series(build, deploy))
}
exports.develop = develop;
exports.build = build;