|
9 | 9 | require('events').EventEmitter.defaultMaxListeners = 100; |
10 | 10 |
|
11 | 11 | const gulp = require('gulp'); |
12 | | -const json = require('gulp-json-editor'); |
13 | | -const buffer = require('gulp-buffer'); |
14 | | -const filter = require('gulp-filter'); |
15 | 12 | const mocha = require('gulp-mocha'); |
16 | | -const es = require('event-stream'); |
17 | 13 | const util = require('./build/lib/util'); |
18 | | -const remote = require('gulp-remote-src'); |
19 | | -const zip = require('gulp-vinyl-zip'); |
20 | 14 | const path = require('path'); |
21 | | -const assign = require('object-assign'); |
22 | 15 | const glob = require('glob'); |
23 | | -const pkg = require('./package.json'); |
24 | 16 | const compilation = require('./build/lib/compilation'); |
25 | 17 |
|
26 | 18 | // Fast compile for development time |
@@ -52,63 +44,6 @@ gulp.task('test', function () { |
52 | 44 | .once('end', function () { process.exit(); }); |
53 | 45 | }); |
54 | 46 |
|
55 | | -gulp.task('mixin', function () { |
56 | | - const repo = process.env['VSCODE_MIXIN_REPO']; |
57 | | - |
58 | | - if (!repo) { |
59 | | - console.log('Missing VSCODE_MIXIN_REPO, skipping mixin'); |
60 | | - return; |
61 | | - } |
62 | | - |
63 | | - const quality = process.env['VSCODE_QUALITY']; |
64 | | - |
65 | | - if (!quality) { |
66 | | - console.log('Missing VSCODE_QUALITY, skipping mixin'); |
67 | | - return; |
68 | | - } |
69 | | - |
70 | | - const url = `https://github.com/${ repo }/archive/${ pkg.distro }.zip`; |
71 | | - const opts = { base: '' }; |
72 | | - const username = process.env['VSCODE_MIXIN_USERNAME']; |
73 | | - const password = process.env['VSCODE_MIXIN_PASSWORD']; |
74 | | - |
75 | | - if (username || password) { |
76 | | - opts.auth = { user: username || '', pass: password || '' }; |
77 | | - } |
78 | | - |
79 | | - console.log('Mixing in sources from \'' + url + '\':'); |
80 | | - |
81 | | - let all = remote(url, opts) |
82 | | - .pipe(zip.src()) |
83 | | - .pipe(filter(function (f) { return !f.isDirectory(); })) |
84 | | - .pipe(util.rebase(1)); |
85 | | - |
86 | | - if (quality) { |
87 | | - const build = all.pipe(filter('build/**')); |
88 | | - const productJsonFilter = filter('product.json', { restore: true }); |
89 | | - |
90 | | - const mixin = all |
91 | | - .pipe(filter('quality/' + quality + '/**')) |
92 | | - .pipe(util.rebase(2)) |
93 | | - .pipe(productJsonFilter) |
94 | | - .pipe(buffer()) |
95 | | - .pipe(json(function (patch) { |
96 | | - const original = require('./product.json'); |
97 | | - return assign(original, patch); |
98 | | - })) |
99 | | - .pipe(productJsonFilter.restore); |
100 | | - |
101 | | - all = es.merge(build, mixin); |
102 | | - } |
103 | | - |
104 | | - return all |
105 | | - .pipe(es.mapSync(function (f) { |
106 | | - console.log(f.relative); |
107 | | - return f; |
108 | | - })) |
109 | | - .pipe(gulp.dest('.')); |
110 | | -}); |
111 | | - |
112 | 47 | var ALL_EDITOR_TASKS = [ |
113 | 48 | 'clean-optimized-editor', |
114 | 49 | 'optimize-editor', |
|
0 commit comments