-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
55 lines (38 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
"use strict"
var gulp = require('gulp');
var spawn = require('child_process').spawn;
var mergeStream = require('merge-stream');
var buildPath = "target/gulp";
var opencastSrc = "../opencast";
var paellaBunleSrc = opencastSrc + "/modules/engage-paella-player";
var paellaSrc = paellaBunleSrc + "src/main/paella-opencast"
var editorSrc = "src/main/paella-opencast"
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
gulp.task('paella-editor-opencast:prepare:source', function(){
var s1 = gulp.src('node_modules/paella-editor/**').pipe(gulp.dest(buildPath + '/paella-editor'));
var s2 = gulp.src(editorSrc + '/plugins-editor/**').pipe(gulp.dest(buildPath + '/paella-editor/plugins'));
return mergeStream(s1,s2);
});
gulp.task('paella-editor-opencast:prepare', ['paella-editor-opencast:prepare:source'], function(cb){
var cmd_npm = spawn('npm', ['install'], {cwd: buildPath + '/paella-editor', stdio: 'inherit'});
cmd_npm.on('close', function (code) {
cb(code);
});
});
gulp.task('paella-editor-opencast:compile', ['paella-editor-opencast:prepare'], function(cb){
var cmd_npm = spawn('node', ['node_modules/gulp/bin/gulp.js', 'editorFiles'], {cwd: buildPath + '/paella-editor'/*, stdio: 'inherit'*/});
cmd_npm.on('close', function (code) {
cb(code);
});
});
gulp.task('paella-editor-opencast:build', ["paella-editor-opencast:compile"], function(){
return gulp.src([
paellaBunleSrc + "/" + buildPath + '/paella/build/player/**',
buildPath + '/paella-editor/build/editor-files/**',
paellaSrc + '/ui/**',
editorSrc + '/ui/**'
]).pipe(gulp.dest(buildPath + '/paella-editor-opencast'));
});
gulp.task('default', ['paella-editor-opencast:build']);