forked from dotnet/vscode-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
52 lines (43 loc) · 1.61 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
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
const del = require('del');
const gulp = require('gulp');
const tslint = require('gulp-tslint');
const vsce = require('vsce');
const omnisharpDownload = require('./out/omnisharpDownload');
gulp.task('omnisharp:clean', () => {
return del('.omnisharp');
});
gulp.task('omnisharp:fetch', ['omnisharp:clean'], () => {
return omnisharpDownload.downloadOmnisharp();
});
const allTypeScript = [
'src/**/*.ts',
'!**/*.d.ts',
'!**/typings**'
];
const lintReporter = (output, file, options) => {
//emits: src/helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’
var relativeBase = file.base.substring(file.cwd.length + 1).replace('\\', '/');
output.forEach(function(e) {
var message = relativeBase + e.name + ':' + (e.startPosition.line + 1) + ':' + (e.startPosition.character + 1) + ': ' + e.failure;
console.log('[tslint] ' + message);
});
};
gulp.task('tslint', () => {
gulp.src(allTypeScript)
.pipe(tslint({
rulesDirectory: "node_modules/tslint-microsoft-contrib"
}))
.pipe(tslint.report(lintReporter, {
summarizeFailureOutput: false,
emitError: false
}))
});
gulp.task('omnisharp', ['omnisharp:fetch']);
gulp.task('package', () => {
vsce(['', '', 'package']);
});