mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode bead496a613e475819f89f08e9e882b841bc1fe8 (#14883)
* Merge from vscode bead496a613e475819f89f08e9e882b841bc1fe8 * Bump distro * Upgrade GCC to 4.9 due to yarn install errors * Update build image * Fix bootstrap base url * Bump distro * Fix build errors * Update source map file * Disable checkbox for blocking migration issues (#15131) * disable checkbox for blocking issues * wip * disable checkbox fixes * fix strings * Remove duplicate tsec command * Default to off for tab color if settings not present * re-skip failing tests * Fix mocha error * Bump sqlite version & fix notebooks search view * Turn off esbuild warnings * Update esbuild log level * Fix overflowactionbar tests * Fix ts-ignore in dropdown tests * cleanup/fixes * Fix hygiene * Bundle in entire zone.js module * Remove extra constructor param * bump distro for web compile break * bump distro for web compile break v2 * Undo log level change * New distro * Fix integration test scripts * remove the "no yarn.lock changes" workflow * fix scripts v2 * Update unit test scripts * Ensure ads-kerberos2 updates in .vscodeignore * Try fix unit tests * Upload crash reports * remove nogpu * always upload crashes * Use bash script * Consolidate data/ext dir names * Create in tmp directory Co-authored-by: chlafreniere <hichise@gmail.com> Co-authored-by: Christopher Suh <chsuh@microsoft.com> Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
51
build/npm/dirs.js
Normal file
51
build/npm/dirs.js
Normal file
@@ -0,0 +1,51 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// Complete list of directories where yarn should be executed to install node modules
|
||||
exports.dirs = [
|
||||
'',
|
||||
'build',
|
||||
'build/lib/watch',
|
||||
'extensions',
|
||||
'extensions/configuration-editing',
|
||||
'extensions/css-language-features',
|
||||
'extensions/css-language-features/server',
|
||||
'extensions/debug-auto-launch',
|
||||
'extensions/debug-server-ready',
|
||||
'extensions/emmet',
|
||||
'extensions/extension-editing',
|
||||
'extensions/git',
|
||||
'extensions/git-ui',
|
||||
'extensions/github',
|
||||
'extensions/github-authentication',
|
||||
'extensions/grunt',
|
||||
'extensions/gulp',
|
||||
'extensions/html-language-features',
|
||||
'extensions/html-language-features/server',
|
||||
'extensions/image-preview',
|
||||
'extensions/jake',
|
||||
'extensions/json-language-features',
|
||||
'extensions/json-language-features/server',
|
||||
'extensions/markdown-language-features',
|
||||
'extensions/merge-conflict',
|
||||
'extensions/microsoft-authentication',
|
||||
'extensions/npm',
|
||||
'extensions/php-language-features',
|
||||
'extensions/search-result',
|
||||
'extensions/simple-browser',
|
||||
'extensions/testing-editor-contributions',
|
||||
'extensions/typescript-language-features',
|
||||
'extensions/vscode-api-tests',
|
||||
'extensions/vscode-colorize-tests',
|
||||
'extensions/vscode-custom-editor-tests',
|
||||
'extensions/vscode-notebook-tests',
|
||||
'extensions/vscode-test-resolver',
|
||||
'remote',
|
||||
'remote/web',
|
||||
'test/automation',
|
||||
'test/integration/browser',
|
||||
'test/monaco',
|
||||
'test/smoke',
|
||||
];
|
||||
@@ -28,7 +28,41 @@ if (!/yarn[\w-.]*\.js$|yarnpkg$/.test(process.env['npm_execpath'])) {
|
||||
err = true;
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
if (!hasSupportedVisualStudioVersion()) {
|
||||
console.error('\033[1;31m*** Invalid C/C++ Compiler Toolchain. Please check https://github.com/microsoft/vscode/wiki/How-to-Contribute.\033[0;0m');
|
||||
err = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (err) {
|
||||
console.error('');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function hasSupportedVisualStudioVersion() {
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
// Translated over from
|
||||
// https://source.chromium.org/chromium/chromium/src/+/master:build/vs_toolchain.py;l=140-175
|
||||
const supportedVersions = ['2019', '2017'];
|
||||
|
||||
const availableVersions = [];
|
||||
for (const version of supportedVersions) {
|
||||
let vsPath = process.env[`vs${version}_install`];
|
||||
if (vsPath && fs.existsSync(vsPath)) {
|
||||
availableVersions.push(version);
|
||||
break;
|
||||
}
|
||||
const programFiles86Path = process.env['ProgramFiles(x86)'];
|
||||
if (programFiles86Path) {
|
||||
vsPath = `${programFiles86Path}/Microsoft Visual Studio/${version}`;
|
||||
const vsTypes = ['Enterprise', 'Professional', 'Community', 'Preview', 'BuildTools'];
|
||||
if (vsTypes.some(vsType => fs.existsSync(path.join(vsPath, vsType)))) {
|
||||
availableVersions.push(version);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return availableVersions.length;
|
||||
}
|
||||
|
||||
@@ -7,40 +7,41 @@ const cp = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
/**
|
||||
* @param {string} location
|
||||
*/
|
||||
function updateGrammar(location) {
|
||||
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
||||
const result = cp.spawnSync(npm, ['run', 'update-grammar'], {
|
||||
cwd: location,
|
||||
stdio: 'inherit'
|
||||
async function spawn(cmd, args, opts) {
|
||||
return new Promise((c, e) => {
|
||||
const child = cp.spawn(cmd, args, { shell: true, stdio: 'inherit', env: process.env, ...opts });
|
||||
child.on('close', code => code === 0 ? c() : e(`Returned ${code}`));
|
||||
});
|
||||
}
|
||||
|
||||
if (result.error || result.status !== 0) {
|
||||
async function main() {
|
||||
await spawn('yarn', [], { cwd: 'extensions' });
|
||||
|
||||
for (const extension of fs.readdirSync('extensions')) {
|
||||
try {
|
||||
let packageJSON = JSON.parse(fs.readFileSync(path.join('extensions', extension, 'package.json')).toString());
|
||||
if (!(packageJSON && packageJSON.scripts && packageJSON.scripts['update-grammar'])) {
|
||||
continue;
|
||||
}
|
||||
} catch {
|
||||
continue;
|
||||
}
|
||||
|
||||
await spawn(`npm`, ['run', 'update-grammar'], { cwd: `extensions/${extension}` });
|
||||
}
|
||||
|
||||
// run integration tests
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
cp.spawn('.\\scripts\\test-integration.bat', [], { env: process.env, stdio: 'inherit' });
|
||||
} else {
|
||||
cp.spawn('/bin/bash', ['./scripts/test-integration.sh'], { env: process.env, stdio: 'inherit' });
|
||||
}
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
main().catch(err => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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.scripts && packageJSON.scripts['update-grammar'];
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
console.log(`Updating ${extensions.length} grammars...`);
|
||||
|
||||
extensions.forEach(extension => updateGrammar(`extensions/${extension}`));
|
||||
|
||||
// run integration tests
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
cp.spawn('.\\scripts\\test-integration.bat', [], { env: process.env, stdio: 'inherit' });
|
||||
} else {
|
||||
cp.spawn('/bin/bash', ['./scripts/test-integration.sh'], { env: process.env, stdio: 'inherit' });
|
||||
}
|
||||
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var plist = require('fast-plist');
|
||||
|
||||
var mappings = {
|
||||
"background": ["editor.background"],
|
||||
"foreground": ["editor.foreground"],
|
||||
"hoverHighlight": ["editor.hoverHighlightBackground"],
|
||||
"linkForeground": ["editorLink.foreground"],
|
||||
"selection": ["editor.selectionBackground"],
|
||||
"inactiveSelection": ["editor.inactiveSelectionBackground"],
|
||||
"selectionHighlightColor": ["editor.selectionHighlightBackground"],
|
||||
"wordHighlight": ["editor.wordHighlightBackground"],
|
||||
"wordHighlightStrong": ["editor.wordHighlightStrongBackground"],
|
||||
"findMatchHighlight": ["editor.findMatchHighlightBackground", "peekViewResult.matchHighlightBackground"],
|
||||
"currentFindMatchHighlight": ["editor.findMatchBackground"],
|
||||
"findRangeHighlight": ["editor.findRangeHighlightBackground"],
|
||||
"referenceHighlight": ["peekViewEditor.matchHighlightBackground"],
|
||||
"lineHighlight": ["editor.lineHighlightBackground"],
|
||||
"rangeHighlight": ["editor.rangeHighlightBackground"],
|
||||
"caret": ["editorCursor.foreground"],
|
||||
"invisibles": ["editorWhitespace.foreground"],
|
||||
"guide": ["editorIndentGuide.background"],
|
||||
"ansiBlack": ["terminal.ansiBlack"], "ansiRed": ["terminal.ansiRed"], "ansiGreen": ["terminal.ansiGreen"], "ansiYellow": ["terminal.ansiYellow"],
|
||||
"ansiBlue": ["terminal.ansiBlue"], "ansiMagenta": ["terminal.ansiMagenta"], "ansiCyan": ["terminal.ansiCyan"], "ansiWhite": ["terminal.ansiWhite"],
|
||||
"ansiBrightBlack": ["terminal.ansiBrightBlack"], "ansiBrightRed": ["terminal.ansiBrightRed"], "ansiBrightGreen": ["terminal.ansiBrightGreen"],
|
||||
"ansiBrightYellow": ["terminal.ansiBrightYellow"], "ansiBrightBlue": ["terminal.ansiBrightBlue"], "ansiBrightMagenta": ["terminal.ansiBrightMagenta"],
|
||||
"ansiBrightCyan": ["terminal.ansiBrightCyan"], "ansiBrightWhite": ["terminal.ansiBrightWhite"]
|
||||
};
|
||||
|
||||
exports.update = function (srcName, destName) {
|
||||
try {
|
||||
console.log('reading ', srcName);
|
||||
let result = {};
|
||||
let plistContent = fs.readFileSync(srcName).toString();
|
||||
let theme = plist.parse(plistContent);
|
||||
let settings = theme.settings;
|
||||
if (Array.isArray(settings)) {
|
||||
let colorMap = {};
|
||||
for (let entry of settings) {
|
||||
let scope = entry.scope;
|
||||
if (scope) {
|
||||
let parts = scope.split(',').map(p => p.trim());
|
||||
if (parts.length > 1) {
|
||||
entry.scope = parts;
|
||||
}
|
||||
} else {
|
||||
var entrySettings = entry.settings;
|
||||
for (let entry in entrySettings) {
|
||||
let mapping = mappings[entry];
|
||||
if (mapping) {
|
||||
for (let newKey of mapping) {
|
||||
colorMap[newKey] = entrySettings[entry];
|
||||
}
|
||||
if (entry !== 'foreground' && entry !== 'background') {
|
||||
delete entrySettings[entry];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
result.name = theme.name;
|
||||
result.tokenColors = settings;
|
||||
result.colors = colorMap;
|
||||
}
|
||||
fs.writeFileSync(destName, JSON.stringify(result, null, '\t'));
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
};
|
||||
|
||||
if (path.basename(process.argv[1]) === 'update-theme.js') {
|
||||
exports.update(process.argv[2], process.argv[3]);
|
||||
}
|
||||
Reference in New Issue
Block a user