microsoft/vscode-react-native

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0bbcd4af4fc4614efc6578d1d0002ad2d7ec00d2

Branches

Tags

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

Clone

HTTPS

Download ZIP

gulpfile.js

62lines · modeblame

8ba55f4cJimmy Thomson10 years ago1/*---------------------------------------------------------
2* Copyright (C) Microsoft Corporation. All rights reserved.
3*--------------------------------------------------------*/
4
5var child_process = require('child_process');
6var gulp = require('gulp');
3fb37ad5unknown10 years ago7var log = require('gulp-util').log;
8ba55f4cJimmy Thomson10 years ago8var mocha = require('gulp-mocha');
9var sourcemaps = require('gulp-sourcemaps');
10var os = require('os');
11var path = require('path');
3fb37ad5unknown10 years ago12var runSequence = require("run-sequence");
13var ts = require('gulp-typescript');
8ba55f4cJimmy Thomson10 years ago14
15var sources = [
16'src',
17'typings',
3fb37ad5unknown10 years ago18].map(function (tsFolder) { return tsFolder + '/**/*.ts'; })
19.concat(['test/*.ts']);
8ba55f4cJimmy Thomson10 years ago20
21gulp.task('build', function () {
22var tsProject = ts.createProject('src/tsconfig.json');
23return tsProject.src()
24.pipe(sourcemaps.init())
25.pipe(ts(tsProject))
8fe942cdJimmy Thomson10 years ago26.pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: 'file:///' + __dirname + '/src/' }))
8ba55f4cJimmy Thomson10 years ago27.pipe(gulp.dest('out'));
28});
29
3fb37ad5unknown10 years ago30gulp.task('watch', ['build'], function (cb) {
8ba55f4cJimmy Thomson10 years ago31log('Watching build sources...');
32return gulp.watch(sources, ['build']);
33});
34
3fb37ad5unknown10 years ago35gulp.task('default', function (callback) {
36runSequence("build", "tslint", callback);
37});
8ba55f4cJimmy Thomson10 years ago38
39var lintSources = [
40'src',
3fb37ad5unknown10 years ago41].map(function (tsFolder) { return tsFolder + '/**/*.ts'; });
3fde2079Jimmy Thomson10 years ago42lintSources = lintSources.concat([
43'!src/typings/**'
44]);
8ba55f4cJimmy Thomson10 years ago45
46var tslint = require('gulp-tslint');
3fb37ad5unknown10 years ago47gulp.task('tslint', function () {
48return gulp.src(lintSources, { base: '.' })
8ba55f4cJimmy Thomson10 years ago49.pipe(tslint())
50.pipe(tslint.report('verbose'));
51});
52
53function test() {
54throw new Error('No tests yet');
55}
56
57gulp.task('build-test', ['build'], test);
58gulp.task('test', test);
59
3fb37ad5unknown10 years ago60gulp.task('watch-build-test', ['build', 'build-test'], function () {
8ba55f4cJimmy Thomson10 years ago61return gulp.watch(sources, ['build', 'build-test']);
62});