microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
89973b41e393a344a45388d2e4b7318dfd5888d6

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

gulpfile.js

71lines · modecode

1/*---------------------------------------------------------
2 * Copyright (C) Microsoft Corporation. All rights reserved.
3 *--------------------------------------------------------*/
4
5var child_process = require('child_process');
6var gulp = require('gulp');
7var log = require('gulp-util').log;
8var mocha = require('gulp-mocha');
9var sourcemaps = require('gulp-sourcemaps');
10var os = require('os');
11var path = require('path');
12var runSequence = require("run-sequence");
13var ts = require('gulp-typescript');
14
15var srcPath = 'src';
16var outPath = 'out';
17var typingsPath = 'typings';
18
19var sources = [
20 srcPath,
21 typingsPath,
22].map(function (tsFolder) { return tsFolder + '/**/*.ts'; })
23 .concat(['test/*.ts']);
24
25gulp.task('build', function () {
26 var tsProject = ts.createProject('src/tsconfig.json');
27 return tsProject.src()
28 .pipe(sourcemaps.init())
29 .pipe(ts(tsProject))
30 .pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: 'file:///' + __dirname + '/' + srcPath + '/' }))
31 .pipe(gulp.dest(outPath));
32});
33
34gulp.task('watch', ['build'], function (cb) {
35 log('Watching build sources...');
36 return gulp.watch(sources, ['build']);
37});
38
39gulp.task('default', function (callback) {
40 runSequence("clean", "build", "tslint", callback);
41});
42
43var lintSources = [
44 srcPath,
45].map(function (tsFolder) { return tsFolder + '/**/*.ts'; });
46lintSources = lintSources.concat([
47 '!src/typings/**'
48]);
49
50var tslint = require('gulp-tslint');
51gulp.task('tslint', function () {
52 return gulp.src(lintSources, { base: '.' })
53 .pipe(tslint())
54 .pipe(tslint.report('verbose'));
55});
56
57function test() {
58 throw new Error('No tests yet');
59}
60
61gulp.task('build-test', ['build'], test);
62gulp.task('test', test);
63
64gulp.task('watch-build-test', ['build', 'build-test'], function () {
65 return gulp.watch(sources, ['build', 'build-test']);
66});
67
68gulp.task("clean", function () {
69 var del = require("del");
70 return del([outPath + "/**"], { force: true });
71});