Skip to content

Commit c510eff

Browse files
committed
Merge branch 'master' into joh/remote
2 parents 0d86cf5 + 10a5cee commit c510eff

182 files changed

Lines changed: 5091 additions & 2812 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/gulpfile.hygiene.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ const copyrightFilter = [
9999

100100
const eslintFilter = [
101101
'src/**/*.js',
102+
'build/gulpfile.*.js',
102103
'!src/vs/loader.js',
103104
'!src/vs/css.js',
104105
'!src/vs/nls.js',

build/gulpfile.vscode.js

Lines changed: 10 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ const shrinkwrap = require('../npm-shrinkwrap.json');
3131
const crypto = require('crypto');
3232
const i18n = require('./lib/i18n');
3333
const glob = require('glob');
34-
const os = require('os');
35-
const cp = require('child_process');
3634

3735
const productDependencies = Object.keys(product.dependencies || {});
3836
const dependencies = Object.keys(shrinkwrap.dependencies)
@@ -45,8 +43,8 @@ const nodeModules = ['electron', 'original-fs']
4543
// Build
4644

4745
const builtInExtensions = [
48-
{ name: 'ms-vscode.node-debug', version: '1.15.2' },
49-
{ name: 'ms-vscode.node-debug2', version: '1.14.4' }
46+
{ name: 'ms-vscode.node-debug', version: '1.15.4' },
47+
{ name: 'ms-vscode.node-debug2', version: '1.14.5' }
5048
];
5149

5250
const excludedExtensions = [
@@ -137,7 +135,7 @@ const config = {
137135
name: product.nameLong + ' document',
138136
role: 'Editor',
139137
ostypes: ["TEXT", "utxt", "TUTX", "****"],
140-
extensions: ["ascx", "asp", "aspx", "bash", "bash_login", "bash_logout", "bash_profile", "bashrc", "bat", "bowerrc", "c", "cc", "clj", "cljs", "cljx", "clojure", "cmd", "coffee", "config", "cpp", "cs", "cshtml", "csproj", "css", "csx", "ctp", "cxx", "dockerfile", "dot", "dtd", "editorconfig", "edn", "eyaml", "eyml", "fs", "fsi", "fsscript", "fsx", "gemspec", "gitattributes", "gitconfig", "gitignore", "go", "h", "handlebars", "hbs", "hh", "hpp", "htm", "html", "hxx", "ini", "jade", "jav", "java", "js", "jscsrc", "jshintrc", "jshtm", "json", "jsp", "less", "lua", "m", "makefile", "markdown", "md", "mdoc", "mdown", "mdtext", "mdtxt", "mdwn", "mkd", "mkdn", "ml", "mli", "php", "phtml", "pl", "pl6", "pm", "pm6", "pod", "pp", "profile", "properties", "ps1", "psd1", "psgi", "psm1", "py", "r", "rb", "rhistory", "rprofile", "rs", "rt", "scss", "sh", "shtml", "sql", "svg", "svgz", "t", "ts", "txt", "vb", "wxi", "wxl", "wxs", "xaml", "xcodeproj", "xcworkspace", "xml", "yaml", "yml", "zlogin", "zlogout", "zprofile", "zsh", "zshenv", "zshrc"],
138+
extensions: ["ascx", "asp", "aspx", "bash", "bash_login", "bash_logout", "bash_profile", "bashrc", "bat", "bowerrc", "c", "cc", "clj", "cljs", "cljx", "clojure", "cmd", "code-workspace", "coffee", "config", "cpp", "cs", "cshtml", "csproj", "css", "csx", "ctp", "cxx", "dockerfile", "dot", "dtd", "editorconfig", "edn", "eyaml", "eyml", "fs", "fsi", "fsscript", "fsx", "gemspec", "gitattributes", "gitconfig", "gitignore", "go", "h", "handlebars", "hbs", "hh", "hpp", "htm", "html", "hxx", "ini", "jade", "jav", "java", "js", "jscsrc", "jshintrc", "jshtm", "json", "jsp", "less", "lua", "m", "makefile", "markdown", "md", "mdoc", "mdown", "mdtext", "mdtxt", "mdwn", "mkd", "mkdn", "ml", "mli", "php", "phtml", "pl", "pl6", "pm", "pm6", "pod", "pp", "profile", "properties", "ps1", "psd1", "psgi", "psm1", "py", "r", "rb", "rhistory", "rprofile", "rs", "rt", "scss", "sh", "shtml", "sql", "svg", "svgz", "t", "ts", "txt", "vb", "wxi", "wxl", "wxs", "xaml", "xcodeproj", "xcworkspace", "xml", "yaml", "yml", "zlogin", "zlogout", "zprofile", "zsh", "zshenv", "zshrc"],
141139
iconFile: 'resources/darwin/code_file.icns'
142140
}],
143141
darwinBundleURLTypes: [{
@@ -227,8 +225,7 @@ function packageTask(platform, arch, opts) {
227225
]);
228226

229227
const src = gulp.src(out + '/**', { base: '.' })
230-
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + out), 'out'); }))
231-
.pipe(util.setExecutableBit(['**/*.sh']));
228+
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + out), 'out'); }));
232229

