Skip to content

Commit 31322ed

Browse files
committed
Add build task as default build task in VSCode
1 parent fe9d141 commit 31322ed

File tree

4 files changed

+41
-90
lines changed

4 files changed

+41
-90
lines changed

.vscode/tasks.json

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
11
{
22
"version": "0.1.0",
3-
"command": "gulp",
3+
"command": "tsc",
44
"isShellCommand": true,
5-
"tasks": [
6-
{
7-
"taskName": "watch",
8-
"args": [],
9-
"isBuildCommand": true,
10-
"isWatching": true,
11-
"problemMatcher": [
12-
"$tsc"
13-
]
14-
},
15-
{
16-
"taskName": "watch-build-test",
17-
"isWatching": true,
18-
"isTestCommand": true
19-
}
20-
]
5+
"args": [],
6+
"problemMatcher": "$tsc"
217
}

gulpfile.js

+6-65
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,8 @@
1-
/*---------------------------------------------------------
2-
* Copyright (C) Microsoft Corporation. All rights reserved.
3-
*--------------------------------------------------------*/
1+
var gulp = require('gulp')
2+
var shell = require('gulp-shell')
43

5-
var gulp = require('gulp');
6-
var path = require('path');
7-
var ts = require('gulp-typescript');
8-
var log = require('gulp-util').log;
9-
var typescript = require('typescript');
10-
var sourcemaps = require('gulp-sourcemaps');
11-
var mocha = require('gulp-mocha');
4+
// build
5+
gulp.task('build', shell.task([ './node_modules/.bin/tsc' ]));
126

13-
var sources = [
14-
'adapter',
15-
'common',
16-
'typings',
17-
'custom-typings',
18-
'webkit',
19-
'nativescript',
20-
].map(function(tsFolder) { return tsFolder + '/**/*.ts'; });
21-
22-
var projectConfig = {
23-
target: "es5",
24-
module: "commonjs",
25-
moduleResolution: "node",
26-
sourceMap: true,
27-
noImplicitAny: false,
28-
removeComments: false,
29-
preserveConstEnums: true,
30-
declarationFiles: true,
31-
typescript: typescript
32-
};
33-
34-
gulp.task('build', function () {
35-
return gulp.src(sources, { base: '.' })
36-
.pipe(sourcemaps.init())
37-
.pipe(ts(projectConfig))
38-
.pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: 'file:///' + __dirname }))
39-
.pipe(gulp.dest('out'));
40-
});
41-
42-
gulp.task('watch', ['build'], function(cb) {
43-
log('Watching build sources...');
44-
return gulp.watch(sources, ['build']);
45-
});
46-
47-
gulp.task('default', ['build']);
48-
49-
// Don't lint code from tsd or common, and whitelist my files under adapter
50-
var lintSources = [
51-
'test',
52-
'webkit',
53-
'nativescript'
54-
].map(function(tsFolder) { return tsFolder + '/**/*.ts'; });
55-
lintSources = lintSources.concat([
56-
'adapter/sourceMaps/sourceMapTransformer.ts',
57-
'adapter/adapterProxy.ts',
58-
'adapter/lineNumberTransformer.ts',
59-
'adapter/pathTransformer.ts',
60-
]);
61-
62-
var tslint = require('gulp-tslint');
63-
gulp.task('tslint', function(){
64-
return gulp.src(lintSources, { base: '.' })
65-
.pipe(tslint())
66-
.pipe(tslint.report('verbose'));
67-
});
7+
// default
8+
gulp.task('default', ['build']);

package.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@
2828
},
2929
"devDependencies": {
3030
"gulp": "^3.9.0",
31-
"gulp-mocha": "^2.1.3",
32-
"gulp-sourcemaps": "^1.5.2",
33-
"gulp-tslint": "^3.3.1",
34-
"gulp-typescript": "^2.12.0",
35-
"gulp-util": "^3.0.5",
31+
"gulp-shell": "^0.5.2",
3632
"tsd": "^0.6.5",
3733
"tslint": "^2.5.1",
3834
"typescript": "^1.8.2",

tsconfig.json

+31-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,36 @@
11
{
22
"compilerOptions": {
3-
"target": "es5"
3+
"target": "es5",
4+
"module": "commonjs",
5+
"moduleResolution": "node",
6+
"sourceMap": true,
7+
"noImplicitAny": false,
8+
"removeComments": false,
9+
"preserveConstEnums": true,
10+
"outDir": "out"
411
},
5-
"exclude": [
6-
"node_modules",
12+
"files": [
13+
// typescript definitions
14+
"typings/tsd.d.ts",
15+
"custom-typings/es6-impl/es6-impl.d.ts",
16+
"webkit/webKitProtocol.d.ts",
17+
18+
"./webkit/consoleHelper.ts",
19+
"./webkit/utilities.ts",
20+
"./webkit/webKitConnection.ts",
21+
"./webkit/webKitDebug.ts",
22+
"./webkit/webKitDebugAdapter.ts",
23+
"./webkit/webKitDebugSession.ts",
24+
25+
"./adapter/adapterProxy.ts",
26+
"./adapter/lineNumberTransformer.ts",
27+
"./adapter/pathTransformer.ts",
28+
"./adapter/sourceMaps/pathUtilities.ts",
29+
"./adapter/sourceMaps/sourceMaps.ts",
30+
"./adapter/sourceMaps/sourceMapTransformer.ts",
31+
32+
"./nativescript/nsMain.ts",
33+
"./nativescript/nativescript.ts",
34+
"./nativescript/android/androidDebugConnection.ts"
735
]
836
}

0 commit comments

Comments
 (0)