This repository has been archived by the owner on Feb 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
gulpfile.babel.js
67 lines (52 loc) · 1.85 KB
/
gulpfile.babel.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
'use strict';
import createDevServer from './webpack.server';
import webpackConfig from './webpack.config';
import gulp from 'gulp';
import gutil from 'gulp-util';
import shell from 'gulp-shell';
import rename from 'gulp-rename';
gulp.task('webpack:dev', () => {
const server = createDevServer(webpackConfig);
server.listen(3000, '0.0.0.0', (err) => {
if (err) {
throw new gutil.PluginError('[webpack:dev]', err);
}
gutil.log('[webpack:dev]', 'http://0.0.0.0:3000');
});
});
gulp.task('assets', ['html', 'sounds', 'images']);
gulp.task('sounds', ['sdk'], () => {
return gulp.src(['build/assets/sound/**/*'])
.pipe(gulp.dest('./dist/assets/sound'));
});
gulp.task('images', ['sdk'], () => {
return gulp.src(['build/assets/images/**/*'])
.pipe(gulp.dest('./dist/assets/images'));
});
gulp.task('html', () => {
return gulp.src(['devapp/index.html'])
.pipe(gulp.dest('./dist/'));
});
gulp.task('workers', ['sdk'], () => {
return gulp.src([
//'build/workers/offline-worker.*',
//'build/workers/serviceworker-cache-polyfill.*',
'node_modules/opus-recorder/libopus.js',
'node_modules/opus-recorder/oggopusDecoder.js',
'node_modules/opus-recorder/oggopusEncoder.js',
'node_modules/opus-recorder/resampler.js'
])
.pipe(gulp.dest('./dist/'));
});
gulp.task('lib:build', shell.task('./gradlew :actor-sdk:sdk-core:core:core-js:buildPackage', { cwd: '../..' }));
gulp.task('lib:copy', ['lib:build'], () => {
return gulp.src(['../sdk-core/core/core-js/build/package/actor.nocache.js'])
.pipe(rename('actor.js'))
.pipe(gulp.dest('./node_modules/actor-js/'));
});
gulp.task('lib', ['lib:build', 'lib:copy']);
gulp.task('sdk', shell.task('npm run build'));
gulp.task('static', ['sdk', 'assets', 'workers']);
gulp.task('dev', ['webpack:dev']);
gulp.task('dev:core', ['lib', 'dev']);
gulp.task('default', ['dev']);