233230
const root = path.resolve(path.join(__dirname, '..'));
234231
const localExtensionDescriptions = glob.sync('extensions/*/package.json')
@@ -259,12 +256,9 @@ function packageTask(platform, arch, opts) {
259256
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
260257
}));
261258

262-
const sources = es.merge(
263-
src,
264-
localExtensions,
265-
localExtensionDependencies,
266-
marketplaceExtensions
267-
).pipe(filter(['**', '!**/*.js.map']));
259+
const sources = es.merge(src, localExtensions, localExtensionDependencies, marketplaceExtensions)
260+
.pipe(util.setExecutableBit(['**/*.sh']))
261+
.pipe(filter(['**', '!**/*.js.map']));
268262

269263
let version = packageJson.version;
270264
const quality = product.quality;
@@ -283,6 +277,8 @@ function packageTask(platform, arch, opts) {
283277

284278
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' });
285279

280+
const watermark = gulp.src(['resources/letterpress.svg', 'resources/letterpress-dark.svg', 'resources/letterpress-hc.svg'], { base: '.' });
281+
286282
// TODO the API should be copied to `out` during compile, not here
287283
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
288284

@@ -306,6 +302,7 @@ function packageTask(platform, arch, opts) {
306302
packageJsonStream,
307303
productJsonStream,
308304
license,
305+
watermark,
309306
api,
310307
sources,
311308
deps
@@ -371,62 +368,6 @@ gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'],
371368
gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64', { minified: true }));
372369
gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true }));
373370

