microsoft/vscode-react-native
Publicmirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable
lib/codepush-node-sdk/gulpfile.js
48lines · modecode
| 1 | const gulp = require('gulp'); |
| 2 | const ts = require('gulp-typescript'); |
| 3 | const rmdir = require('rmdir'); |
| 4 | const path = require("path"); |
| 5 | const install = require("gulp-install"); |
| 6 | const gulpSequence = require('gulp-sequence'); |
| 7 | const tslint = require("gulp-tslint"); |
| 8 | |
| 9 | const srcPath = "./dist"; |
| 10 | const tsFilesPath = "./src/**/*.ts"; |
| 11 | |
| 12 | |
| 13 | gulp.task("clean", function() { |
| 14 | return rmdir(srcPath); |
| 15 | }) |
| 16 | |
| 17 | gulp.task("install", function(done) { |
| 18 | var package = path.join(__dirname, "package.json"); |
| 19 | return gulp.src(package).pipe(install()); |
| 20 | }) |
| 21 | |
| 22 | gulp.task("tslint", function() { |
| 23 | return gulp.src(tsFilesPath).pipe(tslint({ |
| 24 | configuration: "./tslint.json", formatter: "verbose" |
| 25 | })).pipe(tslint.report()); |
| 26 | }) |
| 27 | |
| 28 | gulp.task('build', function () { |
| 29 | const tsProject = ts.createProject('tsconfig.json'); |
| 30 | return gulp.src('src/**/*.ts') |
| 31 | .pipe(tsProject()) |
| 32 | .pipe(gulp.dest('./dist')); |
| 33 | }); |
| 34 | |
| 35 | gulp.task('content', function() { |
| 36 | return gulp.src([ |
| 37 | "{script}/**/*.{css,ejs,html,js,json,png,xml}", |
| 38 | "*.{public,private}", |
| 39 | "package.json", |
| 40 | ".npmignore", |
| 41 | "README.md" |
| 42 | ]) |
| 43 | .pipe(gulp.dest("dist")); |
| 44 | }); |
| 45 | |
| 46 | gulp.task('prepublish', gulpSequence('clean', 'tslint', 'build', 'content')); |
| 47 | |
| 48 | gulp.task("default", ["build"]); |