mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode e3c4990c67c40213af168300d1cfeb71d680f877 (#16569)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
const cp = require('child_process');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const { dirs } = require('./dirs');
|
||||
const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
|
||||
|
||||
/**
|
||||
@@ -21,6 +22,10 @@ function yarnInstall(location, opts) {
|
||||
const argv = JSON.parse(raw);
|
||||
const original = argv.original || [];
|
||||
const args = original.filter(arg => arg === '--ignore-optional' || arg === '--frozen-lockfile');
|
||||
if (opts.ignoreEngines) {
|
||||
args.push('--ignore-engines');
|
||||
delete opts.ignoreEngines;
|
||||
}
|
||||
|
||||
console.log(`Installing dependencies in ${location}...`);
|
||||
console.log(`$ yarn ${args.join(' ')}`);
|
||||
@@ -31,24 +36,39 @@ function yarnInstall(location, opts) {
|
||||
}
|
||||
}
|
||||
|
||||
yarnInstall('extensions'); // node modules shared by all extensions
|
||||
for (let dir of dirs) {
|
||||
|
||||
if (!(process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64'))) {
|
||||
yarnInstall('remote'); // node modules used by vscode server
|
||||
yarnInstall('remote/web'); // node modules used by vscode web
|
||||
}
|
||||
|
||||
const allExtensionFolders = fs.readdirSync('extensions');
|
||||
const extensions = allExtensionFolders.filter(e => {
|
||||
try {
|
||||
let packageJSON = JSON.parse(fs.readFileSync(path.join('extensions', e, 'package.json')).toString());
|
||||
return packageJSON && (packageJSON.dependencies || packageJSON.devDependencies);
|
||||
} catch (e) {
|
||||
return false;
|
||||
if (dir === '') {
|
||||
// `yarn` already executed in root
|
||||
continue;
|
||||
}
|
||||
});
|
||||
|
||||
extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
|
||||
if (/^remote/.test(dir) && process.platform === 'win32' && (process.arch === 'arm64' || process.env['npm_config_arch'] === 'arm64')) {
|
||||
// windows arm: do not execute `yarn` on remote folder
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dir === 'build/lib/watch') {
|
||||
// node modules for watching, specific to host node version, not electron
|
||||
yarnInstallBuildDependencies();
|
||||
continue;
|
||||
}
|
||||
|
||||
let opts;
|
||||
|
||||
if (dir === 'remote') {
|
||||
// node modules used by vscode server
|
||||
const env = { ...process.env };
|
||||
if (process.env['VSCODE_REMOTE_CC']) { env['CC'] = process.env['VSCODE_REMOTE_CC']; }
|
||||
if (process.env['VSCODE_REMOTE_CXX']) { env['CXX'] = process.env['VSCODE_REMOTE_CXX']; }
|
||||
if (process.env['VSCODE_REMOTE_NODE_GYP']) { env['npm_config_node_gyp'] = process.env['VSCODE_REMOTE_NODE_GYP']; }
|
||||
opts = { env };
|
||||
} else if (/^extensions\//.test(dir)) {
|
||||
opts = { ignoreEngines: true };
|
||||
}
|
||||
|
||||
yarnInstall(dir, opts);
|
||||
}
|
||||
|
||||
function yarnInstallBuildDependencies() {
|
||||
// make sure we install the deps of build/lib/watch for the system installed
|
||||
@@ -68,10 +88,4 @@ runtime "${runtime}"`;
|
||||
yarnInstall(watchPath);
|
||||
}
|
||||
|
||||
yarnInstall(`build`); // node modules required for build
|
||||
yarnInstall('test/automation'); // node modules required for smoketest
|
||||
yarnInstall('test/smoke'); // node modules required for smoketest
|
||||
yarnInstall('test/integration/browser'); // node modules required for integration
|
||||
yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron
|
||||
|
||||
cp.execSync('git config pull.rebase true');
|
||||
|
||||
Reference in New Issue
Block a user