mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -154,9 +154,13 @@ async function publish(commit: string, quality: string, platform: string, type:
|
||||
|
||||
const queuedBy = process.env['BUILD_QUEUEDBY']!;
|
||||
const sourceBranch = process.env['BUILD_SOURCEBRANCH']!;
|
||||
const isReleased = quality === 'insider'
|
||||
&& /^master$|^refs\/heads\/master$/.test(sourceBranch)
|
||||
&& /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy);
|
||||
const isReleased = (
|
||||
// Insiders: nightly build from master
|
||||
(quality === 'insider' && /^master$|^refs\/heads\/master$/.test(sourceBranch) && /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy)) ||
|
||||
|
||||
// Exploration: any build from electron-4.0.x branch
|
||||
(quality === 'exploration' && /^electron-4.0.x$|^refs\/heads\/electron-4.0.x$/.test(sourceBranch))
|
||||
);
|
||||
|
||||
console.log('Publishing...');
|
||||
console.log('Quality:', quality);
|
||||
|
||||
@@ -1,13 +1,25 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "8.12.0"
|
||||
versionSpec: "10.15.1"
|
||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||
inputs:
|
||||
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
vstsFeed: '$(ArtifactFeed)'
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
- script: |
|
||||
yarn
|
||||
displayName: Install Dependencies
|
||||
condition: ne(variables['CacheRestored'], 'true')
|
||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||
inputs:
|
||||
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
vstsFeed: '$(ArtifactFeed)'
|
||||
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
||||
- script: |
|
||||
yarn gulp electron-x64
|
||||
displayName: Download Electron
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "8.12.0"
|
||||
versionSpec: "10.15.1"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
@@ -23,7 +23,10 @@ steps:
|
||||
set -e
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||
yarn gulp -- vscode-darwin-min upload-vscode-sourcemaps
|
||||
yarn gulp -- vscode-darwin-min
|
||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||
yarn gulp -- upload-vscode-sourcemaps
|
||||
displayName: Build
|
||||
|
||||
- script: |
|
||||
|
||||
@@ -9,13 +9,25 @@ steps:
|
||||
sudo service xvfb start
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "8.12.0"
|
||||
versionSpec: "10.15.1"
|
||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||
inputs:
|
||||
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
vstsFeed: '$(ArtifactFeed)'
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
- script: |
|
||||
yarn
|
||||
displayName: Install Dependencies
|
||||
condition: ne(variables['CacheRestored'], 'true')
|
||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||
inputs:
|
||||
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
vstsFeed: '$(ArtifactFeed)'
|
||||
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
||||
- script: |
|
||||
yarn gulp electron-x64
|
||||
displayName: Download Electron
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "8.12.0"
|
||||
versionSpec: "10.15.1"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "8.12.0"
|
||||
versionSpec: "10.15.1"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
@@ -16,6 +16,11 @@ steps:
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
# Make sure we get latest packages
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade -y
|
||||
|
||||
# Define variables
|
||||
REPO="$(pwd)"
|
||||
ARCH="$(VSCODE_ARCH)"
|
||||
SNAP_ROOT="$REPO/.build/linux/snap/$ARCH"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "8.12.0"
|
||||
versionSpec: "10.15.1"
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.10.1"
|
||||
@@ -9,9 +9,21 @@ steps:
|
||||
inputs:
|
||||
versionSpec: '2.x'
|
||||
addToPath: true
|
||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||
inputs:
|
||||
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
vstsFeed: '$(ArtifactFeed)'
|
||||
- powershell: |
|
||||
yarn
|
||||
displayName: Install Dependencies
|
||||
condition: ne(variables['CacheRestored'], 'true')
|
||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||
inputs:
|
||||
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||
vstsFeed: '$(ArtifactFeed)'
|
||||
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
||||
- powershell: |
|
||||
yarn gulp electron
|
||||
displayName: Download Electron
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "8.12.0"
|
||||
versionSpec: "10.15.1"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
|
||||
91
build/download/download.js
Normal file
91
build/download/download.js
Normal file
@@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const https = require("https");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const cp = require("child_process");
|
||||
function ensureDir(filepath) {
|
||||
if (!fs.existsSync(filepath)) {
|
||||
ensureDir(path.dirname(filepath));
|
||||
fs.mkdirSync(filepath);
|
||||
}
|
||||
}
|
||||
function download(options, destination) {
|
||||
ensureDir(path.dirname(destination));
|
||||
return new Promise((c, e) => {
|
||||
const fd = fs.openSync(destination, 'w');
|
||||
const req = https.get(options, (res) => {
|
||||
res.on('data', (chunk) => {
|
||||
fs.writeSync(fd, chunk);
|
||||
});
|
||||
res.on('end', () => {
|
||||
fs.closeSync(fd);
|
||||
c();
|
||||
});
|
||||
});
|
||||
req.on('error', (reqErr) => {
|
||||
console.error(`request to ${options.host}${options.path} failed.`);
|
||||
console.error(reqErr);
|
||||
e(reqErr);
|
||||
});
|
||||
});
|
||||
}
|
||||
const MARKER_ARGUMENT = `_download_fork_`;
|
||||
function base64encode(str) {
|
||||
return Buffer.from(str, 'utf8').toString('base64');
|
||||
}
|
||||
function base64decode(str) {
|
||||
return Buffer.from(str, 'base64').toString('utf8');
|
||||
}
|
||||
function downloadInExternalProcess(options) {
|
||||
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
|
||||
console.log(`Downloading ${url}...`);
|
||||
return new Promise((c, e) => {
|
||||
const child = cp.fork(__filename, [MARKER_ARGUMENT, base64encode(JSON.stringify(options))], {
|
||||
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
||||
});
|
||||
let stderr = [];
|
||||
child.stderr.on('data', (chunk) => {
|
||||
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
|
||||
});
|
||||
child.on('exit', (code) => {
|
||||
if (code === 0) {
|
||||
// normal termination
|
||||
console.log(`Finished downloading ${url}.`);
|
||||
c();
|
||||
}
|
||||
else {
|
||||
// abnormal termination
|
||||
console.error(Buffer.concat(stderr).toString());
|
||||
e(new Error(`Download of ${url} failed.`));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.downloadInExternalProcess = downloadInExternalProcess;
|
||||
function _downloadInExternalProcess() {
|
||||
let options;
|
||||
try {
|
||||
options = JSON.parse(base64decode(process.argv[3]));
|
||||
}
|
||||
catch (err) {
|
||||
console.error(`Cannot read arguments`);
|
||||
console.error(err);
|
||||
process.exit(-1);
|
||||
return;
|
||||
}
|
||||
download(options.requestOptions, options.destinationPath).then(() => {
|
||||
process.exit(0);
|
||||
}, (err) => {
|
||||
console.error(err);
|
||||
process.exit(-2);
|
||||
});
|
||||
}
|
||||
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
|
||||
// running as forked download script
|
||||
_downloadInExternalProcess();
|
||||
}
|
||||
111
build/download/download.ts
Normal file
111
build/download/download.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as https from 'https';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as cp from 'child_process';
|
||||
|
||||
function ensureDir(filepath: string) {
|
||||
if (!fs.existsSync(filepath)) {
|
||||
ensureDir(path.dirname(filepath));
|
||||
fs.mkdirSync(filepath);
|
||||
}
|
||||
}
|
||||
|
||||
function download(options: https.RequestOptions, destination: string): Promise<void> {
|
||||
ensureDir(path.dirname(destination));
|
||||
|
||||
return new Promise<void>((c, e) => {
|
||||
const fd = fs.openSync(destination, 'w');
|
||||
const req = https.get(options, (res) => {
|
||||
res.on('data', (chunk) => {
|
||||
fs.writeSync(fd, chunk);
|
||||
});
|
||||
res.on('end', () => {
|
||||
fs.closeSync(fd);
|
||||
c();
|
||||
});
|
||||
});
|
||||
req.on('error', (reqErr) => {
|
||||
console.error(`request to ${options.host}${options.path} failed.`);
|
||||
console.error(reqErr);
|
||||
e(reqErr);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
const MARKER_ARGUMENT = `_download_fork_`;
|
||||
|
||||
function base64encode(str: string): string {
|
||||
return Buffer.from(str, 'utf8').toString('base64');
|
||||
}
|
||||
|
||||
function base64decode(str: string): string {
|
||||
return Buffer.from(str, 'base64').toString('utf8');
|
||||
}
|
||||
|
||||
export interface IDownloadRequestOptions {
|
||||
host: string;
|
||||
path: string;
|
||||
}
|
||||
|
||||
export interface IDownloadOptions {
|
||||
requestOptions: IDownloadRequestOptions;
|
||||
destinationPath: string;
|
||||
}
|
||||
|
||||
export function downloadInExternalProcess(options: IDownloadOptions): Promise<void> {
|
||||
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
|
||||
console.log(`Downloading ${url}...`);
|
||||
return new Promise<void>((c, e) => {
|
||||
const child = cp.fork(
|
||||
__filename,
|
||||
[MARKER_ARGUMENT, base64encode(JSON.stringify(options))],
|
||||
{
|
||||
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
||||
}
|
||||
);
|
||||
let stderr: Buffer[] = [];
|
||||
child.stderr.on('data', (chunk) => {
|
||||
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
|
||||
});
|
||||
child.on('exit', (code) => {
|
||||
if (code === 0) {
|
||||
// normal termination
|
||||
console.log(`Finished downloading ${url}.`);
|
||||
c();
|
||||
} else {
|
||||
// abnormal termination
|
||||
console.error(Buffer.concat(stderr).toString());
|
||||
e(new Error(`Download of ${url} failed.`));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function _downloadInExternalProcess() {
|
||||
let options: IDownloadOptions;
|
||||
try {
|
||||
options = JSON.parse(base64decode(process.argv[3]));
|
||||
} catch (err) {
|
||||
console.error(`Cannot read arguments`);
|
||||
console.error(err);
|
||||
process.exit(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
download(options.requestOptions, options.destinationPath).then(() => {
|
||||
process.exit(0);
|
||||
}, (err) => {
|
||||
console.error(err);
|
||||
process.exit(-2);
|
||||
});
|
||||
}
|
||||
|
||||
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
|
||||
// running as forked download script
|
||||
_downloadInExternalProcess();
|
||||
}
|
||||
18
build/gulpfile.compile.js
Normal file
18
build/gulpfile.compile.js
Normal file
@@ -0,0 +1,18 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const compilation = require('./lib/compilation');
|
||||
const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
|
||||
|
||||
// Full compile, including nls and inline sources in sourcemaps, for build
|
||||
const compileClientBuildTask = task.define('compile-client-build', task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true)));
|
||||
|
||||
// All Build
|
||||
const compileBuildTask = task.define('compile-build', task.parallel(compileClientBuildTask, compileExtensionsBuildTask));
|
||||
exports.compileBuildTask = compileBuildTask;
|
||||
@@ -6,6 +6,7 @@
|
||||
const gulp = require('gulp');
|
||||
const path = require('path');
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const common = require('./lib/optimize');
|
||||
const es = require('event-stream');
|
||||
const File = require('vinyl');
|
||||
@@ -48,9 +49,6 @@ var editorResources = [
|
||||
'!**/test/**'
|
||||
];
|
||||
|
||||
var editorOtherSources = [
|
||||
];
|
||||
|
||||
var BUNDLED_FILE_HEADER = [
|
||||
'/*!-----------------------------------------------------------',
|
||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||
@@ -63,8 +61,7 @@ var BUNDLED_FILE_HEADER = [
|
||||
|
||||
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
|
||||
|
||||
gulp.task('clean-editor-src', util.rimraf('out-editor-src'));
|
||||
gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
||||
const extractEditorSrcTask = task.define('extract-editor-src', () => {
|
||||
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
|
||||
const apiusages = monacoapi.execute().usageContent;
|
||||
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
|
||||
@@ -84,6 +81,7 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
||||
'typings/thenable.d.ts',
|
||||
'typings/es6-promise.d.ts',
|
||||
'typings/require-monaco.d.ts',
|
||||
"typings/lib.es2018.promise.d.ts",
|
||||
'vs/monaco.d.ts'
|
||||
],
|
||||
libs: [
|
||||
@@ -100,15 +98,11 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
||||
});
|
||||
});
|
||||
|
||||
// Full compile, including nls and inline sources in sourcemaps, for build
|
||||
gulp.task('clean-editor-build', util.rimraf('out-editor-build'));
|
||||
gulp.task('compile-editor-build', ['clean-editor-build', 'extract-editor-src'], compilation.compileTask('out-editor-src', 'out-editor-build', true));
|
||||
const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true));
|
||||
|
||||
gulp.task('clean-optimized-editor', util.rimraf('out-editor'));
|
||||
gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'], common.optimizeTask({
|
||||
const optimizeEditorAMDTask = task.define('optimize-editor-amd', common.optimizeTask({
|
||||
src: 'out-editor-build',
|
||||
entryPoints: editorEntryPoints,
|
||||
otherSources: editorOtherSources,
|
||||
resources: editorResources,
|
||||
loaderConfig: {
|
||||
paths: {
|
||||
@@ -125,11 +119,9 @@ gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'],
|
||||
languages: languages
|
||||
}));
|
||||
|
||||
gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
|
||||
gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor'));
|
||||
const minifyEditorAMDTask = task.define('minify-editor-amd', common.minifyTask('out-editor'));
|
||||
|
||||
gulp.task('clean-editor-esm', util.rimraf('out-editor-esm'));
|
||||
gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'extract-editor-src'], function () {
|
||||
const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () => {
|
||||
standalone.createESMSourcesAndResources2({
|
||||
srcFolder: './out-editor-src',
|
||||
outFolder: './out-editor-esm',
|
||||
@@ -151,7 +143,8 @@ gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'ext
|
||||
}
|
||||
});
|
||||
});
|
||||
gulp.task('compile-editor-esm', ['extract-editor-esm', 'clean-editor-distro'], function () {
|
||||
|
||||
const compileEditorESMTask = task.define('compile-editor-esm', () => {
|
||||
if (process.platform === 'win32') {
|
||||
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
|
||||
cwd: path.join(__dirname, '../out-editor-esm')
|
||||
@@ -202,8 +195,16 @@ function toExternalDTS(contents) {
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core'));
|
||||
gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify-editor', 'optimize-editor'], function () {
|
||||
function filterStream(testFunc) {
|
||||
return es.through(function (data) {
|
||||
if (!testFunc(data.relative)) {
|
||||
return;
|
||||
}
|
||||
this.emit('data', data);
|
||||
});
|
||||
}
|
||||
|
||||
const finalEditorResourcesTask = task.define('final-editor-resources', () => {
|
||||
return es.merge(
|
||||
// other assets
|
||||
es.merge(
|
||||
@@ -233,6 +234,14 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
||||
}))
|
||||
.pipe(gulp.dest('out-monaco-editor-core')),
|
||||
|
||||
// version.txt
|
||||
gulp.src('build/monaco/version.txt')
|
||||
.pipe(es.through(function (data) {
|
||||
data.contents = Buffer.from(`monaco-editor-core: https://github.com/Microsoft/vscode/tree/${sha1}`);
|
||||
this.emit('data', data);
|
||||
}))
|
||||
.pipe(gulp.dest('out-monaco-editor-core')),
|
||||
|
||||
// README.md
|
||||
gulp.src('build/monaco/README-npm.md')
|
||||
.pipe(es.through(function (data) {
|
||||
@@ -266,7 +275,7 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
||||
|
||||
var strContents = data.contents.toString();
|
||||
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
|
||||
strContents = strContents.replace(/\/\/\# sourceMappingURL=[^ ]+$/, newStr);
|
||||
strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr);
|
||||
|
||||
data.contents = Buffer.from(strContents);
|
||||
this.emit('data', data);
|
||||
@@ -282,59 +291,31 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
||||
);
|
||||
});
|
||||
|
||||
gulp.task('analyze-editor-distro', function () {
|
||||
// @ts-ignore
|
||||
var bundleInfo = require('../out-editor/bundleInfo.json');
|
||||
var graph = bundleInfo.graph;
|
||||
var bundles = bundleInfo.bundles;
|
||||
|
||||
var inverseGraph = {};
|
||||
Object.keys(graph).forEach(function (module) {
|
||||
var dependencies = graph[module];
|
||||
dependencies.forEach(function (dep) {
|
||||
inverseGraph[dep] = inverseGraph[dep] || [];
|
||||
inverseGraph[dep].push(module);
|
||||
});
|
||||
});
|
||||
|
||||
var detailed = {};
|
||||
Object.keys(bundles).forEach(function (entryPoint) {
|
||||
var included = bundles[entryPoint];
|
||||
var includedMap = {};
|
||||
included.forEach(function (included) {
|
||||
includedMap[included] = true;
|
||||
});
|
||||
|
||||
var explanation = [];
|
||||
included.map(function (included) {
|
||||
if (included.indexOf('!') >= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var reason = (inverseGraph[included] || []).filter(function (mod) {
|
||||
return !!includedMap[mod];
|
||||
});
|
||||
explanation.push({
|
||||
module: included,
|
||||
reason: reason
|
||||
});
|
||||
});
|
||||
|
||||
detailed[entryPoint] = explanation;
|
||||
});
|
||||
|
||||
console.log(JSON.stringify(detailed, null, '\t'));
|
||||
});
|
||||
|
||||
function filterStream(testFunc) {
|
||||
return es.through(function (data) {
|
||||
if (!testFunc(data.relative)) {
|
||||
return;
|
||||
}
|
||||
this.emit('data', data);
|
||||
});
|
||||
}
|
||||
|
||||
gulp.task('editor-distro',
|
||||
task.series(
|
||||
task.parallel(
|
||||
util.rimraf('out-editor-src'),
|
||||
util.rimraf('out-editor-build'),
|
||||
util.rimraf('out-editor-esm'),
|
||||
util.rimraf('out-monaco-editor-core'),
|
||||
util.rimraf('out-editor'),
|
||||
util.rimraf('out-editor-min')
|
||||
),
|
||||
extractEditorSrcTask,
|
||||
task.parallel(
|
||||
task.series(
|
||||
compileEditorAMDTask,
|
||||
optimizeEditorAMDTask,
|
||||
minifyEditorAMDTask
|
||||
),
|
||||
task.series(
|
||||
createESMSourcesAndResourcesTask,
|
||||
compileEditorESMTask
|
||||
)
|
||||
),
|
||||
finalEditorResourcesTask
|
||||
)
|
||||
);
|
||||
|
||||
//#region monaco type checking
|
||||
|
||||
@@ -354,6 +335,7 @@ function createTscCompileTask(watch) {
|
||||
let errors = [];
|
||||
let reporter = createReporter();
|
||||
let report;
|
||||
// eslint-disable-next-line no-control-regex
|
||||
let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
|
||||
|
||||
child.stdout.on('data', data => {
|
||||
@@ -387,7 +369,10 @@ function createTscCompileTask(watch) {
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task('monaco-typecheck-watch', createTscCompileTask(true));
|
||||
gulp.task('monaco-typecheck', createTscCompileTask(false));
|
||||
const monacoTypecheckWatchTask = task.define('monaco-typecheck-watch', createTscCompileTask(true));
|
||||
exports.monacoTypecheckWatchTask = monacoTypecheckWatchTask;
|
||||
|
||||
const monacoTypecheckTask = task.define('monaco-typecheck', createTscCompileTask(false));
|
||||
exports.monacoTypecheckTask = monacoTypecheckTask;
|
||||
|
||||
//#endregion
|
||||
|
||||
@@ -11,8 +11,8 @@ const path = require('path');
|
||||
const tsb = require('gulp-tsb');
|
||||
const es = require('event-stream');
|
||||
const filter = require('gulp-filter');
|
||||
const rimraf = require('rimraf');
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const watcher = require('./lib/watch');
|
||||
const createReporter = require('./lib/reporter').createReporter;
|
||||
const glob = require('glob');
|
||||
@@ -43,16 +43,6 @@ const tasks = compilations.map(function (tsconfigFile) {
|
||||
|
||||
const name = relativeDirname.replace(/\//g, '-');
|
||||
|
||||
// Tasks
|
||||
const clean = 'clean-extension:' + name;
|
||||
const compile = 'compile-extension:' + name;
|
||||
const watch = 'watch-extension:' + name;
|
||||
|
||||
// Build Tasks
|
||||
const cleanBuild = 'clean-extension-build:' + name;
|
||||
const compileBuild = 'compile-extension-build:' + name;
|
||||
const watchBuild = 'watch-extension-build:' + name;
|
||||
|
||||
const root = path.join('extensions', relativeDirname);
|
||||
const srcBase = path.join(root, 'src');
|
||||
const src = path.join(srcBase, '**');
|
||||
@@ -111,18 +101,18 @@ const tasks = compilations.map(function (tsconfigFile) {
|
||||
|
||||
const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };
|
||||
|
||||
gulp.task(clean, cb => rimraf(out, cb));
|
||||
const cleanTask = task.define(`clean-extension-${name}`, util.rimraf(out));
|
||||
|
||||
gulp.task(compile, [clean], () => {
|
||||
const compileTask = task.define(`compile-extension:${name}`, task.series(cleanTask, () => {
|
||||
const pipeline = createPipeline(false, true);
|
||||
const input = gulp.src(src, srcOpts);
|
||||
|
||||
return input
|
||||
.pipe(pipeline())
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
}));
|
||||
|
||||
gulp.task(watch, [clean], () => {
|
||||
const watchTask = task.define(`watch-extension:${name}`, task.series(cleanTask, () => {
|
||||
const pipeline = createPipeline(false);
|
||||
const input = gulp.src(src, srcOpts);
|
||||
const watchInput = watcher(src, srcOpts);
|
||||
@@ -130,43 +120,35 @@ const tasks = compilations.map(function (tsconfigFile) {
|
||||
return watchInput
|
||||
.pipe(util.incremental(pipeline, input))
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
}));
|
||||
|
||||
gulp.task(cleanBuild, cb => rimraf(out, cb));
|
||||
|
||||
gulp.task(compileBuild, [clean], () => {
|
||||
const compileBuildTask = task.define(`compile-build-extension-${name}`, task.series(cleanTask, () => {
|
||||
const pipeline = createPipeline(true, true);
|
||||
const input = gulp.src(src, srcOpts);
|
||||
|
||||
return input
|
||||
.pipe(pipeline())
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
}));
|
||||
|
||||
gulp.task(watchBuild, [clean], () => {
|
||||
const pipeline = createPipeline(true);
|
||||
const input = gulp.src(src, srcOpts);
|
||||
const watchInput = watcher(src, srcOpts);
|
||||
|
||||
return watchInput
|
||||
.pipe(util.incremental(() => pipeline(), input))
|
||||
.pipe(gulp.dest(out));
|
||||
});
|
||||
// Tasks
|
||||
gulp.task(compileTask);
|
||||
gulp.task(watchTask);
|
||||
|
||||
return {
|
||||
clean: clean,
|
||||
compile: compile,
|
||||
watch: watch,
|
||||
cleanBuild: cleanBuild,
|
||||
compileBuild: compileBuild,
|
||||
watchBuild: watchBuild
|
||||
compileTask: compileTask,
|
||||
watchTask: watchTask,
|
||||
compileBuildTask: compileBuildTask
|
||||
};
|
||||
});
|
||||
|
||||
gulp.task('clean-extensions', tasks.map(t => t.clean));
|
||||
gulp.task('compile-extensions', tasks.map(t => t.compile));
|
||||
gulp.task('watch-extensions', tasks.map(t => t.watch));
|
||||
const compileExtensionsTask = task.define('compile-extensions', task.parallel(...tasks.map(t => t.compileTask)));
|
||||
gulp.task(compileExtensionsTask);
|
||||
exports.compileExtensionsTask = compileExtensionsTask;
|
||||
|
||||
gulp.task('clean-extensions-build', tasks.map(t => t.cleanBuild));
|
||||
gulp.task('compile-extensions-build', tasks.map(t => t.compileBuild));
|
||||
gulp.task('watch-extensions-build', tasks.map(t => t.watchBuild));
|
||||
const watchExtensionsTask = task.define('watch-extensions', task.parallel(...tasks.map(t => t.watchTask)));
|
||||
gulp.task(watchExtensionsTask);
|
||||
exports.watchExtensionsTask = watchExtensionsTask;
|
||||
|
||||
const compileExtensionsBuildTask = task.define('compile-extensions-build', task.parallel(...tasks.map(t => t.compileBuildTask)));
|
||||
exports.compileExtensionsBuildTask = compileExtensionsBuildTask;
|
||||
|
||||
@@ -81,7 +81,7 @@ const indentationFilter = [
|
||||
'!src/typings/**/*.d.ts',
|
||||
'!extensions/**/*.d.ts',
|
||||
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}',
|
||||
'!build/{lib,tslintRules}/**/*.js',
|
||||
'!build/{lib,tslintRules,download}/**/*.js',
|
||||
'!build/**/*.sh',
|
||||
'!build/azure-pipelines/**/*.js',
|
||||
'!build/azure-pipelines/**/*.config',
|
||||
@@ -230,7 +230,7 @@ function hygiene(some) {
|
||||
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
||||
|
||||
if (original !== formatted) {
|
||||
console.error('File not formatted:', file.relative);
|
||||
console.error("File not formatted. Run the 'Format Document' command to fix it:", file.relative);
|
||||
errorCount++;
|
||||
}
|
||||
cb(null, file);
|
||||
|
||||
@@ -1,15 +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';
|
||||
|
||||
const gulp = require('gulp');
|
||||
const mocha = require('gulp-mocha');
|
||||
|
||||
gulp.task('test', function () {
|
||||
return gulp.src('test/all.js')
|
||||
.pipe(mocha({ ui: 'tdd', delay: true }))
|
||||
.once('end', function () { process.exit(); });
|
||||
});
|
||||
@@ -20,6 +20,7 @@ const filter = require('gulp-filter');
|
||||
const json = require('gulp-json-editor');
|
||||
const _ = require('underscore');
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const ext = require('./lib/extensions');
|
||||
const buildfile = require('../src/buildfile');
|
||||
const common = require('./lib/optimize');
|
||||
@@ -38,6 +39,7 @@ const deps = require('./dependencies');
|
||||
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
||||
const createAsar = require('./lib/asar').createAsar;
|
||||
const minimist = require('minimist');
|
||||
const { compileBuildTask } = require('./gulpfile.compile');
|
||||
|
||||
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
||||
// @ts-ignore
|
||||
@@ -76,15 +78,16 @@ const vscodeResources = [
|
||||
'out-build/paths.js',
|
||||
'out-build/vs/**/*.{svg,png,cur,html}',
|
||||
'out-build/vs/base/common/performance.js',
|
||||
'out-build/vs/base/node/languagePacks.js',
|
||||
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh}',
|
||||
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
|
||||
'out-build/vs/workbench/browser/media/*-theme.css',
|
||||
'out-build/vs/workbench/parts/debug/**/*.json',
|
||||
'out-build/vs/workbench/parts/execution/**/*.scpt',
|
||||
'out-build/vs/workbench/parts/webview/electron-browser/webview-pre.js',
|
||||
'out-build/vs/workbench/contrib/debug/**/*.json',
|
||||
'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt',
|
||||
'out-build/vs/workbench/contrib/webview/electron-browser/webview-pre.js',
|
||||
'out-build/vs/**/markdown.css',
|
||||
'out-build/vs/workbench/parts/tasks/**/*.json',
|
||||
'out-build/vs/workbench/parts/welcome/walkThrough/**/*.md',
|
||||
'out-build/vs/workbench/contrib/tasks/**/*.json',
|
||||
'out-build/vs/workbench/contrib/welcome/walkThrough/**/*.md',
|
||||
'out-build/vs/workbench/services/files/**/*.exe',
|
||||
'out-build/vs/workbench/services/files/**/*.md',
|
||||
'out-build/vs/code/electron-browser/workbench/**',
|
||||
@@ -121,29 +124,41 @@ const BUNDLED_FILE_HEADER = [
|
||||
' *--------------------------------------------------------*/'
|
||||
].join('\n');
|
||||
|
||||
gulp.task('clean-optimized-vscode', util.rimraf('out-vscode'));
|
||||
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
|
||||
src: 'out-build',
|
||||
entryPoints: vscodeEntryPoints,
|
||||
otherSources: [],
|
||||
resources: vscodeResources,
|
||||
loaderConfig: common.loaderConfig(nodeModules),
|
||||
header: BUNDLED_FILE_HEADER,
|
||||
out: 'out-vscode',
|
||||
bundleInfo: undefined
|
||||
}));
|
||||
const optimizeVSCodeTask = task.define('optimize-vscode', task.series(
|
||||
task.parallel(
|
||||
util.rimraf('out-vscode'),
|
||||
compileBuildTask
|
||||
),
|
||||
common.optimizeTask({
|
||||
src: 'out-build',
|
||||
entryPoints: vscodeEntryPoints,
|
||||
resources: vscodeResources,
|
||||
loaderConfig: common.loaderConfig(nodeModules),
|
||||
header: BUNDLED_FILE_HEADER,
|
||||
out: 'out-vscode',
|
||||
bundleInfo: undefined
|
||||
})
|
||||
));
|
||||
|
||||
|
||||
gulp.task('optimize-index-js', ['optimize-vscode'], () => {
|
||||
const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js');
|
||||
const contents = fs.readFileSync(fullpath).toString();
|
||||
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
|
||||
fs.writeFileSync(fullpath, newContents);
|
||||
});
|
||||
const optimizeIndexJSTask = task.define('optimize-index-js', task.series(
|
||||
optimizeVSCodeTask,
|
||||
() => {
|
||||
const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js');
|
||||
const contents = fs.readFileSync(fullpath).toString();
|
||||
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
|
||||
fs.writeFileSync(fullpath, newContents);
|
||||
}
|
||||
));
|
||||
|
||||
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
||||
gulp.task('clean-minified-vscode', util.rimraf('out-vscode-min'));
|
||||
gulp.task('minify-vscode', ['clean-minified-vscode', 'optimize-index-js'], common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`));
|
||||
const minifyVSCodeTask = task.define('minify-vscode', task.series(
|
||||
task.parallel(
|
||||
util.rimraf('out-vscode-min'),
|
||||
optimizeIndexJSTask
|
||||
),
|
||||
common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)
|
||||
));
|
||||
|
||||
// Package
|
||||
|
||||
@@ -206,13 +221,11 @@ function getElectron(arch) {
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task('clean-electron', util.rimraf('.build/electron'));
|
||||
gulp.task('electron', ['clean-electron'], getElectron(process.arch));
|
||||
gulp.task('electron-ia32', ['clean-electron'], getElectron('ia32'));
|
||||
gulp.task('electron-x64', ['clean-electron'], getElectron('x64'));
|
||||
gulp.task('electron-arm', ['clean-electron'], getElectron('arm'));
|
||||
gulp.task('electron-arm64', ['clean-electron'], getElectron('arm64'));
|
||||
|
||||
gulp.task(task.define('electron', task.series(util.rimraf('.build/electron'), getElectron(process.arch))));
|
||||
gulp.task(task.define('electron-ia32', task.series(util.rimraf('.build/electron'), getElectron('ia32'))));
|
||||
gulp.task(task.define('electron-x64', task.series(util.rimraf('.build/electron'), getElectron('x64'))));
|
||||
gulp.task(task.define('electron-arm', task.series(util.rimraf('.build/electron'), getElectron('armv7l'))));
|
||||
gulp.task(task.define('electron-arm64', task.series(util.rimraf('.build/electron'), getElectron('arm64'))));
|
||||
|
||||
/**
|
||||
* Compute checksums for some files.
|
||||
@@ -248,15 +261,14 @@ function computeChecksum(filename) {
|
||||
return hash;
|
||||
}
|
||||
|
||||
function packageTask(platform, arch, opts) {
|
||||
function packageTask(platform, arch, sourceFolderName, destinationFolderName, opts) {
|
||||
opts = opts || {};
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const destination = path.join(path.dirname(root), 'azuredatastudio') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
|
||||
const destination = path.join(path.dirname(root), destinationFolderName);
|
||||
platform = platform || process.platform;
|
||||
|
||||
return () => {
|
||||
const out = opts.minified ? 'out-vscode-min' : 'out-vscode';
|
||||
const out = sourceFolderName;
|
||||
|
||||
const checksums = computeChecksums(out, [
|
||||
'vs/workbench/workbench.main.js',
|
||||
@@ -309,14 +321,13 @@ function packageTask(platform, arch, opts) {
|
||||
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
||||
.pipe(json(productJsonUpdate));
|
||||
|
||||
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' });
|
||||
|
||||
const watermark = gulp.src(['resources/letterpress.svg', 'resources/letterpress-dark.svg', 'resources/letterpress-hc.svg'], { base: '.' });
|
||||
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true });
|
||||
|
||||
// TODO the API should be copied to `out` during compile, not here
|
||||
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
|
||||
// {{SQL CARBON EDIT}}
|
||||
const dataApi = gulp.src('src/vs/data.d.ts').pipe(rename('out/sql/data.d.ts'));
|
||||
const dataApi = gulp.src('src/sql/azdata.d.ts').pipe(rename('out/sql/azdata.d.ts'));
|
||||
const sqlopsAPI = gulp.src('src/sql/sqlops.d.ts').pipe(rename('out/sql/sqlops.d.ts'));
|
||||
|
||||
const depsSrc = [
|
||||
..._.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
||||
@@ -351,6 +362,8 @@ function packageTask(platform, arch, opts) {
|
||||
.pipe(util.cleanNodeModule('vscode-nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']))
|
||||
.pipe(util.cleanNodeModule('win-ca-lib', ['**/*'], ['package.json', '**/*.node']))
|
||||
.pipe(util.cleanNodeModule('node-addon-api', ['**/*']))
|
||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
@@ -361,50 +374,29 @@ function packageTask(platform, arch, opts) {
|
||||
'node_modules/underscore/**/*.*',
|
||||
'node_modules/zone.js/**/*.*',
|
||||
'node_modules/chart.js/**/*.*',
|
||||
'node_modules/chartjs-color/**/*.*',
|
||||
'node_modules/chartjs-color-string/**/*.*',
|
||||
'node_modules/color-convert/**/*.*',
|
||||
'node_modules/color-name/**/*.*',
|
||||
'node_modules/moment/**/*.*'
|
||||
], { base: '.', dot: true });
|
||||
|
||||
let all = es.merge(
|
||||
packageJsonStream,
|
||||
productJsonStream,
|
||||
license,
|
||||
watermark,
|
||||
api,
|
||||
// {{SQL CARBON EDIT}}
|
||||
copiedModules,
|
||||
dataApi,
|
||||
sqlopsAPI,
|
||||
sources,
|
||||
deps
|
||||
);
|
||||
|
||||
if (platform === 'win32') {
|
||||
all = es.merge(all, gulp.src([
|
||||
'resources/win32/bower.ico',
|
||||
'resources/win32/c.ico',
|
||||
'resources/win32/config.ico',
|
||||
'resources/win32/cpp.ico',
|
||||
'resources/win32/csharp.ico',
|
||||
'resources/win32/css.ico',
|
||||
'resources/win32/default.ico',
|
||||
'resources/win32/go.ico',
|
||||
'resources/win32/html.ico',
|
||||
'resources/win32/jade.ico',
|
||||
'resources/win32/java.ico',
|
||||
'resources/win32/javascript.ico',
|
||||
'resources/win32/json.ico',
|
||||
'resources/win32/less.ico',
|
||||
'resources/win32/markdown.ico',
|
||||
'resources/win32/php.ico',
|
||||
'resources/win32/powershell.ico',
|
||||
'resources/win32/python.ico',
|
||||
'resources/win32/react.ico',
|
||||
'resources/win32/ruby.ico',
|
||||
'resources/win32/sass.ico',
|
||||
'resources/win32/shell.ico',
|
||||
'resources/win32/sql.ico',
|
||||
'resources/win32/typescript.ico',
|
||||
'resources/win32/vue.ico',
|
||||
'resources/win32/xml.ico',
|
||||
'resources/win32/yaml.ico',
|
||||
// {{SQL CARBON EDIT}} remove unused icons
|
||||
'resources/win32/code_70x70.png',
|
||||
'resources/win32/code_150x150.png'
|
||||
], { base: '.' }));
|
||||
@@ -426,7 +418,7 @@ function packageTask(platform, arch, opts) {
|
||||
// result = es.merge(result, gulp.src('resources/completions/**', { base: '.' }));
|
||||
|
||||
if (platform === 'win32') {
|
||||
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32' }));
|
||||
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32', allowEmpty: true }));
|
||||
|
||||
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
|
||||
.pipe(replace('@@NAME@@', product.nameShort))
|
||||
@@ -461,38 +453,37 @@ function packageTask(platform, arch, opts) {
|
||||
|
||||
const buildRoot = path.dirname(root);
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
gulp.task('vscode-win32-x64-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'win32', 'x64'));
|
||||
gulp.task('vscode-darwin-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'darwin'));
|
||||
gulp.task('vscode-linux-x64-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'linux', 'x64'));
|
||||
const BUILD_TARGETS = [
|
||||
{ platform: 'win32', arch: 'ia32' },
|
||||
{ platform: 'win32', arch: 'x64' },
|
||||
{ platform: 'darwin', arch: null, opts: { stats: true } },
|
||||
{ platform: 'linux', arch: 'ia32' },
|
||||
{ platform: 'linux', arch: 'x64' },
|
||||
{ platform: 'linux', arch: 'arm' },
|
||||
{ platform: 'linux', arch: 'arm64' },
|
||||
];
|
||||
BUILD_TARGETS.forEach(buildTarget => {
|
||||
const dashed = (str) => (str ? `-${str}` : ``);
|
||||
const platform = buildTarget.platform;
|
||||
const arch = buildTarget.arch;
|
||||
const opts = buildTarget.opts;
|
||||
|
||||
gulp.task('vscode-win32-x64-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'win32', 'x64'));
|
||||
gulp.task('vscode-darwin-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'darwin'));
|
||||
gulp.task('vscode-linux-x64-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'linux', 'x64'));
|
||||
['', 'min'].forEach(minified => {
|
||||
const sourceFolderName = `out-vscode${dashed(minified)}`;
|
||||
const destinationFolderName = `azuredatastudio${dashed(platform)}${dashed(arch)}`;
|
||||
|
||||
gulp.task('clean-vscode-win32-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-ia32')));
|
||||
gulp.task('clean-vscode-win32-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-x64')));
|
||||
gulp.task('clean-vscode-darwin', util.rimraf(path.join(buildRoot, 'azuredatastudio-darwin')));
|
||||
gulp.task('clean-vscode-linux-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-ia32')));
|
||||
gulp.task('clean-vscode-linux-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-x64')));
|
||||
gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm')));
|
||||
gulp.task('clean-vscode-linux-arm64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm64')));
|
||||
|
||||
gulp.task('vscode-win32-ia32', ['optimize-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32'));
|
||||
gulp.task('vscode-win32-x64', ['vscode-win32-x64-azurecore', 'vscode-win32-x64-mssql', 'optimize-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64'));
|
||||
gulp.task('vscode-darwin', ['vscode-darwin-azurecore', 'vscode-darwin-mssql', 'optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { stats: true }));
|
||||
gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32'));
|
||||
gulp.task('vscode-linux-x64', ['vscode-linux-x64-azurecore', 'vscode-linux-x64-mssql', 'optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64'));
|
||||
gulp.task('vscode-linux-arm', ['optimize-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm'));
|
||||
gulp.task('vscode-linux-arm64', ['optimize-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64'));
|
||||
|
||||
gulp.task('vscode-win32-ia32-min', ['minify-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32', { minified: true }));
|
||||
gulp.task('vscode-win32-x64-min', ['minify-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64', { minified: true }));
|
||||
gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { minified: true, stats: true }));
|
||||
gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32', { minified: true }));
|
||||
gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64', { minified: true }));
|
||||
gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true }));
|
||||
gulp.task('vscode-linux-arm64-min', ['minify-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64', { minified: true }));
|
||||
const vscodeTask = task.define(`vscode${dashed(platform)}${dashed(arch)}${dashed(minified)}`, task.series(
|
||||
task.parallel(
|
||||
minified ? minifyVSCodeTask : optimizeVSCodeTask,
|
||||
util.rimraf(path.join(buildRoot, destinationFolderName))
|
||||
),
|
||||
ext.packageExtensionTask('mssql', platform, arch),
|
||||
ext.packageExtensionTask('azurecore', platform, arch),
|
||||
packageTask(platform, arch, sourceFolderName, destinationFolderName, opts)
|
||||
));
|
||||
gulp.task(vscodeTask);
|
||||
});
|
||||
});
|
||||
|
||||
// Transifex Localizations
|
||||
|
||||
@@ -515,30 +506,42 @@ const apiHostname = process.env.TRANSIFEX_API_URL;
|
||||
const apiName = process.env.TRANSIFEX_API_NAME;
|
||||
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
||||
|
||||
gulp.task('vscode-translations-push', ['optimize-vscode'], function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = './extensions/*';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
gulp.task(task.define(
|
||||
'vscode-translations-push',
|
||||
task.series(
|
||||
optimizeVSCodeTask,
|
||||
function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = './extensions/*';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
|
||||
return es.merge(
|
||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
|
||||
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
||||
});
|
||||
return es.merge(
|
||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
|
||||
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
||||
}
|
||||
)
|
||||
));
|
||||
|
||||
gulp.task('vscode-translations-export', ['optimize-vscode'], function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = './extensions/*';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
gulp.task(task.define(
|
||||
'vscode-translations-export',
|
||||
task.series(
|
||||
optimizeVSCodeTask,
|
||||
function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = './extensions/*';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
|
||||
return es.merge(
|
||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||
).pipe(vfs.dest('../vscode-translations-export'));
|
||||
});
|
||||
return es.merge(
|
||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||
).pipe(vfs.dest('../vscode-translations-export'));
|
||||
}
|
||||
)
|
||||
));
|
||||
|
||||
gulp.task('vscode-translations-pull', function () {
|
||||
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
|
||||
@@ -559,7 +562,7 @@ gulp.task('vscode-translations-import', function () {
|
||||
|
||||
// Sourcemaps
|
||||
|
||||
gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], () => {
|
||||
gulp.task('upload-vscode-sourcemaps', () => {
|
||||
const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' })
|
||||
.pipe(es.mapSync(f => {
|
||||
f.path = `${f.base}/core/${f.relative}`;
|
||||
@@ -583,57 +586,8 @@ gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], ()
|
||||
}));
|
||||
});
|
||||
|
||||
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
|
||||
gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
|
||||
if (!shouldSetupSettingsSearch()) {
|
||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||
console.log(`Only runs on master and release branches, not ${branch}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(allConfigDetailsPath)) {
|
||||
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
||||
}
|
||||
|
||||
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
||||
if (!settingsSearchBuildId) {
|
||||
throw new Error('Failed to compute build number');
|
||||
}
|
||||
|
||||
return gulp.src(allConfigDetailsPath)
|
||||
.pipe(azure.upload({
|
||||
account: process.env.AZURE_STORAGE_ACCOUNT,
|
||||
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
||||
container: 'configuration',
|
||||
prefix: `${settingsSearchBuildId}/${commit}/`
|
||||
}));
|
||||
});
|
||||
|
||||
function shouldSetupSettingsSearch() {
|
||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
|
||||
}
|
||||
|
||||
function getSettingsSearchBuildId(packageJson) {
|
||||
try {
|
||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
|
||||
/\/master$/.test(branch) ? 1 :
|
||||
2; // Some unexpected branch
|
||||
|
||||
const out = cp.execSync(`git rev-list HEAD --count`);
|
||||
const count = parseInt(out.toString());
|
||||
|
||||
// <version number><commit count><branchId (avoid unlikely conflicts)>
|
||||
// 1.25.1, 1,234,567 commits, master = 1250112345671
|
||||
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
|
||||
} catch (e) {
|
||||
throw new Error('Could not determine build number: ' + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// This task is only run for the MacOS build
|
||||
gulp.task('generate-vscode-configuration', () => {
|
||||
const generateVSCodeConfigurationTask = task.define('generate-vscode-configuration', () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const buildDir = process.env['AGENT_BUILDDIRECTORY'];
|
||||
if (!buildDir) {
|
||||
@@ -670,6 +624,61 @@ gulp.task('generate-vscode-configuration', () => {
|
||||
});
|
||||
});
|
||||
|
||||
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
|
||||
gulp.task(task.define(
|
||||
'upload-vscode-configuration',
|
||||
task.series(
|
||||
generateVSCodeConfigurationTask,
|
||||
() => {
|
||||
if (!shouldSetupSettingsSearch()) {
|
||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||
console.log(`Only runs on master and release branches, not ${branch}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(allConfigDetailsPath)) {
|
||||
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
||||
}
|
||||
|
||||
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
||||
if (!settingsSearchBuildId) {
|
||||
throw new Error('Failed to compute build number');
|
||||
}
|
||||
|
||||
return gulp.src(allConfigDetailsPath)
|
||||
.pipe(azure.upload({
|
||||
account: process.env.AZURE_STORAGE_ACCOUNT,
|
||||
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
||||
container: 'configuration',
|
||||
prefix: `${settingsSearchBuildId}/${commit}/`
|
||||
}));
|
||||
}
|
||||
)
|
||||
));
|
||||
|
||||
function shouldSetupSettingsSearch() {
|
||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
|
||||
}
|
||||
|
||||
function getSettingsSearchBuildId(packageJson) {
|
||||
try {
|
||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
|
||||
/\/master$/.test(branch) ? 1 :
|
||||
2; // Some unexpected branch
|
||||
|
||||
const out = cp.execSync(`git rev-list HEAD --count`);
|
||||
const count = parseInt(out.toString());
|
||||
|
||||
// <version number><commit count><branchId (avoid unlikely conflicts)>
|
||||
// 1.25.1, 1,234,567 commits, master = 1250112345671
|
||||
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
|
||||
} catch (e) {
|
||||
throw new Error('Could not determine build number: ' + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
// Install service locally before building carbon
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ const shell = require('gulp-shell');
|
||||
const es = require('event-stream');
|
||||
const vfs = require('vinyl-fs');
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const packageJson = require('../package.json');
|
||||
const product = require('../product.json');
|
||||
const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
|
||||
@@ -42,7 +43,7 @@ function prepareDebPackage(arch) {
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(replace('@@ICON@@', product.applicationName))
|
||||
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||
|
||||
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||
@@ -52,7 +53,7 @@ function prepareDebPackage(arch) {
|
||||
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
||||
|
||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||
.pipe(rename('usr/share/pixmaps/' + product.applicationName + '.png'));
|
||||
.pipe(rename('usr/share/pixmaps/' + product.linuxIconName + '.png'));
|
||||
|
||||
// const bash_completion = gulp.src('resources/completions/bash/code')
|
||||
// .pipe(rename('usr/share/bash-completion/completions/code'));
|
||||
@@ -133,7 +134,7 @@ function prepareRpmPackage(arch) {
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(replace('@@ICON@@', product.applicationName))
|
||||
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||
|
||||
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||
@@ -143,7 +144,7 @@ function prepareRpmPackage(arch) {
|
||||
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
||||
|
||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||
.pipe(rename('BUILD/usr/share/pixmaps/' + product.applicationName + '.png'));
|
||||
.pipe(rename('BUILD/usr/share/pixmaps/' + product.linuxIconName + '.png'));
|
||||
|
||||
// const bash_completion = gulp.src('resources/completions/bash/code')
|
||||
// .pipe(rename('BUILD/usr/share/bash-completion/completions/code'));
|
||||
@@ -157,6 +158,7 @@ function prepareRpmPackage(arch) {
|
||||
const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' })
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||
.pipe(replace('@@VERSION@@', packageJson.version))
|
||||
.pipe(replace('@@RELEASE@@', linuxPackageRevision))
|
||||
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
|
||||
@@ -195,7 +197,8 @@ function getSnapBuildPath(arch) {
|
||||
}
|
||||
|
||||
function prepareSnapPackage(arch) {
|
||||
const binaryDir = '../VSCode-linux-' + arch;
|
||||
// {{SQL CARBON EDIT}}
|
||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||
const destination = getSnapBuildPath(arch);
|
||||
|
||||
return function () {
|
||||
@@ -203,11 +206,11 @@ function prepareSnapPackage(arch) {
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.applicationName}.png`))
|
||||
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.linuxIconName}.png`))
|
||||
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
|
||||
|
||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||
.pipe(rename(`usr/share/pixmaps/${product.applicationName}.png`));
|
||||
.pipe(rename(`usr/share/pixmaps/${product.linuxIconName}.png`));
|
||||
|
||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||
.pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; }));
|
||||
@@ -231,116 +234,36 @@ function buildSnapPackage(arch) {
|
||||
return shell.task(`cd ${snapBuildPath} && snapcraft build`);
|
||||
}
|
||||
|
||||
function getFlatpakArch(arch) {
|
||||
return { x64: 'x86_64', ia32: 'i386', arm: 'arm' }[arch];
|
||||
}
|
||||
const BUILD_TARGETS = [
|
||||
{ arch: 'ia32' },
|
||||
{ arch: 'x64' },
|
||||
{ arch: 'arm' },
|
||||
{ arch: 'arm64' },
|
||||
];
|
||||
|
||||
function prepareFlatpak(arch) {
|
||||
// {{SQL CARBON EDIT}}
|
||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||
const flatpakArch = getFlatpakArch(arch);
|
||||
const destination = '.build/linux/flatpak/' + flatpakArch;
|
||||
BUILD_TARGETS.forEach((buildTarget) => {
|
||||
const arch = buildTarget.arch;
|
||||
|
||||
return function () {
|
||||
// This is not imported in the global scope to avoid requiring ImageMagick
|
||||
// (or GraphicsMagick) when not building building Flatpak bundles.
|
||||
const imgResize = require('gulp-image-resize');
|
||||
|
||||
const all = [16, 24, 32, 48, 64, 128, 192, 256, 512].map(function (size) {
|
||||
return gulp.src('resources/linux/code.png', { base: '.' })
|
||||
.pipe(imgResize({ width: size, height: size, format: "png", noProfile: true }))
|
||||
.pipe(rename('share/icons/hicolor/' + size + 'x' + size + '/apps/' + flatpakManifest.appId + '.png'));
|
||||
});
|
||||
|
||||
all.push(gulp.src('resources/linux/code.desktop', { base: '.' })
|
||||
.pipe(replace('Exec=/usr/share/@@NAME@@/@@NAME@@', 'Exec=' + product.applicationName))
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||
.pipe(replace('@@NAME@@', product.applicationName))
|
||||
.pipe(rename('share/applications/' + flatpakManifest.appId + '.desktop')));
|
||||
|
||||
all.push(gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||
.pipe(replace('@@NAME@@', flatpakManifest.appId))
|
||||
.pipe(replace('@@LICENSE@@', product.licenseName))
|
||||
.pipe(rename('share/appdata/' + flatpakManifest.appId + '.appdata.xml')));
|
||||
|
||||
all.push(gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||
.pipe(rename(function (p) {
|
||||
p.dirname = 'share/' + product.applicationName + '/' + p.dirname;
|
||||
})));
|
||||
|
||||
return es.merge(all).pipe(vfs.dest(destination));
|
||||
};
|
||||
}
|
||||
|
||||
function buildFlatpak(arch) {
|
||||
const flatpakArch = getFlatpakArch(arch);
|
||||
const manifest = {};
|
||||
for (var k in flatpakManifest) {
|
||||
manifest[k] = flatpakManifest[k];
|
||||
{
|
||||
const debArch = getDebPackageArch(arch);
|
||||
const prepareDebTask = task.define(`vscode-linux-${arch}-prepare-deb`, task.series(util.rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch)));
|
||||
// gulp.task(prepareDebTask);
|
||||
const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, task.series(prepareDebTask, buildDebPackage(arch)));
|
||||
gulp.task(buildDebTask);
|
||||
}
|
||||
manifest.files = [
|
||||
['.build/linux/flatpak/' + flatpakArch, '/'],
|
||||
];
|
||||
const buildOptions = {
|
||||
arch: flatpakArch,
|
||||
subject: product.nameLong + ' ' + packageJson.version + '.' + linuxPackageRevision,
|
||||
};
|
||||
// If requested, use the configured path for the OSTree repository.
|
||||
if (process.env.FLATPAK_REPO) {
|
||||
buildOptions.repoDir = process.env.FLATPAK_REPO;
|
||||
} else {
|
||||
buildOptions.bundlePath = manifest.appId + '-' + flatpakArch + '.flatpak';
|
||||
|
||||
{
|
||||
const rpmArch = getRpmPackageArch(arch);
|
||||
const prepareRpmTask = task.define(`vscode-linux-${arch}-prepare-rpm`, task.series(util.rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch)));
|
||||
// gulp.task(prepareRpmTask);
|
||||
const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, task.series(prepareRpmTask, buildRpmPackage(arch)));
|
||||
gulp.task(buildRpmTask);
|
||||
}
|
||||
// Setup PGP signing if requested.
|
||||
if (process.env.GPG_KEY_ID !== undefined) {
|
||||
buildOptions.gpgSign = process.env.GPG_KEY_ID;
|
||||
if (process.env.GPG_HOMEDIR) {
|
||||
buildOptions.gpgHomedir = process.env.GPG_HOME_DIR;
|
||||
}
|
||||
|
||||
{
|
||||
const prepareSnapTask = task.define(`vscode-linux-${arch}-prepare-snap`, task.series(util.rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch)));
|
||||
gulp.task(prepareSnapTask);
|
||||
const buildSnapTask = task.define(`vscode-linux-${arch}-build-snap`, task.series(prepareSnapTask, buildSnapPackage(arch)));
|
||||
gulp.task(buildSnapTask);
|
||||
}
|
||||
return function (cb) {
|
||||
require('flatpak-bundler').bundle(manifest, buildOptions, cb);
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task('clean-vscode-linux-ia32-deb', util.rimraf('.build/linux/deb/i386'));
|
||||
gulp.task('clean-vscode-linux-x64-deb', util.rimraf('.build/linux/deb/amd64'));
|
||||
gulp.task('clean-vscode-linux-arm-deb', util.rimraf('.build/linux/deb/armhf'));
|
||||
gulp.task('clean-vscode-linux-arm64-deb', util.rimraf('.build/linux/deb/arm64'));
|
||||
gulp.task('clean-vscode-linux-ia32-rpm', util.rimraf('.build/linux/rpm/i386'));
|
||||
gulp.task('clean-vscode-linux-x64-rpm', util.rimraf('.build/linux/rpm/x86_64'));
|
||||
gulp.task('clean-vscode-linux-arm-rpm', util.rimraf('.build/linux/rpm/armhf'));
|
||||
gulp.task('clean-vscode-linux-arm64-rpm', util.rimraf('.build/linux/rpm/arm64'));
|
||||
gulp.task('clean-vscode-linux-ia32-snap', util.rimraf('.build/linux/snap/x64'));
|
||||
gulp.task('clean-vscode-linux-x64-snap', util.rimraf('.build/linux/snap/x64'));
|
||||
gulp.task('clean-vscode-linux-arm-snap', util.rimraf('.build/linux/snap/x64'));
|
||||
gulp.task('clean-vscode-linux-arm64-snap', util.rimraf('.build/linux/snap/x64'));
|
||||
|
||||
gulp.task('vscode-linux-ia32-prepare-deb', ['clean-vscode-linux-ia32-deb'], prepareDebPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb'], prepareDebPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-prepare-deb', ['clean-vscode-linux-arm-deb'], prepareDebPackage('arm'));
|
||||
gulp.task('vscode-linux-arm64-prepare-deb', ['clean-vscode-linux-arm64-deb'], prepareDebPackage('arm64'));
|
||||
gulp.task('vscode-linux-ia32-build-deb', ['vscode-linux-ia32-prepare-deb'], buildDebPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-build-deb', ['vscode-linux-x64-prepare-deb'], buildDebPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-build-deb', ['vscode-linux-arm-prepare-deb'], buildDebPackage('arm'));
|
||||
gulp.task('vscode-linux-arm64-build-deb', ['vscode-linux-arm64-prepare-deb'], buildDebPackage('arm64'));
|
||||
|
||||
gulp.task('vscode-linux-ia32-prepare-rpm', ['clean-vscode-linux-ia32-rpm'], prepareRpmPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-prepare-rpm', ['clean-vscode-linux-x64-rpm'], prepareRpmPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-prepare-rpm', ['clean-vscode-linux-arm-rpm'], prepareRpmPackage('arm'));
|
||||
gulp.task('vscode-linux-arm64-prepare-rpm', ['clean-vscode-linux-arm64-rpm'], prepareRpmPackage('arm64'));
|
||||
gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buildRpmPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-build-rpm', ['vscode-linux-x64-prepare-rpm'], buildRpmPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-build-rpm', ['vscode-linux-arm-prepare-rpm'], buildRpmPackage('arm'));
|
||||
gulp.task('vscode-linux-arm64-build-rpm', ['vscode-linux-arm64-prepare-rpm'], buildRpmPackage('arm64'));
|
||||
|
||||
gulp.task('vscode-linux-ia32-prepare-snap', ['clean-vscode-linux-ia32-snap'], prepareSnapPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-prepare-snap', ['clean-vscode-linux-x64-snap'], prepareSnapPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-prepare-snap', ['clean-vscode-linux-arm-snap'], prepareSnapPackage('arm'));
|
||||
gulp.task('vscode-linux-arm64-prepare-snap', ['clean-vscode-linux-arm64-snap'], prepareSnapPackage('arm64'));
|
||||
gulp.task('vscode-linux-ia32-build-snap', ['vscode-linux-ia32-prepare-snap'], buildSnapPackage('ia32'));
|
||||
gulp.task('vscode-linux-x64-build-snap', ['vscode-linux-x64-prepare-snap'], buildSnapPackage('x64'));
|
||||
gulp.task('vscode-linux-arm-build-snap', ['vscode-linux-arm-prepare-snap'], buildSnapPackage('arm'));
|
||||
gulp.task('vscode-linux-arm64-build-snap', ['vscode-linux-arm64-prepare-snap'], buildSnapPackage('arm64'));
|
||||
});
|
||||
|
||||
@@ -12,6 +12,7 @@ const assert = require('assert');
|
||||
const cp = require('child_process');
|
||||
const _7z = require('7zip')['7z'];
|
||||
const util = require('./lib/util');
|
||||
const task = require('./lib/task');
|
||||
const pkg = require('../package.json');
|
||||
const product = require('../product.json');
|
||||
const vfs = require('vinyl-fs');
|
||||
@@ -107,8 +108,8 @@ function buildWin32Setup(arch, target) {
|
||||
}
|
||||
|
||||
function defineWin32SetupTasks(arch, target) {
|
||||
gulp.task(`clean-vscode-win32-${arch}-${target}-setup`, util.rimraf(setupDir(arch, target)));
|
||||
gulp.task(`vscode-win32-${arch}-${target}-setup`, [`clean-vscode-win32-${arch}-${target}-setup`], buildWin32Setup(arch, target));
|
||||
const cleanTask = util.rimraf(setupDir(arch, target));
|
||||
gulp.task(task.define(`vscode-win32-${arch}-${target}-setup`, task.series(cleanTask, buildWin32Setup(arch, target))));
|
||||
}
|
||||
|
||||
defineWin32SetupTasks('ia32', 'system');
|
||||
@@ -126,11 +127,8 @@ function archiveWin32Setup(arch) {
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task('clean-vscode-win32-ia32-archive', util.rimraf(zipDir('ia32')));
|
||||
gulp.task('vscode-win32-ia32-archive', ['clean-vscode-win32-ia32-archive'], archiveWin32Setup('ia32'));
|
||||
|
||||
gulp.task('clean-vscode-win32-x64-archive', util.rimraf(zipDir('x64')));
|
||||
gulp.task('vscode-win32-x64-archive', ['clean-vscode-win32-x64-archive'], archiveWin32Setup('x64'));
|
||||
gulp.task(task.define('vscode-win32-ia32-archive', task.series(util.rimraf(zipDir('ia32')), archiveWin32Setup('ia32'))));
|
||||
gulp.task(task.define('vscode-win32-x64-archive', task.series(util.rimraf(zipDir('x64')), archiveWin32Setup('x64'))));
|
||||
|
||||
function copyInnoUpdater(arch) {
|
||||
return () => {
|
||||
@@ -139,9 +137,6 @@ function copyInnoUpdater(arch) {
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task('vscode-win32-ia32-copy-inno-updater', copyInnoUpdater('ia32'));
|
||||
gulp.task('vscode-win32-x64-copy-inno-updater', copyInnoUpdater('x64'));
|
||||
|
||||
function patchInnoUpdater(arch) {
|
||||
return cb => {
|
||||
const icon = path.join(repoPath, 'resources', 'win32', 'code.ico');
|
||||
@@ -149,5 +144,5 @@ function patchInnoUpdater(arch) {
|
||||
};
|
||||
}
|
||||
|
||||
gulp.task('vscode-win32-ia32-inno-updater', ['vscode-win32-ia32-copy-inno-updater'], patchInnoUpdater('ia32'));
|
||||
gulp.task('vscode-win32-x64-inno-updater', ['vscode-win32-x64-copy-inno-updater'], patchInnoUpdater('x64'));
|
||||
gulp.task(task.define('vscode-win32-ia32-inno-updater', task.series(copyInnoUpdater('ia32'), patchInnoUpdater('ia32'))));
|
||||
gulp.task(task.define('vscode-win32-x64-inno-updater', task.series(copyInnoUpdater('x64'), patchInnoUpdater('x64'))));
|
||||
@@ -14,7 +14,8 @@ const es = require('event-stream');
|
||||
const rename = require('gulp-rename');
|
||||
const vfs = require('vinyl-fs');
|
||||
const ext = require('./extensions');
|
||||
const util = require('gulp-util');
|
||||
const fancyLog = require('fancy-log');
|
||||
const ansiColors = require('ansi-colors');
|
||||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const builtInExtensions = require('../builtInExtensions.json');
|
||||
@@ -43,7 +44,7 @@ function isUpToDate(extension) {
|
||||
|
||||
function syncMarketplaceExtension(extension) {
|
||||
if (isUpToDate(extension)) {
|
||||
util.log(util.colors.blue('[marketplace]'), `${extension.name}@${extension.version}`, util.colors.green('✔︎'));
|
||||
fancyLog(ansiColors.blue('[marketplace]'), `${extension.name}@${extension.version}`, ansiColors.green('✔︎'));
|
||||
return es.readArray([]);
|
||||
}
|
||||
|
||||
@@ -52,13 +53,13 @@ function syncMarketplaceExtension(extension) {
|
||||
return ext.fromMarketplace(extension.name, extension.version, extension.metadata)
|
||||
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
|
||||
.pipe(vfs.dest('.build/builtInExtensions'))
|
||||
.on('end', () => util.log(util.colors.blue('[marketplace]'), extension.name, util.colors.green('✔︎')));
|
||||
.on('end', () => fancyLog(ansiColors.blue('[marketplace]'), extension.name, ansiColors.green('✔︎')));
|
||||
}
|
||||
|
||||
function syncExtension(extension, controlState) {
|
||||
switch (controlState) {
|
||||
case 'disabled':
|
||||
util.log(util.colors.blue('[disabled]'), util.colors.gray(extension.name));
|
||||
fancyLog(ansiColors.blue('[disabled]'), ansiColors.gray(extension.name));
|
||||
return es.readArray([]);
|
||||
|
||||
case 'marketplace':
|
||||
@@ -66,15 +67,15 @@ function syncExtension(extension, controlState) {
|
||||
|
||||
default:
|
||||
if (!fs.existsSync(controlState)) {
|
||||
util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
|
||||
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
|
||||
return es.readArray([]);
|
||||
|
||||
} else if (!fs.existsSync(path.join(controlState, 'package.json'))) {
|
||||
util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
|
||||
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
|
||||
return es.readArray([]);
|
||||
}
|
||||
|
||||
util.log(util.colors.blue('[local]'), `${extension.name}: ${util.colors.cyan(controlState)}`, util.colors.green('✔︎'));
|
||||
fancyLog(ansiColors.blue('[local]'), `${extension.name}: ${ansiColors.cyan(controlState)}`, ansiColors.green('✔︎'));
|
||||
return es.readArray([]);
|
||||
}
|
||||
}
|
||||
@@ -93,8 +94,8 @@ function writeControlFile(control) {
|
||||
}
|
||||
|
||||
function main() {
|
||||
util.log('Syncronizing built-in extensions...');
|
||||
util.log(`You can manage built-in extensions with the ${util.colors.cyan('--builtin')} flag`);
|
||||
fancyLog('Syncronizing built-in extensions...');
|
||||
fancyLog(`You can manage built-in extensions with the ${ansiColors.cyan('--builtin')} flag`);
|
||||
|
||||
const control = readControlFile();
|
||||
const streams = [];
|
||||
|
||||
@@ -16,7 +16,8 @@ const monacodts = require("../monaco/api");
|
||||
const nls = require("./nls");
|
||||
const reporter_1 = require("./reporter");
|
||||
const util = require("./util");
|
||||
const util2 = require("gulp-util");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const watch = require('./watch');
|
||||
const reporter = reporter_1.createReporter();
|
||||
function getTypeScriptCompilerOptions(src) {
|
||||
@@ -179,7 +180,7 @@ class MonacoGenerator {
|
||||
return r;
|
||||
}
|
||||
_log(message, ...rest) {
|
||||
util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||
}
|
||||
execute() {
|
||||
const startTime = Date.now();
|
||||
|
||||
@@ -17,7 +17,9 @@ import * as monacodts from '../monaco/api';
|
||||
import * as nls from './nls';
|
||||
import { createReporter } from './reporter';
|
||||
import * as util from './util';
|
||||
import * as util2 from 'gulp-util';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
|
||||
const watch = require('./watch');
|
||||
|
||||
const reporter = createReporter();
|
||||
@@ -218,7 +220,7 @@ class MonacoGenerator {
|
||||
}
|
||||
|
||||
private _log(message: any, ...rest: any[]): void {
|
||||
util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||
}
|
||||
|
||||
public execute(): void {
|
||||
|
||||
@@ -17,7 +17,8 @@ const remote = require("gulp-remote-src");
|
||||
const vzip = require('gulp-vinyl-zip');
|
||||
const filter = require("gulp-filter");
|
||||
const rename = require("gulp-rename");
|
||||
const util = require('gulp-util');
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const buffer = require('gulp-buffer');
|
||||
const json = require("gulp-json-editor");
|
||||
const webpack = require('webpack');
|
||||
@@ -136,7 +137,7 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
|
||||
.pipe(packageJsonFilter.restore);
|
||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
||||
const webpackDone = (err, stats) => {
|
||||
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
}
|
||||
@@ -214,7 +215,7 @@ const baseHeaders = {
|
||||
function fromMarketplace(extensionName, version, metadata) {
|
||||
const [publisher, name] = extensionName.split('.');
|
||||
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
||||
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...');
|
||||
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||
const options = {
|
||||
base: url,
|
||||
requestOptions: {
|
||||
|
||||
@@ -17,7 +17,8 @@ import remote = require('gulp-remote-src');
|
||||
const vzip = require('gulp-vinyl-zip');
|
||||
import filter = require('gulp-filter');
|
||||
import rename = require('gulp-rename');
|
||||
const util = require('gulp-util');
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
const buffer = require('gulp-buffer');
|
||||
import json = require('gulp-json-editor');
|
||||
const webpack = require('webpack');
|
||||
@@ -155,7 +156,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
|
||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
||||
|
||||
const webpackDone = (err: any, stats: any) => {
|
||||
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
}
|
||||
@@ -249,7 +250,7 @@ export function fromMarketplace(extensionName: string, version: string, metadata
|
||||
const [publisher, name] = extensionName.split('.');
|
||||
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
||||
|
||||
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...');
|
||||
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||
|
||||
const options = {
|
||||
base: url,
|
||||
|
||||
@@ -13,11 +13,12 @@ const xml2js = require("xml2js");
|
||||
const glob = require("glob");
|
||||
const https = require("https");
|
||||
const gulp = require("gulp");
|
||||
const util = require("gulp-util");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const iconv = require("iconv-lite");
|
||||
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
||||
function log(message, ...rest) {
|
||||
util.log(util.colors.green('[i18n]'), message, ...rest);
|
||||
fancyLog(ansiColors.green('[i18n]'), message, ...rest);
|
||||
}
|
||||
exports.defaultLanguages = [
|
||||
{ id: 'zh-tw', folderName: 'cht', transifexId: 'zh-hant' },
|
||||
@@ -490,7 +491,7 @@ function getResource(sourceFile) {
|
||||
else if (/^vs\/code/.test(sourceFile)) {
|
||||
return { name: 'vs/code', project: workbenchProject };
|
||||
}
|
||||
else if (/^vs\/workbench\/parts/.test(sourceFile)) {
|
||||
else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
|
||||
resource = sourceFile.split('/', 4).join('/');
|
||||
return { name: resource, project: workbenchProject };
|
||||
}
|
||||
@@ -578,7 +579,7 @@ function createXlfFilesForExtensions() {
|
||||
}
|
||||
return _xlf;
|
||||
}
|
||||
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`]).pipe(event_stream_1.through(function (file) {
|
||||
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(event_stream_1.through(function (file) {
|
||||
if (file.isBuffer()) {
|
||||
const buffer = file.contents;
|
||||
const basename = path.basename(file.path);
|
||||
@@ -1038,7 +1039,7 @@ function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pse
|
||||
let extensionsPacks = {};
|
||||
let errors = [];
|
||||
return event_stream_1.through(function (xlf) {
|
||||
let project = path.dirname(xlf.relative);
|
||||
let project = path.basename(path.dirname(xlf.relative));
|
||||
let resource = path.basename(xlf.relative, '.xlf');
|
||||
let contents = xlf.contents.toString();
|
||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||
|
||||
@@ -27,135 +27,151 @@
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/cli",
|
||||
"name": "vs/workbench/api/common",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/codeEditor",
|
||||
"name": "vs/workbench/contrib/cli",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/comments",
|
||||
"name": "vs/workbench/contrib/codeEditor",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/debug",
|
||||
"name": "vs/workbench/contrib/codeinset",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/emmet",
|
||||
"name": "vs/workbench/contrib/comments",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/execution",
|
||||
"name": "vs/workbench/contrib/debug",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/extensions",
|
||||
"name": "vs/workbench/contrib/emmet",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/feedback",
|
||||
"name": "vs/workbench/contrib/extensions",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/files",
|
||||
"name": "vs/workbench/contrib/externalTerminal",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/html",
|
||||
"name": "vs/workbench/contrib/feedback",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/markers",
|
||||
"name": "vs/workbench/contrib/files",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/localizations",
|
||||
"name": "vs/workbench/contrib/html",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/logs",
|
||||
"name": "vs/workbench/contrib/issue",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/output",
|
||||
"name": "vs/workbench/contrib/markers",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/performance",
|
||||
"name": "vs/workbench/contrib/localizations",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/preferences",
|
||||
"name": "vs/workbench/contrib/logs",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/quickopen",
|
||||
"name": "vs/workbench/contrib/output",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/relauncher",
|
||||
"name": "vs/workbench/contrib/performance",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/scm",
|
||||
"name": "vs/workbench/contrib/preferences",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/search",
|
||||
"name": "vs/workbench/contrib/quickopen",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/snippets",
|
||||
"name": "vs/workbench/contrib/relauncher",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/stats",
|
||||
"name": "vs/workbench/contrib/scm",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/surveys",
|
||||
"name": "vs/workbench/contrib/search",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/tasks",
|
||||
"name": "vs/workbench/contrib/snippets",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/terminal",
|
||||
"name": "vs/workbench/contrib/format",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/themes",
|
||||
"name": "vs/workbench/contrib/stats",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/trust",
|
||||
"name": "vs/workbench/contrib/surveys",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/update",
|
||||
"name": "vs/workbench/contrib/tasks",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/url",
|
||||
"name": "vs/workbench/contrib/terminal",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/watermark",
|
||||
"name": "vs/workbench/contrib/themes",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/webview",
|
||||
"name": "vs/workbench/contrib/trust",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/welcome",
|
||||
"name": "vs/workbench/contrib/update",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/parts/outline",
|
||||
"name": "vs/workbench/contrib/url",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/watermark",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/webview",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/welcome",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/contrib/outline",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
@@ -195,13 +211,17 @@
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/jsonschemas",
|
||||
"name": "vs/workbench/services/extensionManagement",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/files",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/integrity",
|
||||
"project": "vscode-workbench"
|
||||
},
|
||||
{
|
||||
"name": "vs/workbench/services/keybinding",
|
||||
"project": "vscode-workbench"
|
||||
|
||||
@@ -13,14 +13,14 @@ import * as xml2js from 'xml2js';
|
||||
import * as glob from 'glob';
|
||||
import * as https from 'https';
|
||||
import * as gulp from 'gulp';
|
||||
|
||||
import * as util from 'gulp-util';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
import * as iconv from 'iconv-lite';
|
||||
|
||||
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
||||
|
||||
function log(message: any, ...rest: any[]): void {
|
||||
util.log(util.colors.green('[i18n]'), message, ...rest);
|
||||
fancyLog(ansiColors.green('[i18n]'), message, ...rest);
|
||||
}
|
||||
|
||||
export interface Language {
|
||||
@@ -605,7 +605,7 @@ export function getResource(sourceFile: string): Resource {
|
||||
return { name: 'vs/base', project: editorProject };
|
||||
} else if (/^vs\/code/.test(sourceFile)) {
|
||||
return { name: 'vs/code', project: workbenchProject };
|
||||
} else if (/^vs\/workbench\/parts/.test(sourceFile)) {
|
||||
} else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
|
||||
resource = sourceFile.split('/', 4).join('/');
|
||||
return { name: resource, project: workbenchProject };
|
||||
} else if (/^vs\/workbench\/services/.test(sourceFile)) {
|
||||
@@ -692,7 +692,7 @@ export function createXlfFilesForExtensions(): ThroughStream {
|
||||
}
|
||||
return _xlf;
|
||||
}
|
||||
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`]).pipe(through(function (file: File) {
|
||||
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(through(function (file: File) {
|
||||
if (file.isBuffer()) {
|
||||
const buffer: Buffer = file.contents as Buffer;
|
||||
const basename = path.basename(file.path);
|
||||
@@ -1194,7 +1194,7 @@ export function prepareI18nPackFiles(externalExtensions: Map<string>, resultingT
|
||||
let extensionsPacks: Map<I18nPack> = {};
|
||||
let errors: any[] = [];
|
||||
return through(function (this: ThroughStream, xlf: File) {
|
||||
let project = path.dirname(xlf.relative);
|
||||
let project = path.basename(path.dirname(xlf.relative));
|
||||
let resource = path.basename(xlf.relative, '.xlf');
|
||||
let contents = xlf.contents.toString();
|
||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||
|
||||
@@ -13,7 +13,8 @@ const flatmap = require("gulp-flatmap");
|
||||
const sourcemaps = require("gulp-sourcemaps");
|
||||
const uglify = require("gulp-uglify");
|
||||
const composer = require("gulp-uglify/composer");
|
||||
const gulpUtil = require("gulp-util");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const path = require("path");
|
||||
const pump = require("pump");
|
||||
const uglifyes = require("uglify-es");
|
||||
@@ -24,7 +25,7 @@ const stats_1 = require("./stats");
|
||||
const util = require("./util");
|
||||
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||
function log(prefix, message) {
|
||||
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message);
|
||||
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
|
||||
}
|
||||
// {{SQL CARBON EDIT}}
|
||||
function loaderConfig(emptyPaths) {
|
||||
@@ -115,7 +116,6 @@ function toBundleStream(src, bundledFileHeader, bundles) {
|
||||
function optimizeTask(opts) {
|
||||
const src = opts.src;
|
||||
const entryPoints = opts.entryPoints;
|
||||
const otherSources = opts.otherSources;
|
||||
const resources = opts.resources;
|
||||
const loaderConfig = opts.loaderConfig;
|
||||
const bundledFileHeader = opts.header;
|
||||
@@ -138,7 +138,7 @@ function optimizeTask(opts) {
|
||||
}
|
||||
filteredResources.push('!' + resource);
|
||||
});
|
||||
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream);
|
||||
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||
const bundleInfoArray = [];
|
||||
if (opts.bundleInfo) {
|
||||
bundleInfoArray.push(new VinylFile({
|
||||
@@ -149,20 +149,7 @@ function optimizeTask(opts) {
|
||||
}
|
||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||
});
|
||||
const otherSourcesStream = es.through();
|
||||
const otherSourcesStreamArr = [];
|
||||
gulp.src(otherSources, { base: `${src}` })
|
||||
.pipe(es.through(function (data) {
|
||||
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
|
||||
}, function () {
|
||||
if (!otherSourcesStreamArr.length) {
|
||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
||||
}
|
||||
else {
|
||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
||||
}
|
||||
}));
|
||||
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream);
|
||||
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, resourcesStream, bundleInfoStream);
|
||||
return result
|
||||
.pipe(sourcemaps.write('./', {
|
||||
sourceRoot: undefined,
|
||||
@@ -225,7 +212,12 @@ function minifyTask(src, sourceMapBaseUrl) {
|
||||
return cb => {
|
||||
const jsFilter = filter('**/*.js', { restore: true });
|
||||
const cssFilter = filter('**/*.css', { restore: true });
|
||||
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.write('./', {
|
||||
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.mapSources((sourcePath) => {
|
||||
if (sourcePath === 'bootstrap-fork.js') {
|
||||
return 'bootstrap-fork.orig.js';
|
||||
}
|
||||
return sourcePath;
|
||||
}), sourcemaps.write('./', {
|
||||
sourceMappingURL,
|
||||
sourceRoot: undefined,
|
||||
includeContent: true,
|
||||
|
||||
@@ -14,7 +14,8 @@ import * as flatmap from 'gulp-flatmap';
|
||||
import * as sourcemaps from 'gulp-sourcemaps';
|
||||
import * as uglify from 'gulp-uglify';
|
||||
import * as composer from 'gulp-uglify/composer';
|
||||
import * as gulpUtil from 'gulp-util';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
import * as path from 'path';
|
||||
import * as pump from 'pump';
|
||||
import * as sm from 'source-map';
|
||||
@@ -28,7 +29,7 @@ import * as util from './util';
|
||||
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||
|
||||
function log(prefix: string, message: string): void {
|
||||
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message);
|
||||
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
@@ -143,10 +144,6 @@ export interface IOptimizeTaskOpts {
|
||||
* (for AMD files, will get bundled and get Copyright treatment)
|
||||
*/
|
||||
entryPoints: bundle.IEntryPoint[];
|
||||
/**
|
||||
* (for non-AMD files that should get Copyright treatment)
|
||||
*/
|
||||
otherSources: string[];
|
||||
/**
|
||||
* (svg, etc.)
|
||||
*/
|
||||
@@ -177,7 +174,6 @@ export interface IOptimizeTaskOpts {
|
||||
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
|
||||
const src = opts.src;
|
||||
const entryPoints = opts.entryPoints;
|
||||
const otherSources = opts.otherSources;
|
||||
const resources = opts.resources;
|
||||
const loaderConfig = opts.loaderConfig;
|
||||
const bundledFileHeader = opts.header;
|
||||
@@ -202,7 +198,7 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
||||
}
|
||||
filteredResources.push('!' + resource);
|
||||
});
|
||||
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream);
|
||||
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||
|
||||
const bundleInfoArray: VinylFile[] = [];
|
||||
if (opts.bundleInfo) {
|
||||
@@ -215,24 +211,9 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||
});
|
||||
|
||||
const otherSourcesStream = es.through();
|
||||
const otherSourcesStreamArr: NodeJS.ReadWriteStream[] = [];
|
||||
|
||||
gulp.src(otherSources, { base: `${src}` })
|
||||
.pipe(es.through(function (data) {
|
||||
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
|
||||
}, function () {
|
||||
if (!otherSourcesStreamArr.length) {
|
||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
||||
} else {
|
||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
||||
}
|
||||
}));
|
||||
|
||||
const result = es.merge(
|
||||
loader(src, bundledFileHeader, bundleLoader),
|
||||
bundlesStream,
|
||||
otherSourcesStream,
|
||||
resourcesStream,
|
||||
bundleInfoStream
|
||||
);
|
||||
@@ -319,6 +300,13 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
||||
cssFilter,
|
||||
minifyCSS({ reduceIdents: false }),
|
||||
cssFilter.restore,
|
||||
(<any>sourcemaps).mapSources((sourcePath: string) => {
|
||||
if (sourcePath === 'bootstrap-fork.js') {
|
||||
return 'bootstrap-fork.orig.js';
|
||||
}
|
||||
|
||||
return sourcePath;
|
||||
}),
|
||||
sourcemaps.write('./', {
|
||||
sourceMappingURL,
|
||||
sourceRoot: undefined,
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const es = require("event-stream");
|
||||
const _ = require("underscore");
|
||||
const util = require("gulp-util");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const allErrors = [];
|
||||
@@ -17,7 +18,7 @@ function onStart() {
|
||||
return;
|
||||
}
|
||||
startTime = new Date().getTime();
|
||||
util.log(`Starting ${util.colors.green('compilation')}...`);
|
||||
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
|
||||
}
|
||||
function onEnd() {
|
||||
if (--count > 0) {
|
||||
@@ -38,7 +39,7 @@ function log() {
|
||||
errors.map(err => {
|
||||
if (!seen.has(err)) {
|
||||
seen.add(err);
|
||||
util.log(`${util.colors.red('Error')}: ${err}`);
|
||||
fancyLog(`${ansiColors.red('Error')}: ${err}`);
|
||||
}
|
||||
});
|
||||
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
||||
@@ -53,7 +54,7 @@ function log() {
|
||||
catch (err) {
|
||||
//noop
|
||||
}
|
||||
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime) + ' ms')}`);
|
||||
fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime) + ' ms')}`);
|
||||
}
|
||||
function createReporter() {
|
||||
const errors = [];
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
|
||||
import * as es from 'event-stream';
|
||||
import * as _ from 'underscore';
|
||||
import * as util from 'gulp-util';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
@@ -21,7 +22,7 @@ function onStart(): void {
|
||||
}
|
||||
|
||||
startTime = new Date().getTime();
|
||||
util.log(`Starting ${util.colors.green('compilation')}...`);
|
||||
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
|
||||
}
|
||||
|
||||
function onEnd(): void {
|
||||
@@ -47,7 +48,7 @@ function log(): void {
|
||||
errors.map(err => {
|
||||
if (!seen.has(err)) {
|
||||
seen.add(err);
|
||||
util.log(`${util.colors.red('Error')}: ${err}`);
|
||||
fancyLog(`${ansiColors.red('Error')}: ${err}`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -65,7 +66,7 @@ function log(): void {
|
||||
//noop
|
||||
}
|
||||
|
||||
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
|
||||
fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
|
||||
}
|
||||
|
||||
export interface IReporter {
|
||||
|
||||
@@ -27,7 +27,7 @@ function writeFile(filePath, contents) {
|
||||
fs.writeFileSync(filePath, contents);
|
||||
}
|
||||
function extractEditor(options) {
|
||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.json')).toString());
|
||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
|
||||
let compilerOptions;
|
||||
if (tsConfig.extends) {
|
||||
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
||||
@@ -36,13 +36,11 @@ function extractEditor(options) {
|
||||
compilerOptions = tsConfig.compilerOptions;
|
||||
}
|
||||
tsConfig.compilerOptions = compilerOptions;
|
||||
compilerOptions.noEmit = false;
|
||||
compilerOptions.noUnusedLocals = false;
|
||||
compilerOptions.preserveConstEnums = false;
|
||||
compilerOptions.declaration = false;
|
||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||
delete compilerOptions.types;
|
||||
delete tsConfig.extends;
|
||||
tsConfig.exclude = [];
|
||||
options.compilerOptions = compilerOptions;
|
||||
let result = tss.shake(options);
|
||||
for (let fileName in result) {
|
||||
|
||||
@@ -31,7 +31,7 @@ function writeFile(filePath: string, contents: Buffer | string): void {
|
||||
}
|
||||
|
||||
export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: string }): void {
|
||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.json')).toString());
|
||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
|
||||
let compilerOptions: { [key: string]: any };
|
||||
if (tsConfig.extends) {
|
||||
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
||||
@@ -40,14 +40,12 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
|
||||
}
|
||||
tsConfig.compilerOptions = compilerOptions;
|
||||
|
||||
compilerOptions.noEmit = false;
|
||||
compilerOptions.noUnusedLocals = false;
|
||||
compilerOptions.preserveConstEnums = false;
|
||||
compilerOptions.declaration = false;
|
||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||
|
||||
delete compilerOptions.types;
|
||||
delete tsConfig.extends;
|
||||
tsConfig.exclude = [];
|
||||
|
||||
options.compilerOptions = compilerOptions;
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const es = require("event-stream");
|
||||
const util = require("gulp-util");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const appInsights = require("applicationinsights");
|
||||
class Entry {
|
||||
constructor(name, totalCount, totalSize) {
|
||||
@@ -24,13 +25,13 @@ class Entry {
|
||||
}
|
||||
else {
|
||||
if (this.totalCount === 1) {
|
||||
return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||
return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||
}
|
||||
else {
|
||||
const count = this.totalCount < 100
|
||||
? util.colors.green(this.totalCount.toString())
|
||||
: util.colors.red(this.totalCount.toString());
|
||||
return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||
? ansiColors.green(this.totalCount.toString())
|
||||
: ansiColors.red(this.totalCount.toString());
|
||||
return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,13 +58,13 @@ function createStatsStream(group, log) {
|
||||
}, function () {
|
||||
if (log) {
|
||||
if (entry.totalCount === 1) {
|
||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
}
|
||||
else {
|
||||
const count = entry.totalCount < 100
|
||||
? util.colors.green(entry.totalCount.toString())
|
||||
: util.colors.red(entry.totalCount.toString());
|
||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
? ansiColors.green(entry.totalCount.toString())
|
||||
: ansiColors.red(entry.totalCount.toString());
|
||||
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
}
|
||||
}
|
||||
this.emit('end');
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
'use strict';
|
||||
|
||||
import * as es from 'event-stream';
|
||||
import * as util from 'gulp-util';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
import * as File from 'vinyl';
|
||||
import * as appInsights from 'applicationinsights';
|
||||
|
||||
@@ -22,14 +23,14 @@ class Entry {
|
||||
}
|
||||
} else {
|
||||
if (this.totalCount === 1) {
|
||||
return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||
return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||
|
||||
} else {
|
||||
const count = this.totalCount < 100
|
||||
? util.colors.green(this.totalCount.toString())
|
||||
: util.colors.red(this.totalCount.toString());
|
||||
? ansiColors.green(this.totalCount.toString())
|
||||
: ansiColors.red(this.totalCount.toString());
|
||||
|
||||
return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||
return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,14 +59,14 @@ export function createStatsStream(group: string, log?: boolean): es.ThroughStrea
|
||||
}, function () {
|
||||
if (log) {
|
||||
if (entry.totalCount === 1) {
|
||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
|
||||
} else {
|
||||
const count = entry.totalCount < 100
|
||||
? util.colors.green(entry.totalCount.toString())
|
||||
: util.colors.red(entry.totalCount.toString());
|
||||
? ansiColors.green(entry.totalCount.toString())
|
||||
: ansiColors.red(entry.totalCount.toString());
|
||||
|
||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
96
build/lib/task.js
Normal file
96
build/lib/task.js
Normal file
@@ -0,0 +1,96 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
function _isPromise(p) {
|
||||
if (typeof p.then === 'function') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function _renderTime(time) {
|
||||
return `${Math.round(time)} ms`;
|
||||
}
|
||||
async function _execute(task) {
|
||||
const name = task.taskName || task.displayName || `<anonymous>`;
|
||||
if (!task._tasks) {
|
||||
fancyLog('Starting', ansiColors.cyan(name), '...');
|
||||
}
|
||||
const startTime = process.hrtime();
|
||||
await _doExecute(task);
|
||||
const elapsedArr = process.hrtime(startTime);
|
||||
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
|
||||
if (!task._tasks) {
|
||||
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.magenta(_renderTime(elapsedNanoseconds / 1e6)));
|
||||
}
|
||||
}
|
||||
async function _doExecute(task) {
|
||||
// Always invoke as if it were a callback task
|
||||
return new Promise((resolve, reject) => {
|
||||
if (task.length === 1) {
|
||||
// this is a calback task
|
||||
task((err) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
return;
|
||||
}
|
||||
const taskResult = task();
|
||||
if (typeof taskResult === 'undefined') {
|
||||
// this is a sync task
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
if (_isPromise(taskResult)) {
|
||||
// this is a promise returning task
|
||||
taskResult.then(resolve, reject);
|
||||
return;
|
||||
}
|
||||
// this is a stream returning task
|
||||
taskResult.on('end', _ => resolve());
|
||||
taskResult.on('error', err => reject(err));
|
||||
});
|
||||
}
|
||||
function series(...tasks) {
|
||||
const result = async () => {
|
||||
for (let i = 0; i < tasks.length; i++) {
|
||||
await _execute(tasks[i]);
|
||||
}
|
||||
};
|
||||
result._tasks = tasks;
|
||||
return result;
|
||||
}
|
||||
exports.series = series;
|
||||
function parallel(...tasks) {
|
||||
const result = async () => {
|
||||
await Promise.all(tasks.map(t => _execute(t)));
|
||||
};
|
||||
result._tasks = tasks;
|
||||
return result;
|
||||
}
|
||||
exports.parallel = parallel;
|
||||
function define(name, task) {
|
||||
if (task._tasks) {
|
||||
// This is a composite task
|
||||
const lastTask = task._tasks[task._tasks.length - 1];
|
||||
if (lastTask._tasks || lastTask.taskName) {
|
||||
// This is a composite task without a real task function
|
||||
// => generate a fake task function
|
||||
return define(name, series(task, () => Promise.resolve()));
|
||||
}
|
||||
lastTask.taskName = name;
|
||||
task.displayName = name;
|
||||
return task;
|
||||
}
|
||||
// This is a simple task
|
||||
task.taskName = name;
|
||||
task.displayName = name;
|
||||
return task;
|
||||
}
|
||||
exports.define = define;
|
||||
125
build/lib/task.ts
Normal file
125
build/lib/task.ts
Normal file
@@ -0,0 +1,125 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
|
||||
export interface BaseTask {
|
||||
displayName?: string;
|
||||
taskName?: string;
|
||||
_tasks?: Task[];
|
||||
}
|
||||
export interface PromiseTask extends BaseTask {
|
||||
(): Promise<void>;
|
||||
}
|
||||
export interface StreamTask extends BaseTask {
|
||||
(): NodeJS.ReadWriteStream;
|
||||
}
|
||||
export interface CallbackTask extends BaseTask {
|
||||
(cb?: (err?: any) => void): void;
|
||||
}
|
||||
|
||||
export type Task = PromiseTask | StreamTask | CallbackTask;
|
||||
|
||||
function _isPromise(p: Promise<void> | NodeJS.ReadWriteStream): p is Promise<void> {
|
||||
if (typeof (<any>p).then === 'function') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function _renderTime(time: number): string {
|
||||
return `${Math.round(time)} ms`;
|
||||
}
|
||||
|
||||
async function _execute(task: Task): Promise<void> {
|
||||
const name = task.taskName || task.displayName || `<anonymous>`;
|
||||
if (!task._tasks) {
|
||||
fancyLog('Starting', ansiColors.cyan(name), '...');
|
||||
}
|
||||
const startTime = process.hrtime();
|
||||
await _doExecute(task);
|
||||
const elapsedArr = process.hrtime(startTime);
|
||||
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
|
||||
if (!task._tasks) {
|
||||
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.magenta(_renderTime(elapsedNanoseconds / 1e6)));
|
||||
}
|
||||
}
|
||||
|
||||
async function _doExecute(task: Task): Promise<void> {
|
||||
// Always invoke as if it were a callback task
|
||||
return new Promise((resolve, reject) => {
|
||||
if (task.length === 1) {
|
||||
// this is a calback task
|
||||
task((err) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const taskResult = task();
|
||||
|
||||
if (typeof taskResult === 'undefined') {
|
||||
// this is a sync task
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_isPromise(taskResult)) {
|
||||
// this is a promise returning task
|
||||
taskResult.then(resolve, reject);
|
||||
return;
|
||||
}
|
||||
|
||||
// this is a stream returning task
|
||||
taskResult.on('end', _ => resolve());
|
||||
taskResult.on('error', err => reject(err));
|
||||
});
|
||||
}
|
||||
|
||||
export function series(...tasks: Task[]): PromiseTask {
|
||||
const result = async () => {
|
||||
for (let i = 0; i < tasks.length; i++) {
|
||||
await _execute(tasks[i]);
|
||||
}
|
||||
};
|
||||
result._tasks = tasks;
|
||||
return result;
|
||||
}
|
||||
|
||||
export function parallel(...tasks: Task[]): PromiseTask {
|
||||
const result = async () => {
|
||||
await Promise.all(tasks.map(t => _execute(t)));
|
||||
};
|
||||
result._tasks = tasks;
|
||||
return result;
|
||||
}
|
||||
|
||||
export function define(name: string, task: Task): Task {
|
||||
if (task._tasks) {
|
||||
// This is a composite task
|
||||
const lastTask = task._tasks[task._tasks.length - 1];
|
||||
|
||||
if (lastTask._tasks || lastTask.taskName) {
|
||||
// This is a composite task without a real task function
|
||||
// => generate a fake task function
|
||||
return define(name, series(task, () => Promise.resolve()));
|
||||
}
|
||||
|
||||
lastTask.taskName = name;
|
||||
task.displayName = name;
|
||||
return task;
|
||||
}
|
||||
|
||||
// This is a simple task
|
||||
task.taskName = name;
|
||||
task.displayName = name;
|
||||
return task;
|
||||
}
|
||||
@@ -27,13 +27,13 @@ suite('XLF Parser Tests', () => {
|
||||
});
|
||||
test('JSON file source path to Transifex resource match', () => {
|
||||
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench';
|
||||
const platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject };
|
||||
const platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject };
|
||||
assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform);
|
||||
assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib);
|
||||
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
||||
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
||||
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
||||
assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts);
|
||||
assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
|
||||
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
||||
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@ suite('XLF Parser Tests', () => {
|
||||
editor = { name: 'vs/editor', project: editorProject },
|
||||
base = { name: 'vs/base', project: editorProject },
|
||||
code = { name: 'vs/code', project: workbenchProject },
|
||||
workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject },
|
||||
workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject },
|
||||
workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject },
|
||||
workbench = { name: 'vs/workbench', project: workbenchProject};
|
||||
|
||||
@@ -47,7 +47,7 @@ suite('XLF Parser Tests', () => {
|
||||
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
||||
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
||||
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
||||
assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts);
|
||||
assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
|
||||
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
||||
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
|
||||
visitImportLikeDeclaration(node) {
|
||||
const currentFile = node.getSourceFile().fileName;
|
||||
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
||||
const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/);
|
||||
const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
|
||||
if (!matchService && !matchPart) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
|
||||
private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) {
|
||||
const currentFile = node.getSourceFile().fileName;
|
||||
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
||||
const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/);
|
||||
const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
|
||||
if (!matchService && !matchPart) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ const fs = require("fs");
|
||||
const _rimraf = require("rimraf");
|
||||
const git = require("./git");
|
||||
const VinylFile = require("vinyl");
|
||||
const download_1 = require("../download/download");
|
||||
const REPO_ROOT = path.join(__dirname, '../../');
|
||||
const NoCancellationToken = { isCancellationRequested: () => false };
|
||||
function incremental(streamProvider, initial, supportsCancellation) {
|
||||
const input = es.through();
|
||||
@@ -180,7 +182,8 @@ function rimraf(dir) {
|
||||
return cb(err);
|
||||
});
|
||||
};
|
||||
return cb => retry(cb);
|
||||
retry.taskName = `clean-${path.basename(dir)}`;
|
||||
return retry;
|
||||
}
|
||||
exports.rimraf = rimraf;
|
||||
function getVersion(root) {
|
||||
@@ -220,3 +223,38 @@ function versionStringToNumber(versionStr) {
|
||||
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
||||
}
|
||||
exports.versionStringToNumber = versionStringToNumber;
|
||||
function download(requestOptions) {
|
||||
const result = es.through();
|
||||
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
|
||||
const opts = {
|
||||
requestOptions: requestOptions,
|
||||
destinationPath: filename
|
||||
};
|
||||
download_1.downloadInExternalProcess(opts).then(() => {
|
||||
fs.stat(filename, (err, stat) => {
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
return;
|
||||
}
|
||||
fs.readFile(filename, (err, data) => {
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
return;
|
||||
}
|
||||
fs.unlink(filename, () => {
|
||||
result.emit('data', new VinylFile({
|
||||
path: path.normalize(requestOptions.path),
|
||||
stat: stat,
|
||||
base: path.normalize(requestOptions.path),
|
||||
contents: data
|
||||
}));
|
||||
result.emit('end');
|
||||
});
|
||||
});
|
||||
});
|
||||
}, (err) => {
|
||||
result.emit('error', err);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
exports.download = download;
|
||||
|
||||
@@ -17,6 +17,9 @@ import * as git from './git';
|
||||
import * as VinylFile from 'vinyl';
|
||||
import { ThroughStream } from 'through';
|
||||
import * as sm from 'source-map';
|
||||
import { IDownloadOptions, downloadInExternalProcess, IDownloadRequestOptions } from '../download/download';
|
||||
|
||||
const REPO_ROOT = path.join(__dirname, '../../');
|
||||
|
||||
export interface ICancellationToken {
|
||||
isCancellationRequested(): boolean;
|
||||
@@ -233,8 +236,8 @@ export function rimraf(dir: string): (cb: any) => void {
|
||||
return cb(err);
|
||||
});
|
||||
};
|
||||
|
||||
return cb => retry(cb);
|
||||
retry.taskName = `clean-${path.basename(dir)}`;
|
||||
return retry;
|
||||
}
|
||||
|
||||
export function getVersion(root: string): string | undefined {
|
||||
@@ -280,3 +283,38 @@ export function versionStringToNumber(versionStr: string) {
|
||||
|
||||
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
|
||||
}
|
||||
|
||||
export function download(requestOptions: IDownloadRequestOptions): NodeJS.ReadWriteStream {
|
||||
const result = es.through();
|
||||
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
|
||||
const opts: IDownloadOptions = {
|
||||
requestOptions: requestOptions,
|
||||
destinationPath: filename
|
||||
};
|
||||
downloadInExternalProcess(opts).then(() => {
|
||||
fs.stat(filename, (err, stat) => {
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
return;
|
||||
}
|
||||
fs.readFile(filename, (err, data) => {
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
return;
|
||||
}
|
||||
fs.unlink(filename, () => {
|
||||
result.emit('data', new VinylFile({
|
||||
path: path.normalize(requestOptions.path),
|
||||
stat: stat,
|
||||
base: path.normalize(requestOptions.path),
|
||||
contents: data
|
||||
}));
|
||||
result.emit('end');
|
||||
});
|
||||
});
|
||||
});
|
||||
}, (err) => {
|
||||
result.emit('error', err);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,31 @@ herein, whether by implication, estoppel or otherwise.
|
||||
|
||||
|
||||
|
||||
%% nodejs path library (https://github.com/nodejs/node/tree/43dd49c9782848c25e5b03448c8a0f923f13c158)
|
||||
=========================================
|
||||
Copyright Joyent, Inc. and other Node contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
=========================================
|
||||
END OF nodejs path library NOTICES AND INFORMATION
|
||||
|
||||
|
||||
%% promise-polyfill version 8.1.0 (https://github.com/taylorhakes/promise-polyfill)
|
||||
=========================================
|
||||
|
||||
@@ -7,14 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = require("fs");
|
||||
const ts = require("typescript");
|
||||
const path = require("path");
|
||||
const util = require("gulp-util");
|
||||
const fancyLog = require("fancy-log");
|
||||
const ansiColors = require("ansi-colors");
|
||||
const dtsv = '2';
|
||||
const tsfmt = require('../../tsfmt.json');
|
||||
const SRC = path.join(__dirname, '../../src');
|
||||
exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
||||
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||
function logErr(message, ...rest) {
|
||||
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||
fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||
}
|
||||
function isDeclaration(a) {
|
||||
return (a.kind === ts.SyntaxKind.InterfaceDeclaration
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
import * as fs from 'fs';
|
||||
import * as ts from 'typescript';
|
||||
import * as path from 'path';
|
||||
import * as util from 'gulp-util';
|
||||
import * as fancyLog from 'fancy-log';
|
||||
import * as ansiColors from 'ansi-colors';
|
||||
|
||||
const dtsv = '2';
|
||||
|
||||
@@ -17,7 +18,7 @@ export const RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
||||
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||
|
||||
function logErr(message: any, ...rest: any[]): void {
|
||||
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||
fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||
}
|
||||
|
||||
type SourceFileGetter = (moduleId: string) => ts.SourceFile | null;
|
||||
|
||||
@@ -10,8 +10,10 @@ import { CountBadge } from './vs/base/browser/ui/countBadge/countBadge';
|
||||
import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker';
|
||||
import { create as create2 } from './vs/editor/common/services/editorSimpleWorker';
|
||||
import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget';
|
||||
import { WorkbenchAsyncDataTree } from './vs/platform/list/browser/listService';
|
||||
import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors';
|
||||
import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator';
|
||||
import { DocumentRangeFormattingEditProvider } from './vs/editor/common/modes';
|
||||
import * as editorAPI from './vs/editor/editor.api';
|
||||
|
||||
(function () {
|
||||
@@ -22,6 +24,7 @@ import * as editorAPI from './vs/editor/editor.api';
|
||||
a = (<IWorkspaceContextService>b).getWorkspace; // IWorkspaceFolderProvider
|
||||
a = (<CountBadge>b).style; // IThemable
|
||||
a = (<QuickOpenWidget>b).style; // IThemable
|
||||
a = (<WorkbenchAsyncDataTree<any,any>>b).style; // IThemable
|
||||
a = (<IEnvironmentService>b).userHome; // IUserHomeProvider
|
||||
a = (<DiffNavigator>b).previous; // IDiffNavigator
|
||||
a = (<ServiceIdentifier<any>>b).type;
|
||||
@@ -30,6 +33,7 @@ import * as editorAPI from './vs/editor/editor.api';
|
||||
a = (<SimpleWorkerClient<any>>b).getProxyObject; // IWorkerClient
|
||||
a = create1;
|
||||
a = create2;
|
||||
a = (<DocumentRangeFormattingEditProvider>b).extensionId;
|
||||
|
||||
// injection madness
|
||||
a = (<SyncDescriptor0<any>>b).ctor;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "monaco-editor-core",
|
||||
"private": true,
|
||||
"version": "0.14.3",
|
||||
"version": "0.16.0",
|
||||
"description": "A browser based code editor",
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
|
||||
0
build/monaco/version.txt
Normal file
0
build/monaco/version.txt
Normal file
@@ -12,6 +12,8 @@ var cson = require('cson-parser');
|
||||
var https = require('https');
|
||||
var url = require('url');
|
||||
|
||||
let commitDate = '0000-00-00';
|
||||
|
||||
/**
|
||||
* @param {string} urlString
|
||||
*/
|
||||
@@ -120,30 +122,35 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'mas
|
||||
|
||||
try {
|
||||
fs.writeFileSync(dest, JSON.stringify(result, null, '\t').replace(/\n/g, '\r\n'));
|
||||
// Add commit sha to cgmanifest
|
||||
let cgmanifestRead = JSON.parse(fs.readFileSync('./cgmanifest.json').toString());
|
||||
let promises = new Array();
|
||||
let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`;
|
||||
for (let i = 0; i < cgmanifestRead.registrations.length; i++) {
|
||||
if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) {
|
||||
cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha;
|
||||
promises.push(download(packageJsonPath).then(function (packageJson) {
|
||||
if (packageJson) {
|
||||
try {
|
||||
cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version;
|
||||
} catch (e) {
|
||||
console.log('File does not exist at' + packageJsonPath);
|
||||
}
|
||||
}
|
||||
}));
|
||||
break;
|
||||
const currentCommitDate = info.commitDate.substr(0, 10);
|
||||
|
||||
// Add commit sha to cgmanifest.
|
||||
if (currentCommitDate > commitDate) {
|
||||
let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`;
|
||||
for (let i = 0; i < cgmanifestRead.registrations.length; i++) {
|
||||
if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) {
|
||||
cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha;
|
||||
commitDate = currentCommitDate;
|
||||
promises.push(download(packageJsonPath).then(function (packageJson) {
|
||||
if (packageJson) {
|
||||
try {
|
||||
cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version;
|
||||
} catch (e) {
|
||||
console.log('Cannot get version. File does not exist at ' + packageJsonPath);
|
||||
}
|
||||
}
|
||||
}));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Promise.all(promises).then(function (allResult) {
|
||||
fs.writeFileSync('./cgmanifest.json', JSON.stringify(cgmanifestRead, null, '\t').replace(/\n/g, '\r\n'));
|
||||
});
|
||||
if (info) {
|
||||
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')');
|
||||
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + currentCommitDate + ')');
|
||||
} else {
|
||||
console.log('Updated ' + path.basename(dest));
|
||||
}
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
"name": "azuredatastudio-oss-dev-build",
|
||||
"version": "1.0.0",
|
||||
"devDependencies": {
|
||||
"@types/ansi-colors": "^3.2.0",
|
||||
"@types/azure": "0.9.19",
|
||||
"@types/debounce": "^1.0.0",
|
||||
"@types/documentdb": "1.10.2",
|
||||
"@types/fancy-log": "^1.3.0",
|
||||
"@types/glob": "^7.1.1",
|
||||
"@types/gulp": "^4.0.5",
|
||||
"@types/gulp-concat": "^0.0.32",
|
||||
@@ -13,7 +15,6 @@
|
||||
"@types/gulp-rename": "^0.0.33",
|
||||
"@types/gulp-sourcemaps": "^0.0.32",
|
||||
"@types/gulp-uglify": "^3.0.5",
|
||||
"@types/gulp-util": "^3.0.34",
|
||||
"@types/mime": "0.0.29",
|
||||
"@types/minimatch": "^3.0.3",
|
||||
"@types/minimist": "^1.2.0",
|
||||
@@ -42,7 +43,7 @@
|
||||
"request": "^2.85.0",
|
||||
"tslint": "^5.9.1",
|
||||
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
|
||||
"typescript": "3.2.2",
|
||||
"typescript": "3.3.1",
|
||||
"vsce": "1.48.0",
|
||||
"xml2js": "^0.4.17"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#define LocalizedLanguageFile(Language = "") \
|
||||
DirExists(RepoDir + "\licenses") && Language != "" \
|
||||
? ('; LicenseFile: "' + RepoDir + '\licenses\LICENSE-' + Language + '.txt"') \
|
||||
: '; LicenseFile: "' + RepoDir + '\LICENSE.txt"'
|
||||
? ('; LicenseFile: "' + RepoDir + '\licenses\LICENSE-' + Language + '.rtf"') \
|
||||
: '; LicenseFile: "' + RepoDir + '\LICENSE.rtf"'
|
||||
|
||||
[Setup]
|
||||
AppId={#AppId}
|
||||
|
||||
784
build/yarn.lock
784
build/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user