This repository was archived by the owner on Apr 14, 2022. It is now read-only.
forked from Azure-Samples/SpeechToText-WebSockets-Javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
55 lines (52 loc) · 2.11 KB
/
gulpfile.js
File metadata and controls
55 lines (52 loc) · 2.11 KB
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
var gulp = require("gulp");
var ts = require('gulp-typescript');
var sourcemaps = require('gulp-sourcemaps');
var tslint = require("gulp-tslint");
var minify = require('gulp-minify');
var git = require('gulp-git');
var versionBump = require('gulp-bump')
var tagVersion = require('gulp-tag-version');
gulp.task("build", function() {
return gulp.src([
"src/common/**/*.ts",
"src/common.browser/**/*.ts",
"src/sdk/speech/**/*.ts",
"src/sdk/speech.browser/**/*.ts",
"Speech.Browser.Sdk.ts"])
.pipe(tslint({
formatter: "prose",
configuration: "tslint.json"
}))
.pipe(tslint.report({
summarizeFailureOutput: true
}))
.pipe(sourcemaps.init())
.pipe(ts({
target: "ES5",
declaration: true,
noImplicitAny: true,
removeComments: true,
module: "AMD",
out: 'speech.browser.sdk.js'
}))
.pipe(sourcemaps.write("."))
.pipe(minify())
.pipe(gulp.dest('distrib'));
});
// We dont want to release anything without successful build. So build task is dependency for these tasks.
gulp.task('patchRelease', ['build'], function() { return BumpVersionTagAndCommit('patch'); })
gulp.task('featureRelease', ['build'], function() { return BumpVersionTagAndCommit('minor'); })
gulp.task('majorRelease', ['build'], function() { return BumpVersionTagAndCommit('major'); })
gulp.task('preRelease', ['build'], function() { return BumpVersionTagAndCommit('prerelease'); })
function BumpVersionTagAndCommit(versionType) {
return gulp.src(['./package.json'])
// bump the version numbr
.pipe(versionBump({type:versionType}))
// save it back to filesystem
.pipe(gulp.dest('./'))
// commit the changed version number
.pipe(git.commit('Bumping package version'))
// tag it in the repository
.pipe(tagVersion());
}