diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js index 83eebc9d69d..b0e919883c4 100644 --- a/build/gulpfile.reh.js +++ b/build/gulpfile.reh.js @@ -19,6 +19,8 @@ const untar = require('gulp-untar'); const File = require('vinyl'); const fs = require('fs'); +const cp = require('child_process'); + const REPO_ROOT = path.dirname(__dirname); const noop = () => { return Promise.resolve(); }; @@ -115,3 +117,33 @@ function nodejs(platform, arch) { })) ); } + +function mixinServer(watch) { + const packageJSONPath = path.join(path.dirname(__dirname), 'package.json'); + function exec(cmdLine) { + console.log(cmdLine); + cp.execSync(cmdLine, { stdio: "inherit" }); + } + function checkout() { + const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath).toString()); + exec('git fetch distro'); + exec(`git checkout ${packageJSON['distro']} -- src/vs/server resources/server`); + exec('git reset HEAD src/vs/server resources/server'); + } + checkout(); + if (watch) { + console.log('Enter watch mode (observing package.json)'); + const watcher = fs.watch(packageJSONPath); + watcher.addListener('change', () => { + try { + checkout(); + } catch (e) { + console.log(e); + } + }); + } + return Promise.resolve(); +} + +gulp.task(task.define('mixin-server', () => mixinServer(false))); +gulp.task(task.define('mixin-server-watch', () => mixinServer(true))); diff --git a/build/npm/install-server.js b/build/npm/install-server.js deleted file mode 100644 index ffeec1fa30a..00000000000 --- a/build/npm/install-server.js +++ /dev/null @@ -1,15 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -const cp = require('child_process'); - -function exec(cmdLine) { - console.log(cmdLine); - cp.execSync(cmdLine, {stdio: "inherit"}); -} - -exec('git fetch distro'); -exec(`git checkout ${process.env['npm_package_distro']} -- src/vs/server resources/server`); -exec('git reset HEAD src/vs/server resources/server'); \ No newline at end of file diff --git a/package.json b/package.json index 59ec4eafc4f..81215e8740c 100644 --- a/package.json +++ b/package.json @@ -26,8 +26,7 @@ "monaco-compile-check": "tsc -p src/tsconfig.monaco.json --noEmit", "strict-initialization-watch": "tsc --watch -p src/tsconfig.json --noEmit --strictPropertyInitialization", "web": "node resources/server/bin-dev/code-web.js --port 9888", - "web-selfhost": "node resources/server/bin-dev/code-web.js --port 9777 --selfhost", - "install-server": "node build/npm/install-server.js" + "web-selfhost": "node resources/server/bin-dev/code-web.js --port 9777 --selfhost" }, "dependencies": { "applicationinsights": "1.0.8",