microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
2ec44b6d62529aa08a88dc1dbe190833e1838036

Branches

Tags

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

Clone

HTTPS

Download ZIP

gulpfile.js

69lines · 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';
17
18var sources = [
19 srcPath,
20].map(function (tsFolder) { return tsFolder + '/**/*.ts'; })
21 .concat(['test/*.ts']);
22
23gulp.task('build', function () {
24 var tsProject = ts.createProject('src/tsconfig.json');
25 return tsProject.src()
26 .pipe(sourcemaps.init())
27 .pipe(ts(tsProject))
28 .pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: 'file:///' + __dirname + '/' + srcPath + '/' }))
29 .pipe(gulp.dest(outPath));
30});
31
32gulp.task('watch', ['build'], function (cb) {
33 log('Watching build sources...');
34 return gulp.watch(sources, ['build']);
35});
36
37gulp.task('default', function (callback) {
38 runSequence("clean", "build", "tslint", callback);
39});
40
41var lintSources = [
42 srcPath,
43].map(function (tsFolder) { return tsFolder + '/**/*.ts'; });
44lintSources = lintSources.concat([
45 '!src/typings/**'
46]);
47
48var tslint = require('gulp-tslint');
49gulp.task('tslint', function () {
50 return gulp.src(lintSources, { base: '.' })
51 .pipe(tslint())
52 .pipe(tslint.report('verbose'));
53});
54
55function test() {
56 throw new Error('No tests yet');
57}
58
59gulp.task('build-test', ['build'], test);
60gulp.task('test', test);
61
62gulp.task('watch-build-test', ['build', 'build-test'], function () {
63 return gulp.watch(sources, ['build', 'build-test']);
64});
65
66gulp.task("clean", function () {
67 var del = require("del");
68 return del([outPath + "/**"], { force: true });
69});