提交 422e0185 编写于 作者: D Daniel Imms

Merge remote-tracking branch 'origin/master' into tyriar/25195

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
{
perform: true,
alwaysRequireAssignee: false,
labelsRequiringAssignee: [ feature-request ],
autoAssignees: {
accessibility: [],
api: [],
css-less-sass: [],
debug: [],
editor: [],
emmet: [ ramya-rao-a ],
error-list: [],
extensions: [],
git: [],
hot-exit: [],
html: [],
i18n: [],
install-update: [],
integrated-terminal: [ Tyriar ],
javascript: [],
json: [],
languages basic: [],
markdown: [],
php: [ roblourens ],
search: [ roblourens ],
tasks: [],
typescript: [],
workbench: [],
}
}
\ No newline at end of file
{
perform: true,
target_owner: 'chrmarti',
target_repo: 'testissues'
}
\ No newline at end of file
{
insidersLabel: 'insiders',
perform: true
}
\ No newline at end of file
{
newReleaseLabel: 'new release',
newReleases: ['1.13.1'],
perform: true
}
\ No newline at end of file
......@@ -44,7 +44,7 @@ script:
- gulp electron --silent
- gulp compile --silent --max_old_space_size=4096
- gulp optimize-vscode --silent --max_old_space_size=4096
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage; else ./scripts/test.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage --reporter dot; else ./scripts/test.sh --reporter dot; fi
- ./scripts/test-integration.sh
after_success:
......
......@@ -18,7 +18,6 @@
"name": "Attach to Extension Host",
"protocol": "legacy",
"port": 5870,
"sourceMaps": true,
"restart": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
......@@ -30,7 +29,6 @@
"name": "Attach to Shared Process",
"protocol": "legacy",
"port": 5871,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
]
......@@ -41,7 +39,6 @@
"protocol": "legacy",
"name": "Attach to Search process",
"port": 7890,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
]
......@@ -52,7 +49,6 @@
"name": "Attach to CLI Process",
"protocol": "legacy",
"port": 5874,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
]
......@@ -63,7 +59,6 @@
"name": "Attach to Main Process",
"protocol": "legacy",
"port": 5875,
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
]
......@@ -78,7 +73,6 @@
"--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode-api-tests",
"--extensionTestsPath=${workspaceRoot}/extensions/vscode-api-tests/out"
],
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
]
......@@ -93,7 +87,6 @@
"--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode-colorize-tests",
"--extensionTestsPath=${workspaceRoot}/extensions/vscode-colorize-tests/out"
],
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/out/**/*.js"
]
......@@ -131,7 +124,6 @@
"program": "${workspaceRoot}/extensions/git/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"cwd": "${workspaceRoot}/extensions/git",
"sourceMaps": true,
"outFiles": [
"${workspaceRoot}/extensions/git/out/**/*.js"
]
......@@ -141,11 +133,36 @@
"type": "node",
"request": "attach",
"port": 5859,
"sourceMaps": true,
"protocol": "legacy",
"outFiles": [
"${workspaceRoot}/extensions/node_modules/typescript/lib/**/*.js"
]
},
{
"type": "node",
"request": "launch",
"name": "Unit Tests",
"protocol": "legacy",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"runtimeExecutable": "${workspaceRoot}/.build/electron/Code - OSS.app/Contents/MacOS/Electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/.build/electron/Code - OSS.exe"
},
"linux": {
"runtimeExecutable": "${workspaceRoot}/.build/electron/code-oss"
},
"stopOnEntry": false,
"args": [
"--timeout",
"2000"
],
"cwd": "${workspaceRoot}",
"env": {
"ELECTRON_RUN_AS_NODE": "true"
},
"outFiles": [
"${workspaceRoot}/out/**/*.js"
]
}
],
"compounds": [
......
{
"version": "0.1.0",
"windows": {
"command": ".\\node_modules\\.bin\\gulp"
},
"osx": {
"command": "./node_modules/.bin/gulp"
},
"linux": {
"command": "./node_modules/.bin/gulp"
},
"isShellCommand": true,
"version": "2.0.0",
"tasks": [
{
"taskName": "watch",
"args": [
"--no-color"
],
"isBuildCommand": true,
"customize": "vscode.npm.run watch",
"taskName": "Build VS Code",
"group": "build",
"isBackground": true,
"terminal": {
"reveal": "never"
},
"problemMatcher": {
"owner": "typescript",
"applyTo": "closedDocuments",
......@@ -30,45 +21,41 @@
"location": 2,
"message": 3
},
"watching": {
"background": {
"beginsPattern": "Starting compilation",
"endsPattern": "Finished compilation"
}
}
},
{
"taskName": "tslint",
"args": [],
"problemMatcher": {
"owner": "tslint",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"severity": "warning",
"pattern": {
"regexp": "(.*)\\[(\\d+),\\s(\\d+)\\]:\\s(.*)$", // (.*)\[(\d+), (\d+)\]: (.*)
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
"customize": "gulp.tslint",
"taskName": "Run tslint",
"problemMatcher": ["$tslint4"]
},
{
"taskName": "Run tests",
"type": "shell",
"command": "./scripts/test.sh",
"windows": {
"command": ".\\scripts\\test.bat"
},
"group": "test",
"presentation": {
"echo": true,
"reveal": "always"
}
},
{
"taskName": "test",
"args": [
"--no-color"
],
"showOutput": "always",
"isTestCommand": true
"taskName": "Run Dev",
"type": "shell",
"command": "./scripts/code.sh",
"windows": {
"command": ".\\scripts\\code.bat"
}
},
{
"taskName": "electron",
"args": [
"--no-color"
],
"showOutput": "never"
"customize": "gulp.electron",
"taskName": "Download electron"
}
]
}
\ No newline at end of file
microsoft-vscode
dmicrosoft-vscode
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
Do Not Translate or Localize
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
1. atom/language-c version 0.51.3 (https://github.com/atom/language-c)
1. atom/language-c (https://github.com/atom/language-c)
2. atom/language-clojure (https://github.com/atom/language-clojure)
3. atom/language-coffee-script (https://github.com/atom/language-coffee-script)
4. atom/language-css (https://github.com/atom/language-css)
5. atom/language-objective-c (https://github.com/atom/language-objective-c)
6. atom/language-sass version 0.52.0 (https://github.com/atom/language-sass)
7. atom/language-xml (https://github.com/atom/language-xml)
8. Benvie/JavaScriptNext.tmLanguage (https://github.com/Benvie/JavaScriptNext.tmLanguage)
9. chjj-marked version 0.3.2 (https://github.com/npmcomponent/chjj-marked)
10. chriskempson/tomorrow-theme (https://github.com/chriskempson/tomorrow-theme)
11. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes)
12. daaain/Handlebars (https://github.com/daaain/Handlebars)
13. davidrios/jade-tmbundle (https://github.com/davidrios/jade-tmbundle)
14. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped)
15. demyte/language-cshtml (https://github.com/demyte/language-cshtml)
16. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage)
17. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift)
18. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/)
19. Ionic documentation version 1.2.4 (https://github.com/driftyco/ionic-site)
20. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar)
21. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify)
22. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert)
23. language-docker (https://github.com/moby/moby)
24. language-go version 0.39.0 (https://github.com/atom/language-go)
25. language-less (https://github.com/atom/language-less)
26. language-php (https://github.com/atom/language-php)
27. language-rust version 0.4.9 (https://github.com/zargony/atom-language-rust)
28. MagicStack/MagicPython (https://github.com/MagicStack/MagicPython)
29. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage)
30. octicons-code version 3.1.0 (https://octicons.github.com)
31. octicons-font version 3.1.0 (https://octicons.github.com)
32. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui)
33. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage)
34. string_scorer version 0.1.20 (https://github.com/joshaven/string_score)
35. sublimehq/Packages (https://github.com/sublimehq/Packages)
36. SublimeText/PowerShell (https://github.com/SublimeText/PowerShell)
37. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle)
38. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle)
39. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle)
40. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle)
41. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle)
42. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle)
43. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle)
44. textmate/java.tmbundle (https://github.com/textmate/java.tmbundle)
45. textmate/javadoc.tmbundle (https://github.com/textmate/javadoc.tmbundle)
46. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle)
47. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle)
48. textmate/make.tmbundle (https://github.com/textmate/make.tmbundle)
49. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle)
50. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle)
51. textmate/r.tmbundle (https://github.com/textmate/r.tmbundle)
52. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle)
53. textmate/shellscript.tmbundle (https://github.com/textmate/shellscript.tmbundle)
54. textmate/sql.tmbundle (https://github.com/textmate/sql.tmbundle)
55. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle)
56. typescript-legacy version 1.5 (https://github.com/Microsoft/TypeScript)
57. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage)
58. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
5. atom/language-java (https://github.com/atom/language-java)
6. atom/language-objective-c (https://github.com/atom/language-objective-c)
7. atom/language-sass version 0.52.0 (https://github.com/atom/language-sass)
8. atom/language-xml (https://github.com/atom/language-xml)
9. Benvie/JavaScriptNext.tmLanguage (https://github.com/Benvie/JavaScriptNext.tmLanguage)
10. chjj-marked version 0.3.2 (https://github.com/npmcomponent/chjj-marked)
11. chriskempson/tomorrow-theme (https://github.com/chriskempson/tomorrow-theme)
12. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes)
13. daaain/Handlebars (https://github.com/daaain/Handlebars)
14. davidrios/jade-tmbundle (https://github.com/davidrios/jade-tmbundle)
15. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped)
16. demyte/language-cshtml (https://github.com/demyte/language-cshtml)
17. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage)
18. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift)
19. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/)
20. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site)
21. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar)
22. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify)
23. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert)
24. language-docker (https://github.com/moby/moby)
25. language-go version 0.39.0 (https://github.com/atom/language-go)
26. language-less (https://github.com/atom/language-less)
27. language-php (https://github.com/atom/language-php)
28. language-rust version 0.4.9 (https://github.com/zargony/atom-language-rust)
29. MagicStack/MagicPython (https://github.com/MagicStack/MagicPython)
30. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage)
31. octicons-code version 3.1.0 (https://octicons.github.com)
32. octicons-font version 3.1.0 (https://octicons.github.com)
33. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui)
34. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage)
35. string_scorer version 0.1.20 (https://github.com/joshaven/string_score)
36. sublimehq/Packages (https://github.com/sublimehq/Packages)
37. SublimeText/PowerShell (https://github.com/SublimeText/PowerShell)
38. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle)
39. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle)
40. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle)
41. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle)
42. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle)
43. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle)
44. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle)
45. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle)
46. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle)
47. textmate/make.tmbundle (https://github.com/textmate/make.tmbundle)
48. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle)
49. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle)
50. textmate/r.tmbundle (https://github.com/textmate/r.tmbundle)
51. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle)
52. textmate/shellscript.tmbundle (https://github.com/textmate/shellscript.tmbundle)
53. textmate/sql.tmbundle (https://github.com/textmate/sql.tmbundle)
54. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle)
55. typescript-legacy version 1.5 (https://github.com/Microsoft/TypeScript)
56. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage)
57. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
%% atom/language-c NOTICES AND INFORMATION BEGIN HERE
......@@ -246,6 +245,43 @@ suitability for any purpose.
=========================================
END OF atom/language-css NOTICES AND INFORMATION
%% atom/language-java NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
Copyright (c) 2014 GitHub Inc.
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.
This package was derived from a TextMate bundle located at
https://github.com/textmate/java.tmbundle and distributed under the following
license, located in `README.mdown`:
Permission to copy, use, modify, sell and distribute this
software is granted. This software is provided "as is" without
express or implied warranty, and with no claim as to its
suitability for any purpose.
=========================================
END OF atom/language-java NOTICES AND INFORMATION
%% atom/language-objective-c NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)
......@@ -1701,42 +1737,6 @@ to the base-name name of the original file, and an extension of txt, html, or si
=========================================
END OF textmate/ini.tmbundle NOTICES AND INFORMATION
%% textmate/java.tmbundle NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) textmate-java.tmbundle project authors
If not otherwise specified (see below), files in this repository fall under the following license:
Permission to copy, use, modify, sell and distribute this
software is granted. This software is provided "as is" without
express or implied warranty, and with no claim as to its
suitability for any purpose.
An exception is made for files in readable text which contain their own license information,
or files where an accompanying file exists (in the same directory) with a "-license" suffix added
to the base-name name of the original file, and an extension of txt, html, or similar. For example
"tidy" is accompanied by "tidy-license.txt".
=========================================
END OF textmate/java.tmbundle NOTICES AND INFORMATION
%% textmate/javadoc.tmbundle NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) textmate-javadoc.tmbundle project authors
If not otherwise specified (see below), files in this repository fall under the following license:
Permission to copy, use, modify, sell and distribute this
software is granted. This software is provided "as is" without
express or implied warranty, and with no claim as to its
suitability for any purpose.
An exception is made for files in readable text which contain their own license information,
or files where an accompanying file exists (in the same directory) with a "-license" suffix added
to the base-name name of the original file, and an extension of txt, html, or similar. For example
"tidy" is accompanied by "tidy-license.txt".
=========================================
END OF textmate/javadoc.tmbundle NOTICES AND INFORMATION
%% textmate/javascript.tmbundle NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) textmate-javascript.tmbundle project authors
......
......@@ -4,7 +4,7 @@ environment:
install:
- ps: Install-Product node 7.4.0 x64
- npm install -g npm --silent
- npm install -g npm@4 --silent
- npm install -g gulp mocha --silent
build_script:
......
......@@ -38,7 +38,6 @@ var editorResources = [
'!out-build/vs/base/browser/ui/splitview/**/*',
'!out-build/vs/base/browser/ui/toolbar/**/*',
'!out-build/vs/base/browser/ui/octiconLabel/**/*',
'!out-build/vs/editor/contrib/defineKeybinding/**/*',
'!out-build/vs/workbench/**',
'!**/test/**'
];
......
......@@ -9,6 +9,7 @@ const gulp = require('gulp');
const filter = require('gulp-filter');
const es = require('event-stream');
const gulptslint = require('gulp-tslint');
const gulpeslint = require('gulp-eslint');
const tsfmt = require('typescript-formatter');
const tslint = require('tslint');
......@@ -95,8 +96,21 @@ const copyrightFilter = [
'!extensions/html/server/src/modes/typescript/*'
];
const eslintFilter = [
'src/**/*.js',
'!src/vs/loader.js',
'!src/vs/css.js',
'!src/vs/nls.js',
'!src/vs/css.build.js',
'!src/vs/nls.build.js',
'!src/**/winjs.base.raw.js',
'!src/**/raw.marked.js',
'!**/test/**'
];
const tslintFilter = [
'src/**/*.ts',
'test/**/*.ts',
'extensions/**/*.ts',
'!**/fixtures/**',
'!**/typings/**',
......@@ -124,6 +138,14 @@ function reportFailures(failures) {
});
}
gulp.task('eslint', () => {
return gulp.src(all, { base: '.' })
.pipe(filter(eslintFilter))
.pipe(gulpeslint('src/.eslintrc'))
.pipe(gulpeslint.formatEach('compact'))
.pipe(gulpeslint.failAfterError());
});
gulp.task('tslint', () => {
const options = { summarizeFailureOutput: true };
......@@ -176,7 +198,6 @@ const hygiene = exports.hygiene = (some, options) => {
});
const formatting = es.map(function (file, cb) {
tsfmt.processString(file.path, file.contents.toString('utf8'), {
verify: true,
tsfmt: true,
......@@ -209,17 +230,27 @@ const hygiene = exports.hygiene = (some, options) => {
this.emit('data', file);
});
return gulp.src(some || all, { base: '.' })
const result = gulp.src(some || all, { base: '.' })
.pipe(filter(f => !f.stat.isDirectory()))
.pipe(filter(eolFilter))
.pipe(options.skipEOL ? es.through() : eol)
.pipe(filter(indentationFilter))
.pipe(indentation)
.pipe(filter(copyrightFilter))
.pipe(copyrights)
.pipe(copyrights);
const typescript = result
.pipe(filter(tslintFilter))
.pipe(formatting)
.pipe(tsl)
.pipe(tsl);
const javascript = result
.pipe(filter(eslintFilter))
.pipe(gulpeslint('src/.eslintrc'))
.pipe(gulpeslint.formatEach('compact'))
.pipe(gulpeslint.failAfterError());
return es.merge(typescript, javascript)
.pipe(es.through(null, function () {
if (errorCount > 0) {
this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.');
......
......@@ -30,6 +30,9 @@ const product = require('../product.json');
const shrinkwrap = require('../npm-shrinkwrap.json');
const crypto = require('crypto');
const i18n = require('./lib/i18n');
const glob = require('glob');
const os = require('os');
const cp = require('child_process');
const productDependencies = Object.keys(product.dependencies || {});
const dependencies = Object.keys(shrinkwrap.dependencies)
......@@ -42,8 +45,13 @@ const nodeModules = ['electron', 'original-fs']
// Build
const builtInExtensions = [
{ name: 'ms-vscode.node-debug', version: '1.13.6' },
{ name: 'ms-vscode.node-debug2', version: '1.12.4' }
{ name: 'ms-vscode.node-debug', version: '1.14.5' },
{ name: 'ms-vscode.node-debug2', version: '1.14.1' }
];
const excludedExtensions = [
'vscode-api-tests',
'vscode-colorize-tests'
];
const vscodeEntryPoints = _.flatten([
......@@ -84,6 +92,11 @@ const BUNDLED_FILE_HEADER = [
' *--------------------------------------------------------*/'
].join('\n');
var languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita'];
if (process.env.VSCODE_QUALITY !== 'stable') {
languages = languages.concat(['ptb', 'hun', 'trk']); // Add languages requested by the community to non-stable builds
}
gulp.task('clean-optimized-vscode', util.rimraf('out-vscode'));
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
entryPoints: vscodeEntryPoints,
......@@ -91,7 +104,8 @@ gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compil
resources: vscodeResources,
loaderConfig: common.loaderConfig(nodeModules),
header: BUNDLED_FILE_HEADER,
out: 'out-vscode'
out: 'out-vscode',
languages: languages
}));
......@@ -117,6 +131,8 @@ const config = {
darwinIcon: 'resources/darwin/code.icns',
darwinBundleIdentifier: product.darwinBundleIdentifier,
darwinApplicationCategoryType: 'public.app-category.developer-tools',
darwinHelpBookFolder: 'VS Code HelpBook',
darwinHelpBookName: 'VS Code HelpBook',
darwinBundleDocumentTypes: [{
name: product.nameLong + ' document',
role: 'Editor',
......@@ -158,7 +174,6 @@ gulp.task('electron', ['clean-electron'], getElectron(process.arch));
gulp.task('electron-ia32', ['clean-electron'], getElectron('ia32'));
gulp.task('electron-x64', ['clean-electron'], getElectron('x64'));
const languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita', 'ptb'];
/**
* Compute checksums for some files.
......@@ -207,47 +222,49 @@ function packageTask(platform, arch, opts) {
'vs/workbench/electron-browser/workbench.main.js',
'vs/workbench/electron-browser/workbench.main.css',
'vs/workbench/electron-browser/bootstrap/index.html',
'vs/workbench/electron-browser/bootstrap/index.js'
'vs/workbench/electron-browser/bootstrap/index.js',
'vs/workbench/electron-browser/bootstrap/preload.js'
]);
const src = gulp.src(out + '/**', { base: '.' })
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + out), 'out'); }))
.pipe(util.setExecutableBit(['**/*.sh']));
const extensionsList = [
'extensions/*/**',
'!extensions/*/src/**',
'!extensions/*/out/**/test/**',
'!extensions/*/test/**',
'!extensions/*/build/**',
'!extensions/**/node_modules/@types/**',
'!extensions/*/{client,server}/src/**',
'!extensions/*/{client,server}/test/**',
'!extensions/*/{client,server}/out/**/test/**',
'!extensions/*/{client,server}/out/**/typings/**',
'!extensions/**/.vscode/**',
'!extensions/**/tsconfig.json',
'!extensions/typescript/bin/**',
'!extensions/vscode-api-tests/**',
'!extensions/vscode-colorize-tests/**',
...builtInExtensions.map(e => `!extensions/${e.name}/**`)
];
const nlsFilter = filter('**/*.nls.json', { restore: true });
const extensions = gulp.src(extensionsList, { base: '.' })
// TODO@Dirk: this filter / buffer is here to make sure the nls.json files are buffered
.pipe(nlsFilter)
.pipe(buffer())
.pipe(nlsDev.createAdditionalLanguageFiles(languages, path.join(__dirname, '..', 'i18n')))
.pipe(nlsFilter.restore);
const root = path.resolve(path.join(__dirname, '..'));
const localExtensionDescriptions = glob.sync('extensions/*/package.json')
.map(manifestPath => {
const extensionPath = path.dirname(path.join(root, manifestPath));
const extensionName = path.basename(extensionPath);
return { name: extensionName, path: extensionPath };
})
.filter(({ name }) => excludedExtensions.indexOf(name) === -1)
.filter(({ name }) => builtInExtensions.every(b => b.name !== name));
const localExtensions = es.merge(...localExtensionDescriptions.map(extension => {
const nlsFilter = filter('**/*.nls.json', { restore: true });
return ext.fromLocal(extension.path)
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`))
// // TODO@Dirk: this filter / buffer is here to make sure the nls.json files are buffered
.pipe(nlsFilter)
.pipe(buffer())
.pipe(nlsDev.createAdditionalLanguageFiles(languages, path.join(__dirname, '..', 'i18n')))
.pipe(nlsFilter.restore);
}));
const localExtensionDependencies = gulp.src('extensions/node_modules/**', { base: '.' });
const marketplaceExtensions = es.merge(...builtInExtensions.map(extension => {
return ext.src(extension.name, extension.version)
return ext.fromMarketplace(extension.name, extension.version)
.pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`));
}));
const sources = es.merge(src, extensions, marketplaceExtensions)
.pipe(filter(['**', '!**/*.js.map']));
const sources = es.merge(
src,
localExtensions,
localExtensionDependencies,
marketplaceExtensions
).pipe(filter(['**', '!**/*.js.map']));
let version = packageJson.version;
const quality = product.quality;
......@@ -274,7 +291,7 @@ function packageTask(platform, arch, opts) {
const deps = gulp.src(depsSrc, { base: '.', dot: true })
.pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/*.js']))
.pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('jschardet', ['dist/**']))
......@@ -282,6 +299,7 @@ function packageTask(platform, arch, opts) {
.pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js']))
.pipe(util.cleanNodeModule('v8-profiler', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js']))
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/**']))
.pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']));
let all = es.merge(
......@@ -353,6 +371,53 @@ gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'],
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 }));
// --- v8 snapshots ---
function snapshotTask(platform, arch) {
const destination = path.join(path.dirname(root), 'VSCode') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
const command = path.join(process.cwd(), 'node_modules/.bin/mksnapshot');
let startupBlobFilepath;
if (platform === 'darwin') {
startupBlobFilepath = path.join(destination, 'Code - OSS.app/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin')
} else if (platform === 'windows') {
startupBlobFilepath = path.join(destination, 'snapshot_blob.bin')
// TODO
return () => { };
} else if (platform === 'linux') {
// TODO
return () => { };
}
return () => {
const inputFile = fs.readFileSync(path.join(destination, 'Code - OSS.app/Contents/Resources/app/out/vs/loader.js'));
const wrappedInputFile = `
var Monaco_Loader_Init;
(function() {
var doNotInitLoader = true;
${inputFile.toString()};
Monaco_Loader_Init = function() {
AMDLoader.init();
CSSLoaderPlugin.init();
NLSLoaderPlugin.init();
return define;
}
})();
`;
const wrappedInputFilepath = path.join(os.tmpdir(), 'wrapped-loader.js');
console.log(wrappedInputFilepath);
fs.writeFileSync(wrappedInputFilepath, wrappedInputFile);
cp.execFileSync(command, [wrappedInputFilepath, `--startup_blob`, startupBlobFilepath]);
}
}
gulp.task('vscode-darwin-snapshots', ['vscode-darwin'], snapshotTask('darwin', undefined));
// Transifex Localizations
const vscodeLanguages = [
'zh-hans',
......@@ -364,7 +429,9 @@ const vscodeLanguages = [
'es',
'ru',
'it',
'pt-br'
'pt-br',
'hu',
'tr'
];
const setupDefaultLanguages = [
'zh-hans',
......
......@@ -40,6 +40,9 @@ function packageInnoSetup(iss, options, cb) {
function buildWin32Setup(arch) {
return cb => {
const ia32AppId = product.win32AppId;
const x64AppId = product.win32x64AppId;
const definitions = {
NameLong: product.nameLong,
NameShort: product.nameShort,
......@@ -51,8 +54,12 @@ function buildWin32Setup(arch) {
RegValueName: product.win32RegValueName,
ShellNameShort: product.win32ShellNameShort,
AppMutex: product.win32MutexName,
AppId: product.win32AppId,
Arch: arch,
AppId: arch === 'ia32' ? ia32AppId : x64AppId,
IncompatibleAppId: arch === 'ia32' ? x64AppId : ia32AppId,
AppUserId: product.win32AppUserModelId,
ArchitecturesAllowed: arch === 'ia32' ? '' : 'x64',
ArchitecturesInstallIn64BitMode: arch === 'ia32' ? '' : 'x64',
SourceDir: buildPath(arch),
RepoDir: repoPath,
OutputDir: setupDir(arch)
......@@ -70,9 +77,9 @@ gulp.task('vscode-win32-x64-setup', ['clean-vscode-win32-x64-setup'], buildWin32
function archiveWin32Setup(arch) {
return cb => {
const args = ['a', '-tzip', zipPath(arch), buildPath(arch), '-r'];
const args = ['a', '-tzip', zipPath(arch), '.', '-r'];
cp.spawn(_7z, args, { stdio: 'inherit' })
cp.spawn(_7z, args, { stdio: 'inherit', cwd: buildPath(arch) })
.on('error', cb)
.on('exit', () => cb(null));
};
......
......@@ -31,6 +31,9 @@ function bundle(entryPoints, config, callback) {
r.call({}, require, loaderModule, loaderModule.exports);
var loader = loaderModule.exports;
config.isBuild = true;
config.paths = config.paths || {};
config.paths['vs/nls'] = 'out-build/vs/nls.build';
config.paths['vs/css'] = 'out-build/vs/css.build';
loader.config(config);
loader(['require'], function (localRequire) {
var resolvePath = function (path) {
......
......@@ -91,6 +91,7 @@ interface IPartialBundleResult {
export interface ILoaderConfig {
isBuild?: boolean;
paths?: { [path: string]: any; };
}
/**
......@@ -121,6 +122,9 @@ export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callba
var loader: any = loaderModule.exports;
config.isBuild = true;
config.paths = config.paths || {};
config.paths['vs/nls'] = 'out-build/vs/nls.build';
config.paths['vs/css'] = 'out-build/vs/css.build';
loader.config(config);
loader(['require'], (localRequire) => {
......
......@@ -41,7 +41,6 @@ function createCompile(build, emitError) {
.pipe(tsFilter)
.pipe(util.loadSourcemaps())
.pipe(ts(token))
.pipe(build ? reloadTypeScriptNodeModule() : es.through())
.pipe(noDeclarationsFilter)
.pipe(build ? nls() : es.through())
.pipe(noDeclarationsFilter.restore)
......@@ -58,7 +57,7 @@ function createCompile(build, emitError) {
function compileTask(out, build) {
return function () {
var compile = createCompile(build, true);
var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts'));
var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'));
return src
.pipe(compile())
.pipe(gulp.dest(out))
......@@ -69,7 +68,7 @@ exports.compileTask = compileTask;
function watchTask(out, build) {
return function () {
var compile = createCompile(build);
var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts'));
var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'));
var watchSrc = watch('src/**', { base: 'src' });
return watchSrc
.pipe(util.incremental(compile, src, true))
......
......@@ -49,7 +49,7 @@ function createCompile(build: boolean, emitError?: boolean): (token?: util.ICanc
.pipe(tsFilter)
.pipe(util.loadSourcemaps())
.pipe(ts(token))
.pipe(build ? reloadTypeScriptNodeModule() : es.through())
// .pipe(build ? reloadTypeScriptNodeModule() : es.through())
.pipe(noDeclarationsFilter)
.pipe(build ? nls() : es.through())
.pipe(noDeclarationsFilter.restore)
......@@ -73,7 +73,6 @@ export function compileTask(out: string, build: boolean): () => NodeJS.ReadWrite
const src = es.merge(
gulp.src('src/**', { base: 'src' }),
gulp.src('node_modules/typescript/lib/lib.d.ts'),
gulp.src('node_modules/@types/**/index.d.ts')
);
return src
......@@ -91,7 +90,6 @@ export function watchTask(out: string, build: boolean): () => NodeJS.ReadWriteSt
const src = es.merge(
gulp.src('src/**', { base: 'src' }),
gulp.src('node_modules/typescript/lib/lib.d.ts'),
gulp.src('node_modules/@types/**/index.d.ts')
);
const watchSrc = watch('src/**', { base: 'src' });
......
......@@ -4,7 +4,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
var event_stream_1 = require("event-stream");
var es = require("event-stream");
var assign = require("object-assign");
var remote = require("gulp-remote-src");
var flatmap = require('gulp-flatmap');
......@@ -14,8 +14,29 @@ var rename = require('gulp-rename');
var util = require('gulp-util');
var buffer = require('gulp-buffer');
var json = require('gulp-json-editor');
var fs = require("fs");
var path = require("path");
var vsce = require("vsce");
var File = require("vinyl");
function fromLocal(extensionPath) {
var result = es.through();
vsce.listFiles({ cwd: extensionPath })
.then(function (fileNames) {
var files = fileNames
.map(function (fileName) { return path.join(extensionPath, fileName); })
.map(function (filePath) { return new File({
path: filePath,
base: extensionPath,
contents: fs.createReadStream(filePath)
}); });
es.readArray(files).pipe(result);
})
.catch(function (err) { return result.emit('error', err); });
return result;
}
exports.fromLocal = fromLocal;
function error(err) {
var result = event_stream_1.through();
var result = es.through();
setTimeout(function () { return result.emit('error', err); });
return result;
}
......@@ -23,7 +44,7 @@ var baseHeaders = {
'X-Market-Client-Id': 'VSCode Build',
'User-Agent': 'VSCode Build',
};
function src(extensionName, version) {
function fromMarketplace(extensionName, version) {
var filterType = 7;
var value = extensionName;
var criterium = { filterType: filterType, value: value };
......@@ -93,4 +114,4 @@ function src(extensionName, version) {
}));
}));
}
exports.src = src;
exports.fromMarketplace = fromMarketplace;
......@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { through } from 'event-stream';
import * as es from 'event-stream';
import { Stream } from 'stream';
import assign = require('object-assign');
import remote = require('gulp-remote-src');
......@@ -14,9 +14,33 @@ const rename = require('gulp-rename');
const util = require('gulp-util');
const buffer = require('gulp-buffer');
const json = require('gulp-json-editor');
import * as fs from 'fs';
import * as path from 'path';
import * as vsce from 'vsce';
import * as File from 'vinyl';
export function fromLocal(extensionPath: string): Stream {
const result = es.through();
vsce.listFiles({ cwd: extensionPath })
.then(fileNames => {
const files = fileNames
.map(fileName => path.join(extensionPath, fileName))
.map(filePath => new File({
path: filePath,
base: extensionPath,
contents: fs.createReadStream(filePath) as any
}));
es.readArray(files).pipe(result);
})
.catch(err => result.emit('error', err));
return result;
}
function error(err: any): Stream {
const result = through();
const result = es.through();
setTimeout(() => result.emit('error', err));
return result;
}
......@@ -26,7 +50,7 @@ const baseHeaders = {
'User-Agent': 'VSCode Build',
};
export function src(extensionName: string, version: string): Stream {
export function fromMarketplace(extensionName: string, version: string): Stream {
const filterType = 7;
const value = extensionName;
const criterium = { filterType, value };
......
......@@ -207,17 +207,6 @@ XLF.parse = function (xlfString) {
});
};
exports.XLF = XLF;
var vscodeLanguages = [
'chs',
'cht',
'jpn',
'kor',
'deu',
'fra',
'esn',
'rus',
'ita'
];
var iso639_3_to_2 = {
'chs': 'zh-cn',
'cht': 'zh-tw',
......@@ -347,7 +336,7 @@ function escapeCharacters(value) {
}
return result.join('');
}
function processCoreBundleFormat(fileHeader, json, emitter) {
function processCoreBundleFormat(fileHeader, languages, json, emitter) {
var keysSection = json.keys;
var messageSection = json.messages;
var bundleSection = json.bundles;
......@@ -375,8 +364,14 @@ function processCoreBundleFormat(fileHeader, json, emitter) {
});
});
var languageDirectory = path.join(__dirname, '..', '..', 'i18n');
var languages = sortLanguages(fs.readdirSync(languageDirectory).filter(function (item) { return fs.statSync(path.join(languageDirectory, item)).isDirectory(); }));
languages.forEach(function (language) {
var languageDirs;
if (languages) {
languageDirs = sortLanguages(languages);
}
else {
languageDirs = sortLanguages(fs.readdirSync(languageDirectory).filter(function (item) { return fs.statSync(path.join(languageDirectory, item)).isDirectory(); }));
}
languageDirs.forEach(function (language) {
if (!language.iso639_2) {
return;
}
......@@ -448,7 +443,8 @@ function processCoreBundleFormat(fileHeader, json, emitter) {
var value = statistics[key];
log(key + " has " + value + " untranslated strings.");
});
vscodeLanguages.forEach(function (language) {
languageDirs.forEach(function (dir) {
var language = dir.name;
var iso639_2 = iso639_3_to_2[language];
if (!iso639_2) {
log("\tCouldn't find iso639 2 mapping for language " + language + ". Using default language instead.");
......@@ -473,7 +469,7 @@ function processNlsFiles(opts) {
this.emit('error', "Failed to read component file: " + file.relative);
}
if (BundledFormat.is(json)) {
processCoreBundleFormat(opts.fileHeader, json, this);
processCoreBundleFormat(opts.fileHeader, opts.languages, json, this);
}
}
this.emit('data', file);
......@@ -505,55 +501,6 @@ function prepareXlfFiles(projectName, extensionName) {
}
exports.prepareXlfFiles = prepareXlfFiles;
var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench', extensionsProject = 'vscode-extensions', setupProject = 'vscode-setup';
/**
* Ensure to update those arrays when new resources are pushed to Transifex.
* Used because Transifex does not have API method to pull all project resources.
*/
var editorResources = [
{ name: 'vs/platform', project: editorProject },
{ name: 'vs/editor/contrib', project: editorProject },
{ name: 'vs/editor', project: editorProject },
{ name: 'vs/base', project: editorProject }
];
var workbenchResources = [
{ name: 'vs/code', project: workbenchProject },
{ name: 'vs/workbench', project: workbenchProject },
{ name: 'vs/workbench/parts/cli', project: workbenchProject },
{ name: 'vs/workbench/parts/codeEditor', project: workbenchProject },
{ name: 'vs/workbench/parts/debug', project: workbenchProject },
{ name: 'vs/workbench/parts/emmet', project: workbenchProject },
{ name: 'vs/workbench/parts/execution', project: workbenchProject },
{ name: 'vs/workbench/parts/explorers', project: workbenchProject },
{ name: 'vs/workbench/parts/extensions', project: workbenchProject },
{ name: 'vs/workbench/parts/feedback', project: workbenchProject },
{ name: 'vs/workbench/parts/files', project: workbenchProject },
{ name: 'vs/workbench/parts/html', project: workbenchProject },
{ name: 'vs/workbench/parts/markers', project: workbenchProject },
{ name: 'vs/workbench/parts/nps', project: workbenchProject },
{ name: 'vs/workbench/parts/output', project: workbenchProject },
{ name: 'vs/workbench/parts/performance', project: workbenchProject },
{ name: 'vs/workbench/parts/preferences', project: workbenchProject },
{ name: 'vs/workbench/parts/quickopen', project: workbenchProject },
{ name: 'vs/workbench/parts/scm', project: workbenchProject },
{ name: 'vs/workbench/parts/search', project: workbenchProject },
{ name: 'vs/workbench/parts/snippets', project: workbenchProject },
{ name: 'vs/workbench/parts/tasks', project: workbenchProject },
{ name: 'vs/workbench/parts/terminal', project: workbenchProject },
{ name: 'vs/workbench/parts/themes', project: workbenchProject },
{ name: 'vs/workbench/parts/trust', project: workbenchProject },
{ name: 'vs/workbench/parts/update', project: workbenchProject },
{ name: 'vs/workbench/parts/watermark', project: workbenchProject },
{ name: 'vs/workbench/parts/welcome', project: workbenchProject },
{ name: 'vs/workbench/services/configuration', project: workbenchProject },
{ name: 'vs/workbench/services/editor', project: workbenchProject },
{ name: 'vs/workbench/services/files', project: workbenchProject },
{ name: 'vs/workbench/services/keybinding', project: workbenchProject },
{ name: 'vs/workbench/services/message', project: workbenchProject },
{ name: 'vs/workbench/services/mode', project: workbenchProject },
{ name: 'vs/workbench/services/textfile', project: workbenchProject },
{ name: 'vs/workbench/services/themes', project: workbenchProject },
{ name: 'setup_messages', project: workbenchProject }
];
function getResource(sourceFile) {
var resource;
if (/^vs\/platform/.test(sourceFile)) {
......@@ -824,10 +771,12 @@ function updateResource(project, slug, xlfFile, apiHostname, credentials) {
function obtainProjectResources(projectName) {
var resources = [];
if (projectName === editorProject) {
resources = editorResources;
var json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8');
resources = JSON.parse(json).editor;
}
else if (projectName === workbenchProject) {
resources = workbenchResources;
var json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8');
resources = JSON.parse(json).workbench;
}
else if (projectName === extensionsProject) {
var extensionsToLocalize = glob.sync('./extensions/**/*.nls.json').map(function (extension) { return extension.split('/')[2]; });
......@@ -969,7 +918,9 @@ var encodings = {
'esn': 'CP1252',
'rus': 'CP1251',
'ita': 'CP1252',
'ptb': 'CP1252'
'ptb': 'CP1252',
'hun': 'CP1250',
'trk': 'CP1254'
};
function createIslFile(base, originalFilePath, messages, language) {
var content = [];
......
{
"editor": [
{
"name": "vs/platform",
"project": "vscode-editor"
},
{
"name": "vs/editor/contrib",
"project": "vscode-editor"
},
{
"name": "vs/editor",
"project": "vscode-editor"
},
{
"name": "vs/base",
"project": "vscode-editor"
}
],
"workbench": [
{
"name": "vs/code",
"project": "vscode-workbench"
},
{
"name": "vs/workbench",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/cli",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/codeEditor",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/debug",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/emmet",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/execution",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/explorers",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/extensions",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/feedback",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/files",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/html",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/markers",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/nps",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/output",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/performance",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/preferences",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/quickopen",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/relauncher",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/scm",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/search",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/snippets",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/surveys",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/tasks",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/terminal",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/themes",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/trust",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/update",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/views",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/watermark",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/welcome",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/configuration",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/crashReporter",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/editor",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/files",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/keybinding",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/message",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/mode",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/progress",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/textfile",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/textMate",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/services/themes",
"project": "vscode-workbench"
},
{
"name": "setup_messages",
"project": "vscode-workbench"
}
]
}
\ No newline at end of file
......@@ -272,18 +272,6 @@ export class XLF {
};
}
const vscodeLanguages: string[] = [
'chs',
'cht',
'jpn',
'kor',
'deu',
'fra',
'esn',
'rus',
'ita'
];
const iso639_3_to_2: Map<string> = {
'chs': 'zh-cn',
'cht': 'zh-tw',
......@@ -420,7 +408,7 @@ function escapeCharacters(value: string): string {
return result.join('');
}
function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitter: any) {
function processCoreBundleFormat(fileHeader: string, languages: string[], json: BundledFormat, emitter: any) {
let keysSection = json.keys;
let messageSection = json.messages;
let bundleSection = json.bundles;
......@@ -450,8 +438,13 @@ function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitte
});
let languageDirectory = path.join(__dirname, '..', '..', 'i18n');
let languages = sortLanguages(fs.readdirSync(languageDirectory).filter((item) => fs.statSync(path.join(languageDirectory, item)).isDirectory()));
languages.forEach((language) => {
let languageDirs;
if (languages) {
languageDirs = sortLanguages(languages);
} else {
languageDirs = sortLanguages(fs.readdirSync(languageDirectory).filter((item) => fs.statSync(path.join(languageDirectory, item)).isDirectory()));
}
languageDirs.forEach((language) => {
if (!language.iso639_2) {
return;
}
......@@ -523,7 +516,8 @@ function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitte
let value = statistics[key];
log(`${key} has ${value} untranslated strings.`);
});
vscodeLanguages.forEach(language => {
languageDirs.forEach(dir => {
const language = dir.name;
let iso639_2 = iso639_3_to_2[language];
if (!iso639_2) {
log(`\tCouldn't find iso639 2 mapping for language ${language}. Using default language instead.`);
......@@ -536,7 +530,7 @@ function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitte
});
}
export function processNlsFiles(opts: { fileHeader: string; }): ThroughStream {
export function processNlsFiles(opts: { fileHeader: string; languages: string[] }): ThroughStream {
return through(function (file: File) {
let fileName = path.basename(file.path);
if (fileName === 'nls.metadata.json') {
......@@ -547,7 +541,7 @@ export function processNlsFiles(opts: { fileHeader: string; }): ThroughStream {
this.emit('error', `Failed to read component file: ${file.relative}`);
}
if (BundledFormat.is(json)) {
processCoreBundleFormat(opts.fileHeader, json, this);
processCoreBundleFormat(opts.fileHeader, opts.languages, json, this);
}
}
this.emit('data', file);
......@@ -584,56 +578,6 @@ const editorProject: string = 'vscode-editor',
extensionsProject: string = 'vscode-extensions',
setupProject: string = 'vscode-setup';
/**
* Ensure to update those arrays when new resources are pushed to Transifex.
* Used because Transifex does not have API method to pull all project resources.
*/
const editorResources: Resource[] = [
{ name: 'vs/platform', project: editorProject },
{ name: 'vs/editor/contrib', project: editorProject },
{ name: 'vs/editor', project: editorProject },
{ name: 'vs/base', project: editorProject }
];
const workbenchResources: Resource[] = [
{ name: 'vs/code', project: workbenchProject },
{ name: 'vs/workbench', project: workbenchProject },
{ name: 'vs/workbench/parts/cli', project: workbenchProject },
{ name: 'vs/workbench/parts/codeEditor', project: workbenchProject },
{ name: 'vs/workbench/parts/debug', project: workbenchProject },
{ name: 'vs/workbench/parts/emmet', project: workbenchProject },
{ name: 'vs/workbench/parts/execution', project: workbenchProject },
{ name: 'vs/workbench/parts/explorers', project: workbenchProject },
{ name: 'vs/workbench/parts/extensions', project: workbenchProject },
{ name: 'vs/workbench/parts/feedback', project: workbenchProject },
{ name: 'vs/workbench/parts/files', project: workbenchProject },
{ name: 'vs/workbench/parts/html', project: workbenchProject },
{ name: 'vs/workbench/parts/markers', project: workbenchProject },
{ name: 'vs/workbench/parts/nps', project: workbenchProject },
{ name: 'vs/workbench/parts/output', project: workbenchProject },
{ name: 'vs/workbench/parts/performance', project: workbenchProject },
{ name: 'vs/workbench/parts/preferences', project: workbenchProject },
{ name: 'vs/workbench/parts/quickopen', project: workbenchProject },
{ name: 'vs/workbench/parts/scm', project: workbenchProject },
{ name: 'vs/workbench/parts/search', project: workbenchProject },
{ name: 'vs/workbench/parts/snippets', project: workbenchProject },
{ name: 'vs/workbench/parts/tasks', project: workbenchProject },
{ name: 'vs/workbench/parts/terminal', project: workbenchProject },
{ name: 'vs/workbench/parts/themes', project: workbenchProject },
{ name: 'vs/workbench/parts/trust', project: workbenchProject },
{ name: 'vs/workbench/parts/update', project: workbenchProject },
{ name: 'vs/workbench/parts/watermark', project: workbenchProject },
{ name: 'vs/workbench/parts/welcome', project: workbenchProject },
{ name: 'vs/workbench/services/configuration', project: workbenchProject },
{ name: 'vs/workbench/services/editor', project: workbenchProject },
{ name: 'vs/workbench/services/files', project: workbenchProject },
{ name: 'vs/workbench/services/keybinding', project: workbenchProject },
{ name: 'vs/workbench/services/message', project: workbenchProject },
{ name: 'vs/workbench/services/mode', project: workbenchProject },
{ name: 'vs/workbench/services/textfile', project: workbenchProject },
{ name: 'vs/workbench/services/themes', project: workbenchProject },
{ name: 'setup_messages', project: workbenchProject }
];
export function getResource(sourceFile: string): Resource {
let resource: string;
......@@ -924,9 +868,11 @@ function obtainProjectResources(projectName: string): Resource[] {
let resources: Resource[] = [];
if (projectName === editorProject) {
resources = editorResources;
const json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8');
resources = JSON.parse(json).editor;
} else if (projectName === workbenchProject) {
resources = workbenchResources;
const json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8');
resources = JSON.parse(json).workbench;
} else if (projectName === extensionsProject) {
let extensionsToLocalize: string[] = glob.sync('./extensions/**/*.nls.json').map(extension => extension.split('/')[2]);
let resourcesToPull: string[] = [];
......@@ -1086,7 +1032,9 @@ const encodings: Map<string> = {
'esn': 'CP1252',
'rus': 'CP1251',
'ita': 'CP1252',
'ptb': 'CP1252'
'ptb': 'CP1252',
'hun': 'CP1250',
'trk': 'CP1254'
};
function createIslFile(base: string, originalFilePath: string, messages: Map<string>, language: string): File {
......
"use strict";
var ts = require("./typescript/typescriptServices");
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var ts = require("typescript");
var lazy = require("lazy.js");
var event_stream_1 = require("event-stream");
var File = require("vinyl");
......@@ -69,7 +73,7 @@ function nls() {
return event_stream_1.duplex(input, output);
}
function isImportNode(node) {
return node.kind === 212 /* ImportDeclaration */ || node.kind === 211 /* ImportEqualsDeclaration */;
return node.kind === ts.SyntaxKind.ImportDeclaration || node.kind === ts.SyntaxKind.ImportEqualsDeclaration;
}
(function (nls_1) {
function fileFrom(file, contents, path) {
......@@ -111,27 +115,27 @@ function isImportNode(node) {
if (!ts.textSpanContainsTextSpan({ start: node.pos, length: node.end - node.pos }, textSpan)) {
return CollectStepResult.No;
}
return node.kind === 160 /* CallExpression */ ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse;
return node.kind === ts.SyntaxKind.CallExpression ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse;
}
function analyze(contents, options) {
if (options === void 0) { options = {}; }
var filename = 'file.ts';
var serviceHost = new SingleFileServiceHost(assign(clone(options), { noResolve: true }), filename, contents);
var service = ts.createLanguageService(serviceHost);
var sourceFile = service.getSourceFile(filename);
var sourceFile = ts.createSourceFile(filename, contents, ts.ScriptTarget.ES5, true);
// all imports
var imports = lazy(collect(sourceFile, function (n) { return isImportNode(n) ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; }));
// import nls = require('vs/nls');
var importEqualsDeclarations = imports
.filter(function (n) { return n.kind === 211 /* ImportEqualsDeclaration */; })
.filter(function (n) { return n.kind === ts.SyntaxKind.ImportEqualsDeclaration; })
.map(function (n) { return n; })
.filter(function (d) { return d.moduleReference.kind === 222 /* ExternalModuleReference */; })
.filter(function (d) { return d.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference; })
.filter(function (d) { return d.moduleReference.expression.getText() === '\'vs/nls\''; });
// import ... from 'vs/nls';
var importDeclarations = imports
.filter(function (n) { return n.kind === 212 /* ImportDeclaration */; })
.filter(function (n) { return n.kind === ts.SyntaxKind.ImportDeclaration; })
.map(function (n) { return n; })
.filter(function (d) { return d.moduleSpecifier.kind === 8 /* StringLiteral */; })
.filter(function (d) { return d.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral; })
.filter(function (d) { return d.moduleSpecifier.getText() === '\'vs/nls\''; })
.filter(function (d) { return !!d.importClause && !!d.importClause.namedBindings; });
var nlsExpressions = importEqualsDeclarations
......@@ -143,7 +147,7 @@ function isImportNode(node) {
}); });
// `nls.localize(...)` calls
var nlsLocalizeCallExpressions = importDeclarations
.filter(function (d) { return d.importClause.namedBindings.kind === 214 /* NamespaceImport */; })
.filter(function (d) { return d.importClause.namedBindings.kind === ts.SyntaxKind.NamespaceImport; })
.map(function (d) { return d.importClause.namedBindings.name; })
.concat(importEqualsDeclarations.map(function (d) { return d.name; }))
.map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); })
......@@ -153,10 +157,10 @@ function isImportNode(node) {
.map(function (a) { return lazy(a).last(); })
.filter(function (n) { return !!n; })
.map(function (n) { return n; })
.filter(function (n) { return n.expression.kind === 158 /* PropertyAccessExpression */ && n.expression.name.getText() === 'localize'; });
.filter(function (n) { return n.expression.kind === ts.SyntaxKind.PropertyAccessExpression && n.expression.name.getText() === 'localize'; });
// `localize` named imports
var allLocalizeImportDeclarations = importDeclarations
.filter(function (d) { return d.importClause.namedBindings.kind === 215 /* NamedImports */; })
.filter(function (d) { return d.importClause.namedBindings.kind === ts.SyntaxKind.NamedImports; })
.map(function (d) { return d.importClause.namedBindings.elements; })
.flatten();
// `localize` read-only references
......
import * as ts from './typescript/typescriptServices';
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as ts from 'typescript';
import * as lazy from 'lazy.js';
import { duplex, through } from 'event-stream';
import File = require('vinyl');
......@@ -171,7 +176,7 @@ module nls {
const filename = 'file.ts';
const serviceHost = new SingleFileServiceHost(assign(clone(options), { noResolve: true }), filename, contents);
const service = ts.createLanguageService(serviceHost);
const sourceFile = service.getSourceFile(filename);
const sourceFile = ts.createSourceFile(filename, contents, ts.ScriptTarget.ES5, true);
// all imports
const imports = lazy(collect(sourceFile, n => isImportNode(n) ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse));
......
......@@ -10,6 +10,8 @@ var sourcemaps = require("gulp-sourcemaps");
var filter = require("gulp-filter");
var minifyCSS = require("gulp-cssnano");
var uglify = require("gulp-uglify");
var composer = require("gulp-uglify/composer");
var uglifyes = require("uglify-es");
var es = require("event-stream");
var concat = require("gulp-concat");
var VinylFile = require("vinyl");
......@@ -163,7 +165,8 @@ function optimizeTask(opts) {
includeContent: true
}))
.pipe(i18n.processNlsFiles({
fileHeader: bundledFileHeader
fileHeader: bundledFileHeader,
languages: opts.languages
}))
.pipe(gulp.dest(out));
};
......@@ -200,12 +203,13 @@ function uglifyWithCopyrights() {
return false;
};
};
var minify = composer(uglifyes);
var input = es.through();
var output = input
.pipe(flatmap(function (stream, f) {
return stream.pipe(uglify({
preserveComments: preserveComments(f),
return stream.pipe(minify({
output: {
comments: preserveComments(f),
// linux tfs build agent is crashing, does this help?§
max_line_len: 3200000
}
......
......@@ -11,6 +11,8 @@ import * as sourcemaps from 'gulp-sourcemaps';
import * as filter from 'gulp-filter';
import * as minifyCSS from 'gulp-cssnano';
import * as uglify from 'gulp-uglify';
import * as composer from 'gulp-uglify/composer';
import * as uglifyes from 'uglify-es';
import * as es from 'event-stream';
import * as concat from 'gulp-concat';
import * as VinylFile from 'vinyl';
......@@ -158,6 +160,10 @@ export interface IOptimizeTaskOpts {
* (out folder name)
*/
out: string;
/**
* (languages to process)
*/
languages: string[];
}
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
const entryPoints = opts.entryPoints;
......@@ -228,7 +234,8 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
includeContent: true
}))
.pipe(i18n.processNlsFiles({
fileHeader: bundledFileHeader
fileHeader: bundledFileHeader,
languages: opts.languages
}))
.pipe(gulp.dest(out));
};
......@@ -271,12 +278,13 @@ function uglifyWithCopyrights(): NodeJS.ReadWriteStream {
};
};
const minify = composer(uglifyes);
const input = es.through();
const output = input
.pipe(flatmap((stream, f) => {
return stream.pipe(uglify({
preserveComments: preserveComments(<FileWithCopyright>f),
return stream.pipe(minify({
output: {
comments: preserveComments(<FileWithCopyright>f),
// linux tfs build agent is crashing, does this help?§
max_line_len: 3200000
}
......
......@@ -14,8 +14,10 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var ts = require("typescript");
var Lint = require("tslint");
var minimatch = require("minimatch");
var path_1 = require("path");
var Rule = (function (_super) {
__extends(Rule, _super);
function Rule() {
......@@ -41,16 +43,39 @@ var ImportPatterns = (function (_super) {
_this._config = _config;
return _this;
}
ImportPatterns.prototype.visitImportEqualsDeclaration = function (node) {
if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) {
this._validateImport(node.moduleReference.expression.getText(), node);
}
};
ImportPatterns.prototype.visitImportDeclaration = function (node) {
var path = node.moduleSpecifier.getText();
this._validateImport(node.moduleSpecifier.getText(), node);
};
ImportPatterns.prototype._validateImport = function (path, node) {
// remove quotes
path = path.slice(1, -1);
// ignore relative paths
// resolve relative paths
if (path[0] === '.') {
return;
path = path_1.join(this.getSourceFile().fileName, path);
}
var restrictions;
if (typeof this._config.restrictions === 'string') {
restrictions = [this._config.restrictions];
}
else {
restrictions = this._config.restrictions;
}
var matched = false;
for (var _i = 0, restrictions_1 = restrictions; _i < restrictions_1.length; _i++) {
var pattern = restrictions_1[_i];
if (minimatch(path, pattern)) {
matched = true;
break;
}
}
if (!minimatch(path, this._config.restrictions)) {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Imports violates '" + this._config.restrictions + "'-restriction."));
if (!matched) {
// None of the restrictions matched
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Imports violates '" + restrictions.join(' or ') + "' restrictions. See https://github.com/Microsoft/vscode/wiki/Code-Organization"));
}
};
return ImportPatterns;
......
......@@ -6,10 +6,11 @@
import * as ts from 'typescript';
import * as Lint from 'tslint';
import * as minimatch from 'minimatch';
import { join } from 'path';
interface ImportPatternsConfig {
target: string;
restrictions: string;
restrictions: string | string[];
}
export class Rule extends Lint.Rules.AbstractRule {
......@@ -34,19 +35,43 @@ class ImportPatterns extends Lint.RuleWalker {
super(file, opts);
}
protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void {
if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) {
this._validateImport(node.moduleReference.expression.getText(), node);
}
}
protected visitImportDeclaration(node: ts.ImportDeclaration): void {
let path = node.moduleSpecifier.getText();
this._validateImport(node.moduleSpecifier.getText(), node);
}
private _validateImport(path: string, node: ts.Node): void {
// remove quotes
path = path.slice(1, -1);
// ignore relative paths
// resolve relative paths
if (path[0] === '.') {
return;
path = join(this.getSourceFile().fileName, path);
}
let restrictions: string[];
if (typeof this._config.restrictions === 'string') {
restrictions = [this._config.restrictions];
} else {
restrictions = this._config.restrictions;
}
let matched = false;
for (const pattern of restrictions) {
if (minimatch(path, pattern)) {
matched = true;
break;
}
}
if (!minimatch(path, this._config.restrictions)) {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Imports violates '${this._config.restrictions}'-restriction.`));
if (!matched) {
// None of the restrictions matched
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Imports violates '${restrictions.join(' or ')}' restrictions. See https://github.com/Microsoft/vscode/wiki/Code-Organization`));
}
}
}
......@@ -14,6 +14,7 @@ var __extends = (this && this.__extends) || (function () {
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var ts = require("typescript");
var Lint = require("tslint");
var path_1 = require("path");
var Rule = (function (_super) {
......@@ -54,8 +55,15 @@ var LayeringRule = (function (_super) {
_this._config = config;
return _this;
}
LayeringRule.prototype.visitImportEqualsDeclaration = function (node) {
if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) {
this._validateImport(node.moduleReference.expression.getText(), node);
}
};
LayeringRule.prototype.visitImportDeclaration = function (node) {
var path = node.moduleSpecifier.getText();
this._validateImport(node.moduleSpecifier.getText(), node);
};
LayeringRule.prototype._validateImport = function (path, node) {
// remove quotes
path = path.slice(1, -1);
if (path[0] === '.') {
......
......@@ -51,9 +51,17 @@ class LayeringRule extends Lint.RuleWalker {
this._config = config;
}
protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void {
if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) {
this._validateImport(node.moduleReference.expression.getText(), node);
}
}
protected visitImportDeclaration(node: ts.ImportDeclaration): void {
let path = node.moduleSpecifier.getText();
this._validateImport(node.moduleSpecifier.getText(), node);
}
private _validateImport(path: string, node: ts.Node): void {
// remove quotes
path = path.slice(1, -1);
......
......@@ -70,10 +70,10 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) {
var _this = this;
_super.prototype.visitSourceFile.call(this, node);
Object.keys(this.usedKeys).forEach(function (key) {
var occurences = _this.usedKeys[key];
if (occurences.length > 1) {
occurences.forEach(function (occurence) {
_this.addFailure((_this.createFailure(occurence.key.getStart(), occurence.key.getWidth(), "Duplicate key " + occurence.key.getText() + " with different message value.")));
var occurrences = _this.usedKeys[key];
if (occurrences.length > 1) {
occurrences.forEach(function (occurrence) {
_this.addFailure((_this.createFailure(occurrence.key.getStart(), occurrence.key.getWidth(), "Duplicate key " + occurrence.key.getText() + " with different message value.")));
});
}
});
......@@ -140,17 +140,17 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) {
};
NoUnexternalizedStringsRuleWalker.prototype.recordKey = function (keyNode, messageNode) {
var text = keyNode.getText();
var occurences = this.usedKeys[text];
if (!occurences) {
occurences = [];
this.usedKeys[text] = occurences;
var occurrences = this.usedKeys[text];
if (!occurrences) {
occurrences = [];
this.usedKeys[text] = occurrences;
}
if (messageNode) {
if (occurences.some(function (pair) { return pair.message ? pair.message.getText() === messageNode.getText() : false; })) {
if (occurrences.some(function (pair) { return pair.message ? pair.message.getText() === messageNode.getText() : false; })) {
return;
}
}
occurences.push({ key: keyNode, message: messageNode });
occurrences.push({ key: keyNode, message: messageNode });
};
NoUnexternalizedStringsRuleWalker.prototype.findDescribingParent = function (node) {
var parent;
......
......@@ -82,10 +82,10 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
protected visitSourceFile(node: ts.SourceFile): void {
super.visitSourceFile(node);
Object.keys(this.usedKeys).forEach(key => {
let occurences = this.usedKeys[key];
if (occurences.length > 1) {
occurences.forEach(occurence => {
this.addFailure((this.createFailure(occurence.key.getStart(), occurence.key.getWidth(), `Duplicate key ${occurence.key.getText()} with different message value.`)));
let occurrences = this.usedKeys[key];
if (occurrences.length > 1) {
occurrences.forEach(occurrence => {
this.addFailure((this.createFailure(occurrence.key.getStart(), occurrence.key.getWidth(), `Duplicate key ${occurrence.key.getText()} with different message value.`)));
});
}
});
......@@ -157,17 +157,17 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
private recordKey(keyNode: ts.StringLiteral, messageNode: ts.Node) {
let text = keyNode.getText();
let occurences: KeyMessagePair[] = this.usedKeys[text];
if (!occurences) {
occurences = [];
this.usedKeys[text] = occurences;
let occurrences: KeyMessagePair[] = this.usedKeys[text];
if (!occurrences) {
occurrences = [];
this.usedKeys[text] = occurrences;
}
if (messageNode) {
if (occurences.some(pair => pair.message ? pair.message.getText() === messageNode.getText() : false)) {
if (occurrences.some(pair => pair.message ? pair.message.getText() === messageNode.getText() : false)) {
return;
}
}
occurences.push({ key: keyNode, message: messageNode });
occurrences.push({ key: keyNode, message: messageNode });
}
private findDescribingParent(node: ts.Node): { callInfo?: { callExpression: ts.CallExpression, argIndex: number }, ignoreUsage?: boolean; } {
......
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Lint = require("tslint");
var fs = require("fs");
var Rule = (function (_super) {
__extends(Rule, _super);
function Rule() {
return _super !== null && _super.apply(this, arguments) || this;
}
Rule.prototype.apply = function (sourceFile) {
return this.applyWithWalker(new TranslationRemindRuleWalker(sourceFile, this.getOptions()));
};
return Rule;
}(Lint.Rules.AbstractRule));
exports.Rule = Rule;
var TranslationRemindRuleWalker = (function (_super) {
__extends(TranslationRemindRuleWalker, _super);
function TranslationRemindRuleWalker(file, opts) {
return _super.call(this, file, opts) || this;
}
TranslationRemindRuleWalker.prototype.visitImportDeclaration = function (node) {
var declaration = node.moduleSpecifier.getText();
if (declaration !== "'" + TranslationRemindRuleWalker.NLS_MODULE + "'") {
return;
}
this.visitImportLikeDeclaration(node);
};
TranslationRemindRuleWalker.prototype.visitImportEqualsDeclaration = function (node) {
var reference = node.moduleReference.getText();
if (reference !== "require('" + TranslationRemindRuleWalker.NLS_MODULE + "')") {
return;
}
this.visitImportLikeDeclaration(node);
};
TranslationRemindRuleWalker.prototype.visitImportLikeDeclaration = function (node) {
var currentFile = node.getSourceFile().fileName;
var matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
var matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/);
if (!matchService && !matchPart) {
return;
}
var resource = matchService ? matchService[0] : matchPart[0];
var resourceDefined = false;
var json;
try {
json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8');
}
catch (e) {
console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.');
return;
}
var workbenchResources = JSON.parse(json).workbench;
workbenchResources.forEach(function (existingResource) {
if (existingResource.name === resource) {
resourceDefined = true;
return;
}
});
if (!resourceDefined) {
this.addFailureAtNode(node, "Please add '" + resource + "' to ./builds/lib/i18n.resources.json file to use translations here.");
}
};
return TranslationRemindRuleWalker;
}(Lint.RuleWalker));
TranslationRemindRuleWalker.NLS_MODULE = 'vs/nls';
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as ts from 'typescript';
import * as Lint from 'tslint';
import * as fs from 'fs';
export class Rule extends Lint.Rules.AbstractRule {
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
return this.applyWithWalker(new TranslationRemindRuleWalker(sourceFile, this.getOptions()));
}
}
class TranslationRemindRuleWalker extends Lint.RuleWalker {
private static NLS_MODULE: string = 'vs/nls';
constructor(file: ts.SourceFile, opts: Lint.IOptions) {
super(file, opts);
}
protected visitImportDeclaration(node: ts.ImportDeclaration): void {
const declaration = node.moduleSpecifier.getText();
if (declaration !== `'${TranslationRemindRuleWalker.NLS_MODULE}'`) {
return;
}
this.visitImportLikeDeclaration(node);
}
protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void {
const reference = node.moduleReference.getText();
if (reference !== `require('${TranslationRemindRuleWalker.NLS_MODULE}')`) {
return;
}
this.visitImportLikeDeclaration(node);
}
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+/);
if (!matchService && !matchPart) {
return;
}
const resource = matchService ? matchService[0] : matchPart[0];
let resourceDefined = false;
let json;
try {
json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8');
} catch (e) {
console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.');
return;
}
const workbenchResources = JSON.parse(json).workbench;
workbenchResources.forEach(existingResource => {
if (existingResource.name === resource) {
resourceDefined = true;
return;
}
});
if (!resourceDefined) {
this.addFailureAtNode(node, `Please add '${resource}' to ./builds/lib/i18n.resources.json file to use translations here.`);
}
}
}
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS:
[
{
"name": "typescript-legacy",
"version": "1.5",
"license": "Apache2",
"repositoryURL": "https://github.com/Microsoft/TypeScript",
// Reason: LICENSE file does not include Copyright statement
"licenseDetail": [
"Copyright (c) Microsoft Corporation. All rights reserved. ",
"",
"Apache License",
"",
"Version 2.0, January 2004",
"",
"http://www.apache.org/licenses/",
"",
"TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION",
"",
"1. Definitions.",
"",
"\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.",
"",
"\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.",
"",
"\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.",
"",
"\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.",
"",
"\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.",
"",
"\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.",
"",
"\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).",
"",
"\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.",
"",
"\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"",
"",
"\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.",
"",
"2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.",
"",
"3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.",
"",
"4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:",
"",
"You must give any other recipients of the Work or Derivative Works a copy of this License; and",
"",
"You must cause any modified files to carry prominent notices stating that You changed the files; and",
"",
"You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and",
"",
"If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.",
"",
"5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.",
"",
"6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.",
"",
"7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.",
"",
"8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.",
"",
"9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.",
"",
"END OF TERMS AND CONDITIONS"
],
"isDev": true
}
]
\ No newline at end of file
此差异已折叠。
此差异已折叠。
// Type definitions for gulp-uglify
// Project: https://github.com/terinjokes/gulp-uglify
// Definitions by: Christopher Haws <https://github.com/ChristopherHaws/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "gulp-uglify" {
import * as UglifyJS from 'uglify-js';
namespace GulpUglify {
interface Options {
/**
* Pass false to skip mangling names.
*/
mangle?: boolean;
/**
* Pass if you wish to specify additional output options. The defaults are optimized for best compression.
*/
output?: UglifyJS.BeautifierOptions;
/**
* Pass an object to specify custom compressor options. Pass false to skip compression completely.
*/
compress?: UglifyJS.CompressorOptions | boolean;
/**
* A convenience option for options.output.comments. Defaults to preserving no comments.
* all - Preserve all comments in code blocks
* some - Preserve comments that start with a bang (!) or include a Closure Compiler directive (@preserve, @license, @cc_on)
* function - Specify your own comment preservation function. You will be passed the current node and the current comment and are expected to return either true or false.
*/
preserveComments?: string | ((node: any, comment: UglifyJS.Tokenizer) => boolean);
warnings?: boolean;
}
class GulpUglifyError {
cause: {
filename: string;
};
}
}
function GulpUglify(options?: GulpUglify.Options): NodeJS.ReadWriteStream;
export = GulpUglify;
}
\ No newline at end of file
// Type definitions for UglifyJS 2 v2.6.1
// Project: https://github.com/mishoo/UglifyJS2
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'uglify-js' {
import * as MOZ_SourceMap from 'source-map';
namespace UglifyJS {
interface Tokenizer {
/**
* The type of this token.
* Can be "num", "string", "regexp", "operator", "punc", "atom", "name", "keyword", "comment1" or "comment2".
* "comment1" and "comment2" are for single-line, respectively multi-line comments.
*/
type: string;
/**
* The name of the file where this token originated from. Useful when compressing multiple files at once to generate the proper source map.
*/
file: string;
/**
* The "value" of the token.
* That's additional information and depends on the token type: "num", "string" and "regexp" tokens you get their literal value.
* - For "operator" you get the operator.
* - For "punc" it's the punctuation sign (parens, comma, semicolon etc).
* - For "atom", "name" and "keyword" it's the name of the identifier
* - For comments it's the body of the comment (excluding the initial "//" and "/*".
*/
value: string;
/**
* The line number of this token in the original code.
* 1-based index.
*/
line: number;
/**
* The column number of this token in the original code.
* 0-based index.
*/
col: number;
/**
* Short for "newline before", it's a boolean that tells us whether there was a newline before this node in the original source. It helps for automatic semicolon insertion.
* For multi-line comments in particular this will be set to true if there either was a newline before this comment, or * * if this comment contains a newline.
*/
nlb: boolean;
/**
* This doesn't apply for comment tokens, but for all other token types it will be an array of comment tokens that were found before.
*/
comments_before: string[];
}
interface AST_Node {
// The first token of this node
start: AST_Node;
// The last token of this node
end: AST_Node;
transform(tt: TreeTransformer): AST_Toplevel;
}
interface AST_Toplevel extends AST_Node {
// UglifyJS contains a scope analyzer which figures out variable/function definitions, references etc.
// You need to call it manually before compression or mangling.
// The figure_out_scope method is defined only on the AST_Toplevel node.
figure_out_scope(): void;
// Get names that are optimized for GZip compression (names will be generated using the most frequent characters first)
compute_char_frequency(): void;
mangle_names(): void;
print(stream: OutputStream): void;
print_to_string(options?: BeautifierOptions): string;
}
interface MinifyOptions {
spidermonkey?: boolean;
outSourceMap?: string;
sourceRoot?: string;
inSourceMap?: string;
fromString?: boolean;
warnings?: boolean;
mangle?: Object;
output?: MinifyOutput,
compress?: Object;
}
interface MinifyOutput {
code: string;
map: string;
}
function minify(files: string | Array<string>, options?: MinifyOptions): MinifyOutput;
interface ParseOptions {
// Default is false
strict?: boolean;
// Input file name, default is null
filename?: string;
// Default is null
toplevel?: AST_Toplevel;
}
/**
* The parser creates a custom abstract syntax tree given a piece of JavaScript code.
* Perhaps you should read about the AST first.
*/
function parse(code: string, options?: ParseOptions): AST_Toplevel;
interface BeautifierOptions {
/**
* Start indentation on every line (only when `beautify`)
*/
indent_start?: number;
/**
* Indentation level (only when `beautify`)
*/
indent_level?: number;
/**
* Quote all keys in object literals?
*/
quote_keys?: boolean;
/**
* Add a space after colon signs?
*/
space_colon?: boolean;
/**
* Output ASCII-safe? (encodes Unicode characters as ASCII)
*/
ascii_only?: boolean;
/**
* Escape "</script"?
*/
inline_script?: boolean;
/**
* Informative maximum line width (for beautified output)
*/
width?: number;
/**
* Maximum line length (for non-beautified output)
*/
max_line_len?: number;
/**
* Output IE-safe code?
*/
ie_proof?: boolean;
/**
* Beautify output?
*/
beautify?: boolean;
/**
* Output a source map
*/
source_map?: SourceMapOptions;
/**
* Use brackets every time?
*/
bracketize?: boolean;
/**
* Output comments?
*/
comments?: boolean;
/**
* Use semicolons to separate statements? (otherwise, newlines)
*/
semicolons?: boolean;
}
interface OutputStream {
// Return the output so far as a string
get(): string;
toString(): string;
// Insert one indentation string (usually 4 characters).
// Optionally pass true to indent half the width (I'm using that for case and default lines in switch blocks.
// If beautify is off, this function does nothing.
indent(half?: boolean): void;
// Return the current indentation width (not level; for example if we're in level 2 and indent_level is 4, this method would return 8.
indentation(): number;
// return the width of the current line text minus indentation.
current_width(): number
// Return true if current_width() is bigger than options.width (assuming options.width is non-null, non-zero).
should_break(): boolean;
// If beautification is on, this inserts a newline. Otherwise it does nothing.
newline(): void;
// Include the given string into the output, adjusting current_line, current_col and current_pos accordingly.
print(str: string): void;
// If beautification is on this always includes a space character.
// Otherwise it saves a hint somewhere that a space might be needed at current point.
// The space will go in at the next output but only when absolutely required, for example it will insert the space in return 10 but not in return"stuff".
space(): void;
// Inserts a comma, and calls space() — that is, if beautification is on you'll get a space after the comma.
comma(): void;
// Inserts a colon, and calls space() if options.space_colon is set.
colon(): void;
// Returns the last printed chunk.
last(): string;
// If beautification is on it always inserts a semicolon.
// Otherwise it saves a hint that a semicolon might be needed at current point.
// The semicolon is inserted when the next output comes in, only if required to not break the JS syntax.
semicolon(): void;
// Always inserts a semicolon and clears the hint that a semicolon might be needed.
force_semicolon(): void;
// Encodes any non-ASCII characters in string with JavaScript's conventions (using \uCODE).
to_ascii(str: string): void;
// Prints an identifier. If options.ascii_only is set, non-ASCII chars will be encoded with JavaScript conventions.
print_name(name: string): void;
// Prints a string. It adds quotes automatically.
// It prefers double-quotes, but will actually count any quotes in the string and will use single-quotes if the output proves to be shorter (depending on how many backslashes it has to insert).
// It encodes to ASCII if options.ascii_only is set.
print_string(str: string): void;
// Returns the width of the next indentation level. For example if current level is 2 and options.indent_level is 4, it'll return 12.
next_indent(): number;
// Sets the current indentation to col (column), calls the function and thereafter restores the previous indentation level.
// If beautification is off it simply calls func.
with_indent(col: number, func: Function): void;
// This is used to output blocks in curly brackets.
// It'll print an open bracket at current point, then call newline() and with the next indentation level it calls your func.
// Lastly, it'll print an indented closing bracket. As usual, if beautification is off you'll just get {x} where x is whatever func outputs.
with_block(func: Function): void;
// Adds parens around the output that your function prints.
with_parens(func: Function): void;
// Adds square brackets around the output that your function prints.
with_square(func: Function): void;
// If options.source_map is set, this will generate a source mapping between the given token (which should be an AST_Token-like object) and the current line/col.
// The name is optional; in most cases it will be inferred from the token.
add_mapping(token: AST_Node, name?: string): void;
// Returns the option with the given name.
option(name: string): any;
// Returns the current line in the output (1-based).
line(): number;
// Returns the current column in the output (zero-based).
col(): number;
// Push the given node into an internal stack. This is used to keep track of current node's parent(s).
push_node(node: AST_Node): void;
// Pops the top of the stack and returns it.
pop_node(): AST_Node;
// Returns that internal stack.
stack(): any;
// Returns the n-th parent node (where zero means the direct parent).
parent(n: number): AST_Node;
}
/**
* The code generator is a recursive process of getting back source code from an AST returned by the parser.
* Every AST node has a “print” method that takes an OutputStream and dumps the code from that node into it.
* The stream object supports a lot of options that control the output.
* You can specify whether you'd like to get human-readable (indented) output, the indentation level, whether you'd like to quote all properties in object literals etc.
*/
function OutputStream(options?: BeautifierOptions): OutputStream;
interface SourceMapOptions {
/**
* The compressed file name
*/
file?: string;
/**
* The root URL to the original sources
*/
root?: string;
/**
* The input source map.
* Useful when you compress code that was generated from some other source (possibly other programming language).
* If you have an input source map, pass it in this argument and UglifyJS will generate a mapping that maps back
* to the original source (as opposed to the compiled code that you are compressing).
*/
orig?: Object | JSON;
}
interface SourceMap {
add(source: string, gen_line: number, gen_col: number, orig_line: number, orig_col: number, name?: string): void;
get(): MOZ_SourceMap.SourceMapGenerator;
toString(): string;
}
/**
* The output stream keeps track of the current line/column in the output and can trivially generate a source mapping to the original code via Mozilla's source-map library.
* To use this functionality, you must load this library (it's automatically require-d by UglifyJS in the NodeJS version, but in a browser you must load it yourself)
* and make it available via the global MOZ_SourceMap variable.
*/
function SourceMap(options?: SourceMapOptions): SourceMap;
interface CompressorOptions {
// Join consecutive statemets with the “comma operator”
sequences?: boolean;
// Optimize property access: a["foo"] → a.foo
properties?: boolean;
// Discard unreachable code
dead_code?: boolean;
// Discard “debugger” statements
drop_debugger?: boolean;
// Some unsafe optimizations (see below)
unsafe?: boolean;
// Optimize if-s and conditional expressions
conditionals?: boolean;
// Optimize comparisons
comparisons?: boolean;
// Evaluate constant expressions
evaluate?: boolean;
// Optimize boolean expressions
booleans?: boolean;
// Optimize loops
loops?: boolean;
// Drop unused variables/functions
unused?: boolean;
// Hoist function declarations
hoist_funs?: boolean;
// Hoist variable declarations
hoist_vars?: boolean;
// Optimize if-s followed by return/continue
if_return?: boolean;
// Join var declarations
join_vars?: boolean;
// Try to cascade `right` into `left` in sequences
cascade?: boolean;
// Drop side-effect-free statements
side_effects?: boolean;
// Warn about potentially dangerous optimizations/code
warnings?: boolean;
// Global definitions
global_defs?: Object;
}
/**
* The compressor is a tree transformer which reduces the code size by applying various optimizations on the AST
*/
function Compressor(options?: CompressorOptions): AST_Toplevel;
// TODO
interface TreeWalker {
}
type visitor = (node: AST_Node, descend: Function) => boolean;
/**
* UglifyJS provides a TreeWalker object and every node has a walk method that given a walker will apply your visitor to each node in the tree.
* Your visitor can return a non-falsy value in order to prevent descending the current node.
*/
function TreeWalker(visitor: visitor): TreeWalker;
// TODO
interface TreeTransformer extends TreeWalker {
}
/**
* The tree transformer is a special case of a tree walker.
* In fact it even inherits from TreeWalker and you can use the same methods, but initialization and visitor protocol are a bit different.
*/
function TreeTransformer(before: visitor, after: visitor): TreeTransformer;
}
export = UglifyJS;
}
\ No newline at end of file
此差异已折叠。
......@@ -57,19 +57,20 @@ declare module monaco {
declare module monaco.editor {
#includeAll(vs/editor/browser/standalone/standaloneEditor;modes.=>languages.;editorCommon.=>):
#include(vs/editor/common/services/standaloneThemeService): BuiltinTheme, IStandaloneThemeData, IColors
#includeAll(vs/editor/standalone/browser/standaloneEditor;modes.=>languages.;editorCommon.=>):
#include(vs/editor/standalone/common/standaloneThemeService): BuiltinTheme, IStandaloneThemeData, IColors
#include(vs/editor/common/modes/supports/tokenization): ITokenThemeRule
#include(vs/editor/common/services/webWorker): MonacoWebWorker, IWebWorkerOptions
#include(vs/editor/browser/standalone/standaloneCodeEditor): IEditorConstructionOptions, IDiffEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor
#include(vs/editor/standalone/browser/standaloneCodeEditor): IEditorConstructionOptions, IDiffEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor
export interface ICommandHandler {
(...args:any[]): void;
}
#include(vs/platform/contextkey/common/contextkey): IContextKey
#include(vs/editor/browser/standalone/standaloneServices): IEditorOverrideServices
#include(vs/editor/standalone/browser/standaloneServices): IEditorOverrideServices
#include(vs/platform/markers/common/markers): IMarkerData
#include(vs/editor/browser/standalone/colorizer): IColorizerOptions, IColorizerElementOptions
#include(vs/editor/standalone/browser/colorizer): IColorizerOptions, IColorizerElementOptions
#include(vs/base/common/scrollable): ScrollbarVisibility
#include(vs/platform/theme/common/themeService): ThemeColor
#includeAll(vs/editor/common/editorCommon;IMode=>languages.IMode;LanguageIdentifier=>languages.LanguageIdentifier;editorOptions.=>): ISelection, IScrollEvent
#includeAll(vs/editor/common/model/textModelEvents):
#includeAll(vs/editor/common/controller/cursorEvents):
......@@ -80,11 +81,11 @@ export interface ICommandHandler {
declare module monaco.languages {
#includeAll(vs/editor/browser/standalone/standaloneLanguages;modes.=>;editorCommon.=>editor.;IMarkerData=>editor.IMarkerData):
#includeAll(vs/editor/standalone/browser/standaloneLanguages;modes.=>;editorCommon.=>editor.;IMarkerData=>editor.IMarkerData):
#includeAll(vs/editor/common/modes/languageConfiguration):
#includeAll(vs/editor/common/modes;editorCommon.IRange=>IRange;editorCommon.IPosition=>IPosition;editorCommon.=>editor.):
#include(vs/editor/common/services/modeService): ILanguageExtensionPoint
#includeAll(vs/editor/common/modes/monarch/monarchTypes):
#includeAll(vs/editor/standalone/common/monarch/monarchTypes):
}
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const cp = require('child_process');
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
function updateGrammar(location) {
const result = cp.spawnSync(npm, ['run', 'update-grammar'], {
cwd: location,
stdio: 'inherit'
});
if (result.error || result.status !== 0) {
process.exit(1);
}
}
const extensions = [
// 'bat' Grammar no longer available
'clojure',
'coffeescript',
'cpp',
'csharp',
'css',
'diff',
'docker',
'fsharp',
'gitsyntax',
'go',
'groovy',
'handlebars',
'hlsl',
'html',
'ini',
'java',
// 'javascript', updated through JavaScript
// 'json', customized
'less',
'lua',
'make',
'markdown',
'objective-c',
'perl',
'php',
// 'powershell', grammar not ready yet, @daviwil will ping when ready
'pug',
'python',
'r',
'razor',
'ruby',
'rust',
'scss',
'shaderlab',
'shellscript',
// 'sql', customized, PRs pending
'swift',
'typescript',
'vb',
'xml',
'yaml'
];
extensions.forEach(extension => updateGrammar(`extensions/${extension}`));
// run integration tests
if (process.platform === 'win32') {
cp.spawn('.\scripts\test-integration.bat', [], { env: process.env, stdio: 'inherit' });
} else {
cp.spawn('/bin/bash', ['./scripts/test-integration.sh'], { env: process.env, stdio: 'inherit' });
}
\ No newline at end of file
......@@ -25,19 +25,28 @@ function getOptions(urlString) {
}
}
function download(url) {
return new Promise((c, e) => {
var content = '';
var request = https.get(getOptions(url), function (response) {
function download(url, redirectCount) {
return new Promise((c, e) => {
var content = '';
https.get(getOptions(url), function (response) {
response.on('data', function (data) {
content += data.toString();
}).on('end', function () {
let count = redirectCount || 0;
if (count < 5 && response.statusCode >= 300 && response.statusCode <= 303 || response.statusCode === 307) {
let location = response.headers['location'];
if (location) {
console.log("Redirected " + url + " to " + location);
download(location, count+1).then(c, e);
return;
}
}
c(content);
});
}).on('error', function (err) {
e(err.message);
});
});
});
}
function getCommitSha(repoId, repoPath) {
......@@ -46,14 +55,15 @@ function getCommitSha(repoId, repoPath) {
try {
let lastCommit = JSON.parse(content)[0];
return Promise.resolve({
commitSha : lastCommit.sha,
commitDate : lastCommit.commit.author.date
commitSha: lastCommit.sha,
commitDate: lastCommit.commit.author.date
});
} catch (e) {
console.error("Failed extracting the SHA: " + content);
return Promise.resolve(null);
}
}, function () {
console.err('Failed loading ' + commitInfo);
console.error('Failed loading ' + commitInfo);
return Promise.resolve(null);
});
}
......@@ -78,11 +88,23 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) {
modifyGrammar(grammar);
}
return getCommitSha(repoId, repoPath).then(function (info) {
let result = {
information_for_contributors: [
'This file has been converted from https://github.com/' + repoId + '/blob/master/' + repoPath,
'If you want to provide a fix or improvement, please create a pull request against the original repository.',
'Once accepted there, we are happy to receive an update request.'
]
};
if (info) {
grammar.version = 'https://github.com/' + repoId + '/commit/' + info.commitSha;
result.version = 'https://github.com/' + repoId + '/commit/' + info.commitSha;
}
for (let key in grammar) {
result[key] = grammar[key];
}
try {
fs.writeFileSync(dest, JSON.stringify(grammar, null, '\t'));
fs.writeFileSync(dest, JSON.stringify(result, null, '\t'));
if (info) {
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')');
} else {
......@@ -97,7 +119,7 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) {
}
if (path.basename(process.argv[1]) === 'update-grammar.js') {
for (var i = 3; i < process.argv.length; i+=2) {
exports.update(process.argv[2], process.argv[i], process.argv[i+1]);
for (var i = 3; i < process.argv.length; i += 2) {
exports.update(process.argv[2], process.argv[i], process.argv[i + 1]);
}
}
......@@ -30,24 +30,5 @@ step "Run unit tests" \
step "Run integration tests" \
./scripts/test-integration.sh
(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \
step "Install build dependencies" \
npm i)
REPO=`pwd`
ZIP=$REPO/../VSCode-darwin-selfsigned.zip
UNSIGNEDZIP=$REPO/../VSCode-darwin-unsigned.zip
BUILD=$REPO/../VSCode-darwin
PACKAGEJSON=`ls $BUILD/*.app/Contents/Resources/app/package.json`
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
rm -rf $UNSIGNEDZIP
(cd $BUILD && \
step "Create unsigned archive" \
zip -r -X -y $UNSIGNEDZIP *)
step "Upload unsigned archive" \
node build/tfs/common/publish.js --upload-only $VSCODE_QUALITY darwin archive-unsigned VSCode-darwin-$VSCODE_QUALITY-unsigned.zip $VERSION false $UNSIGNEDZIP
step "Sign build" \
node build/tfs/common/enqueue.js $VSCODE_QUALITY
\ No newline at end of file
step "Publish release" \
./build/tfs/darwin/release.sh
\ No newline at end of file
#!/bin/sh
. ./scripts/env.sh
. ./build/tfs/common/common.sh
(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \
step "Install build dependencies" \
npm i)
REPO=`pwd`
ZIP=$REPO/../VSCode-darwin-selfsigned.zip
UNSIGNEDZIP=$REPO/../VSCode-darwin-unsigned.zip
BUILD=$REPO/../VSCode-darwin
PACKAGEJSON=`ls $BUILD/*.app/Contents/Resources/app/package.json`
VERSION=`node -p "require(\"$PACKAGEJSON\").version"`
rm -rf $UNSIGNEDZIP
(cd $BUILD && \
step "Create unsigned archive" \
zip -r -X -y $UNSIGNEDZIP *)
step "Upload unsigned archive" \
node build/tfs/common/publish.js --upload-only $VSCODE_QUALITY darwin archive-unsigned VSCode-darwin-$VSCODE_QUALITY-unsigned.zip $VERSION false $UNSIGNEDZIP
step "Sign build" \
node build/tfs/common/enqueue.js $VSCODE_QUALITY
\ No newline at end of file
#!/bin/sh
. ./scripts/env.sh
. ./build/tfs/common/common.sh
export VSCODE_MIXIN_PASSWORD="$1"
VSO_PAT="$2"
echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc
step "Install dependencies" \
npm install
step "Mix in repository from vscode-distro" \
npm run gulp -- mixin
step "Install distro dependencies" \
node build/tfs/common/installDistro.js
step "Build minified & upload source maps" \
npm run gulp -- --max_old_space_size=4096 vscode-darwin-min
step "Run smoke test" \
pushd test/smoke
npm install
npm run compile
node src/main.js --latest "$AGENT_BUILDDIRECTORY/VSCode-darwin/Visual Studio Code - Insiders.app/Contents/MacOS/Electron"
popd
\ No newline at end of file
......@@ -32,84 +32,5 @@ step "Build minified" \
step "Run unit tests" \
./scripts/test.sh --xvfb --build --reporter dot
step "Build Debian package" \
npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-build-deb"
step "Build RPM package" \
npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-build-rpm"
(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \
step "Install build dependencies" \
npm install --unsafe-perm)
# Variables
PLATFORM_LINUX="linux-$ARCH"
PLATFORM_DEB="linux-deb-$ARCH"
PLATFORM_RPM="linux-rpm-$ARCH"
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
REPO="`pwd`"
ROOT="$REPO/.."
BUILDNAME="VSCode-$PLATFORM_LINUX"
BUILD="$ROOT/$BUILDNAME"
BUILD_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\.deb$//g')"
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
PACKAGEJSON="$BUILD/resources/app/package.json"
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
rm -rf $ROOT/code-*.tar.*
(cd $ROOT && \
step "Create tar.gz archive" \
tar -czvf $TARBALL_PATH $BUILDNAME)
step "Publish tar.gz archive" \
node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_LINUX archive-unsigned $TARBALL_FILENAME $VERSION true $TARBALL_PATH
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
step "Publish Debian package" \
node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_DEB package $DEB_FILENAME $VERSION true $DEB_PATH
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
step "Publish RPM package" \
node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_RPM package $RPM_FILENAME $VERSION true $RPM_PATH
if [ -z "$VSCODE_QUALITY" ]; then
echo "VSCODE_QUALITY is not set, skipping repo package publish"
else
if [ "$BUILD_SOURCEBRANCH" = "master" ] || [ "$BUILD_SOURCEBRANCH" = "refs/heads/master" ]; then
if [[ $BUILD_QUEUEDBY = *"Project Collection Service Accounts"* || $BUILD_QUEUEDBY = *"Microsoft.VisualStudio.Services.TFS"* ]]; then
# Get necessary information
pushd $REPO && COMMIT_HASH=$(git rev-parse HEAD) && popd
PACKAGE_NAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/_.*//g')"
DEB_URL="https://az764295.vo.msecnd.net/$VSCODE_QUALITY/$COMMIT_HASH/$DEB_FILENAME"
RPM_URL="https://az764295.vo.msecnd.net/$VSCODE_QUALITY/$COMMIT_HASH/$RPM_FILENAME"
PACKAGE_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\_.*$//g')"
# Write config files needed by API, use eval to force environment variable expansion
DIRNAME=$(dirname $(readlink -f $0))
pushd $DIRNAME
# Submit to apt repo
if [ "$DEB_ARCH" = "amd64" ]; then
eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"username\": \"$LINUX_REPO_USERNAME\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > apt-config.json
eval echo '{ \"name\": \"$PACKAGE_NAME\", \"version\": \"$PACKAGE_VERSION\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"sourceUrl\": \"$DEB_URL\" }' > apt-addpkg.json
echo "Submitting apt-addpkg.json:"
cat apt-addpkg.json
step "Publish to repositories" \
./repoapi_client.sh -config apt-config.json -addpkg apt-addpkg.json
fi
# Submit to yum repo (disabled as it's manual until signing is automated)
# eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"username\": \"$LINUX_REPO_USERNAME\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > yum-config.json
# eval echo '{ \"name\": \"$PACKAGE_NAME\", \"version\": \"$PACKAGE_VERSION\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"sourceUrl\": \"$RPM_URL\" }' > yum-addpkg.json
# echo "Submitting yum-addpkg.json:"
# cat yum-addpkg.json
# ./repoapi_client.sh -config yum-config.json -addpkg yum-addpkg.json
popd
echo "To check repo publish status run ./repoapi_client.sh -config config.json -check <id>"
fi
fi
fi
step "Publish release" \
./build/tfs/linux/release.sh
\ No newline at end of file
#!/bin/bash
. ./scripts/env.sh
. ./build/tfs/common/common.sh
step "Build Debian package" \
npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-build-deb"
step "Build RPM package" \
npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-build-rpm"
(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \
step "Install build dependencies" \
npm install --unsafe-perm)
# Variables
PLATFORM_LINUX="linux-$ARCH"
PLATFORM_DEB="linux-deb-$ARCH"
PLATFORM_RPM="linux-rpm-$ARCH"
[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64"
[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64"
REPO="`pwd`"
ROOT="$REPO/.."
BUILDNAME="VSCode-$PLATFORM_LINUX"
BUILD="$ROOT/$BUILDNAME"
BUILD_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\.deb$//g')"
[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz"
TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
PACKAGEJSON="$BUILD/resources/app/package.json"
VERSION=$(node -p "require(\"$PACKAGEJSON\").version")
rm -rf $ROOT/code-*.tar.*
(cd $ROOT && \
step "Create tar.gz archive" \
tar -czf $TARBALL_PATH $BUILDNAME)
step "Publish tar.gz archive" \
node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_LINUX archive-unsigned $TARBALL_FILENAME $VERSION true $TARBALL_PATH
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
step "Publish Debian package" \
node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_DEB package $DEB_FILENAME $VERSION true $DEB_PATH
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
step "Publish RPM package" \
node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_RPM package $RPM_FILENAME $VERSION true $RPM_PATH
if [ -z "$VSCODE_QUALITY" ]; then
echo "VSCODE_QUALITY is not set, skipping repo package publish"
else
if [ "$BUILD_SOURCEBRANCH" = "master" ] || [ "$BUILD_SOURCEBRANCH" = "refs/heads/master" ]; then
if [[ $BUILD_QUEUEDBY = *"Project Collection Service Accounts"* || $BUILD_QUEUEDBY = *"Microsoft.VisualStudio.Services.TFS"* ]]; then
# Get necessary information
pushd $REPO && COMMIT_HASH=$(git rev-parse HEAD) && popd
PACKAGE_NAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/_.*//g')"
DEB_URL="https://az764295.vo.msecnd.net/$VSCODE_QUALITY/$COMMIT_HASH/$DEB_FILENAME"
RPM_URL="https://az764295.vo.msecnd.net/$VSCODE_QUALITY/$COMMIT_HASH/$RPM_FILENAME"
PACKAGE_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\_.*$//g')"
# Write config files needed by API, use eval to force environment variable expansion
DIRNAME=$(dirname $(readlink -f $0))
pushd $DIRNAME
# Submit to apt repo
if [ "$DEB_ARCH" = "amd64" ]; then
eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"username\": \"$LINUX_REPO_USERNAME\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > apt-config.json
eval echo '{ \"name\": \"$PACKAGE_NAME\", \"version\": \"$PACKAGE_VERSION\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"sourceUrl\": \"$DEB_URL\" }' > apt-addpkg.json
echo "Submitting apt-addpkg.json:"
cat apt-addpkg.json
step "Publish to repositories" \
./repoapi_client.sh -config apt-config.json -addpkg apt-addpkg.json
fi
# Submit to yum repo (disabled as it's manual until signing is automated)
# eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"username\": \"$LINUX_REPO_USERNAME\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > yum-config.json
# eval echo '{ \"name\": \"$PACKAGE_NAME\", \"version\": \"$PACKAGE_VERSION\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"sourceUrl\": \"$RPM_URL\" }' > yum-addpkg.json
# echo "Submitting yum-addpkg.json:"
# cat yum-addpkg.json
# ./repoapi_client.sh -config yum-config.json -addpkg yum-addpkg.json
popd
echo "To check repo publish status run ./repoapi_client.sh -config config.json -check <id>"
fi
fi
fi
此差异已折叠。
......@@ -9,8 +9,7 @@ Param(
# Create a _netrc file to download distro dependencies
# In order to get _netrc to work, we need a HOME variable setup
$env:HOME=$env:USERPROFILE
"machine monacotools.visualstudio.com password ${vsoPAT}" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII
"machine monacotools.visualstudio.com password ${vsoPAT}" | Out-File "$env:HOME\_netrc" -Encoding ASCII
# Set the right architecture
$env:npm_config_arch="$arch"
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
test/**
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册