374-
// --- v8 snapshots ---
375-
376-
function snapshotTask(platform, arch) {
377-
378-
const destination = path.join(path.dirname(root), 'VSCode') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
379-
380-
let command = path.join(process.cwd(), 'node_modules/.bin/mksnapshot');
381-
let loaderInputFilepath;
382-
let startupBlobFilepath;
383-
384-
if (platform === 'darwin') {
385-
loaderInputFilepath = path.join(destination, 'Code - OSS.app/Contents/Resources/app/out/vs/loader.js');
386-
startupBlobFilepath = path.join(destination, 'Code - OSS.app/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin')
387-
388-
} else if (platform === 'win32') {
389-
command = `${command}.cmd`;
390-
loaderInputFilepath = path.join(destination, 'resources/app/out/vs/loader.js');
391-
startupBlobFilepath = path.join(destination, 'snapshot_blob.bin')
392-
393-
} else if (platform === 'linux') {
394-
loaderInputFilepath = path.join(destination, 'resources/app/out/vs/loader.js');
395-
startupBlobFilepath = path.join(destination, 'snapshot_blob.bin')
396-
}
397-
398-
return () => {
399-
const inputFile = fs.readFileSync(loaderInputFilepath);
400-
const wrappedInputFile = `
401-
var Monaco_Loader_Init;
402-
(function() {
403-
var doNotInitLoader = true;
404-
${inputFile.toString()};
405-
Monaco_Loader_Init = function() {
406-
AMDLoader.init();
407-
CSSLoaderPlugin.init();
408-
NLSLoaderPlugin.init();
409-
410-
return define;
411-
}
412-
})();
413-
`;
414-
const wrappedInputFilepath = path.join(os.tmpdir(), 'wrapped-loader.js');
415-
console.log(wrappedInputFilepath);
416-
fs.writeFileSync(wrappedInputFilepath, wrappedInputFile);
417-
418-
cp.execFileSync(command, [wrappedInputFilepath, `--startup_blob`, startupBlobFilepath]);
419-
}
420-
}
421-
422-
gulp.task('vscode-win32-ia32-snapshots', ['vscode-win32-ia32-min'], snapshotTask('win32', 'ia32'));
423-
gulp.task('vscode-win32-x64-snapshots', ['vscode-win32-x64-min'], snapshotTask('win32', 'x64'));
424-
gulp.task('vscode-darwin-snapshots', ['vscode-darwin-min'], snapshotTask('darwin', undefined));
425-
gulp.task('vscode-linux-ia32-snapshots', ['vscode-linux-ia32-min'], snapshotTask('linux', 'ia32'));
426-
gulp.task('vscode-linux-x64-snapshots', ['vscode-linux-x64-min'], snapshotTask('linux', 'x64'));
427-
gulp.task('vscode-linux-arm-snapshots', ['vscode-linux-arm-min'], snapshotTask('linux', 'arm'));
428-
429-
430371
// Transifex Localizations
431372
const vscodeLanguages = [
432373
'zh-hans',

build/lib/extensions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function fromLocal(extensionPath) {
2626
.map(function (fileName) { return path.join(extensionPath, fileName); })
2727
.map(function (filePath) { return new File({
2828
path: filePath,
29+
stat: fs.statSync(filePath),
2930
base: extensionPath,
3031
contents: fs.createReadStream(filePath)
3132
}); });

build/lib/extensions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export function fromLocal(extensionPath: string): Stream {
2828
.map(fileName => path.join(extensionPath, fileName))
2929
.map(filePath => new File({
3030
path: filePath,
31+
stat: fs.statSync(filePath),
3132
base: extensionPath,
3233
contents: fs.createReadStream(filePath) as any
3334
}));

build/lib/snapshotLoader.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
'use strict';
6+
var snaps;
7+
(function (snaps) {
8+
var fs = require('fs');
9+
var path = require('path');
10+
var os = require('os');
11+
var cp = require('child_process');
12+
var mksnapshot = path.join(__dirname, "../../node_modules/.bin/" + (process.platform === 'win32' ? 'mksnapshot.cmd' : 'mksnapshot'));
13+
var product = require('../../product.json');
14+
var arch = (process.argv.join('').match(/--arch=(.*)/) || [])[1];
15+
//
16+
var loaderFilepath;
17+
var startupBlobFilepath;
18+
switch (process.platform) {
19+
case 'darwin':
20+
loaderFilepath = "VSCode-darwin/" + product.nameLong + ".app/Contents/Resources/app/out/vs/loader.js";
21+
startupBlobFilepath = "VSCode-darwin/" + product.nameLong + ".app/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin";
22+
break;
23+
case 'win32':
24+
case 'linux':
25+
loaderFilepath = "VSCode-" + process.platform + "-" + arch + "/resources/app/out/vs/loader.js";
26+
startupBlobFilepath = "VSCode-" + process.platform + "-" + arch + "/snapshot_blob.bin";
27+
}
28+
loaderFilepath = path.join(__dirname, '../../../', loaderFilepath);
29+
startupBlobFilepath = path.join(__dirname, '../../../', startupBlobFilepath);
30+
snapshotLoader(loaderFilepath, startupBlobFilepath);
31+
function snapshotLoader(loaderFilepath, startupBlobFilepath) {
32+
var inputFile = fs.readFileSync(loaderFilepath);
33+
var wrappedInputFile = "\n\t\tvar Monaco_Loader_Init;\n\t\t(function() {\n\t\t\tvar doNotInitLoader = true;\n\t\t\t" + inputFile.toString() + ";\n\t\t\tMonaco_Loader_Init = function() {\n\t\t\t\tAMDLoader.init();\n\t\t\t\tCSSLoaderPlugin.init();\n\t\t\t\tNLSLoaderPlugin.init();\n\n\t\t\t\treturn { define, require };\n\t\t\t}\n\t\t})();\n\t\t";
34+
var wrappedInputFilepath = path.join(os.tmpdir(), 'wrapped-loader.js');
35+
console.log(wrappedInputFilepath);
36+
fs.writeFileSync(wrappedInputFilepath, wrappedInputFile);
37+
cp.execFileSync(mksnapshot, [wrappedInputFilepath, "--startup_blob", startupBlobFilepath]);
38+
}
39+
})(snaps || (snaps = {}));

build/lib/snapshotLoader.ts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
'use strict';
7+
8+
namespace snaps {
9+
10+
const fs = require('fs');
11+
const path = require('path');
12+
const os = require('os');
13+
const cp = require('child_process');
14+
15+
const mksnapshot = path.join(__dirname, `../../node_modules/.bin/${process.platform === 'win32' ? 'mksnapshot.cmd' : 'mksnapshot'}`);
16+
const product = require('../../product.json');
17+
const arch = (process.argv.join('').match(/--arch=(.*)/) || [])[1];
18+
19+
//
20+
let loaderFilepath: string;
21+
let startupBlobFilepath: string;
22+
23+
switch (process.platform) {
24+
case 'darwin':
25+
loaderFilepath = `VSCode-darwin/${product.nameLong}.app/Contents/Resources/app/out/vs/loader.js`;
26+
startupBlobFilepath = `VSCode-darwin/${product.nameLong}.app/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin`;
27+
break;
28+
29+
case 'win32':
30+
case 'linux':
31+
loaderFilepath = `VSCode-${process.platform}-${arch}/resources/app/out/vs/loader.js`;
32+
startupBlobFilepath = `VSCode-${process.platform}-${arch}/snapshot_blob.bin`;
33+
}
34+
35+
loaderFilepath = path.join(__dirname, '../../../', loaderFilepath);
36+
startupBlobFilepath = path.join(__dirname, '../../../', startupBlobFilepath);
37+
38+
snapshotLoader(loaderFilepath, startupBlobFilepath);
39+
40+
function snapshotLoader(loaderFilepath: string, startupBlobFilepath: string): void {
41+
42+
const inputFile = fs.readFileSync(loaderFilepath);
43+
const wrappedInputFile = `
44+
var Monaco_Loader_Init;
45+
(function() {
46+
var doNotInitLoader = true;
47+
${inputFile.toString()};
48+
Monaco_Loader_Init = function() {
49+
AMDLoader.init();
50+
CSSLoaderPlugin.init();
51+
NLSLoaderPlugin.init();
52+
53+
return { define, require };
54+
}
55+
})();
56+
`;
57+
const wrappedInputFilepath = path.join(os.tmpdir(), 'wrapped-loader.js');
58+
console.log(wrappedInputFilepath);
59+
fs.writeFileSync(wrappedInputFilepath, wrappedInputFile);
60+
61+
cp.execFileSync(mksnapshot, [wrappedInputFilepath, `--startup_blob`, startupBlobFilepath]);
62+
}
63+
}

build/monaco/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"sinon": "^1.17.2",
4949
"source-map": "^0.4.4",
5050
"tslint": "^4.3.1",
51-
"typescript": "2.3.2",
51+
"typescript": "2.4.1",
5252
"typescript-formatter": "4.0.1",
5353
"underscore": "^1.8.2",
5454
"vinyl": "^0.4.5",

build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"documentdb": "^1.11.0",
1414
"mime": "^1.3.4",
1515
"minimist": "^1.2.0",
16-
"typescript": "2.3.4",
16+
"typescript": "2.4.1",
1717
"xml2js": "^0.4.17"
1818
},
1919
"scripts": {

build/tfs/common/publish.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@ async function doesAssetExist(blobService: azure.BlobService, quality: string, b
131131
}
132132

133133
async function uploadBlob(blobService: azure.BlobService, quality: string, blobName: string, file: string): Promise<void> {
134-
const blobOptions = {
135-
contentType: mime.lookup(file),
136-
cacheControl: 'max-age=31536000, public'
134+
const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = {
135+
contentSettings: {
136+
contentType: mime.lookup(file),
137+
cacheControl: 'max-age=31536000, public'
138+
}
137139
};
138140

139141
await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(quality, blobName, file, blobOptions, err => err ? e(err) : c()));
@@ -178,6 +180,9 @@ async function publish(commit: string, quality: string, platform: string, type:
178180
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY'], `${storageAccount}.blob.core.chinacloudapi.cn`)
179181
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
180182

183+
// mooncake is fussy and far away, this is needed!
184+
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
185+
181186
await Promise.all([
182187
assertContainer(blobService, quality),
183188
assertContainer(mooncakeBlobService, quality)

build/tfs/darwin/build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ step "Install distro dependencies" \
2525
step "Build minified & upload source maps" \
2626
npm run gulp -- --max_old_space_size=4096 vscode-darwin-min upload-vscode-sourcemaps
2727

28+
step "Create loader snapshot"
29+
node build/lib/snapshotLoader.js
30+
2831
step "Run unit tests" \
2932
./scripts/test.sh --build --reporter dot
3033

3134
step "Run integration tests" \
3235
./scripts/test-integration.sh
3336

3437
step "Publish release" \
35-
./build/tfs/darwin/release.sh
38+
./build/tfs/darwin/release.sh

0 commit comments

Comments
 (0)