-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
136 lines (91 loc) · 3.08 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/**
* Oberstes Gulpfile fuer das Speech Monorepos
* Dient zum Umkopieren aller Dateien aus den einzelnen Entwicklungs-Repositories
*/
const fs = require('fs');
const path = require('path');
const del = require('del');
const gulp = require('gulp');
const shell = require('gulp-shell');
const rename = require('gulp-rename');
const runSequence = require('gulp4-run-sequence');
// Konstanten fuer Builds
const exampleFlag = true; // wenn true, werden alle Beispiele miterzeugt
// Konstanten fuer Verzeichnisse
const rootDir = path.resolve( __dirname );
const configDir = 'config';
const credentialsDir = 'credentials';
const versionDir = 'config';
const srcDir = 'src';
const examplesDir = 'examples';
const distDir = 'dist';
const testDir = 'test';
const coverageDir = 'coverage';
// Konstanten fuer Dateinamen
const versionFile = 'speech-version.json';
const karmaFile = 'karma.conf.js';
// Version
const speechVersion = require( `./${versionDir}/${versionFile}` );
const version = speechVersion.SPEECH_VERSION_NUMBER + '.' + speechVersion.SPEECH_VERSION_BUILD + ' (' + speechVersion.SPEECH_VERSION_TYPE + ') vom ' + speechVersion.SPEECH_VERSION_DATE;
const branch = speechVersion.SPEECH_VERSION_BRANCH;
/**
* Loeschen des temporaeren Deploy-Verzeichnisses
*/
gulp.task('build-clean', () => {
return del([
distDir
]);
});
gulp.task('build-folder-dist', function () {
return gulp.src('*.*', {read: false})
.pipe(gulp.dest( distDir ));
});
gulp.task('build-folder-deploy', function () {
return gulp.src('*.*', {read: false})
.pipe(gulp.dest( `${distDir}/deploy`));
});
gulp.task('build-folder-module', function () {
return gulp.src('*.*', {read: false})
.pipe(gulp.dest( `${distDir}/module`));
});
/**
* Erzeugt die Links
*/
gulp.task('build-link', shell.task('npx lerna run link'));
// TODO: fuer NPM 6.x
// gulp.task('link-global', shell.task('lerna run linkGlobal'));
// TODO: fuer NPM 7.x
gulp.task('build-link-global', shell.task('npm --legacy-peer-deps link @lingualogic-speech/audio @lingualogic-speech/base @lingualogic-speech/cloud @lingualogic-speech/core @lingualogic-speech/dialog @lingualogic-speech/file @lingualogic-speech/listen @lingualogic-speech/net @lingualogic-speech/service @lingualogic-speech/speak'));
/**
* Erzeugt die Packages
*/
gulp.task('build-packages', shell.task('npx lerna run build'));
/**
* Erzeugt die Bundles
*/
gulp.task('build-bundles', shell.task('npx lerna run bundle'));
/**
* Erzeugt die Package-Bundles fuer Module
*/
gulp.task('build-module', shell.task('npx lerna run bundle:module'));
/**
* Erzeugt die Packages
*/
gulp.task('pack-packages', shell.task('npx lerna run pack'));
/**
* importiert aus allen Entwicklungsrepositories
*/
gulp.task('build', function(callback) {
runSequence(
'build-clean',
'build-folder-dist',
'build-folder-deploy',
'build-folder-module',
'build-link',
'build-link-global',
'build-packages',
'build-bundles',
'build-module',
'pack-packages',
callback);
});