Skip to content

Commit

Permalink
Merge branch 'master' into sandy081/userDataProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Sep 10, 2019
2 parents c26e198 + 96106db commit cae7f1c
Show file tree
Hide file tree
Showing 376 changed files with 7,821 additions and 6,944 deletions.
23 changes: 14 additions & 9 deletions build/azure-pipelines/darwin/product-build-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,28 @@ steps:
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests
# to run with these builds instead of running out of sources.
set -e
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
APP_NAME="`ls $APP_ROOT | head -n 1`"
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
./scripts/test-integration.sh --build --tfs "Integration Tests"
displayName: Run integration tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
set -e
cd test/smoke
yarn compile
cd -
yarn smoketest --web --headless
continueOnError: true
displayName: Run web smoke tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
# Web Smoke Tests disabled due to https://github.com/microsoft/vscode/issues/80308
# - script: |
# set -e
# cd test/smoke
# yarn compile
# cd -
# yarn smoketest --web --headless
# continueOnError: true
# displayName: Run web smoke tests
# condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
set -e
Expand Down
4 changes: 4 additions & 0 deletions build/azure-pipelines/linux/product-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@ steps:
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests
# to run with these builds instead of running out of sources.
set -e
APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \
DISPLAY=:10 ./scripts/test-integration.sh --build --tfs "Integration Tests"
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-x64"
displayName: Run integration tests
Expand Down
1 change: 1 addition & 0 deletions build/azure-pipelines/product-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ steps:
AZURE_WEBVIEW_STORAGE_ACCESS_KEY="$(vscode-webview-storage-key)" \
./build/azure-pipelines/common/publish-webview.sh
displayName: Publish Webview
condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'))

- script: |
set -e
Expand Down
16 changes: 16 additions & 0 deletions build/azure-pipelines/publish-types/publish-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ steps:
inputs:
versionSpec: "1.x"

- bash: |
TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
CHANNEL="G1C14HJ2F"
if [ "$TAG_VERSION" == "1.999.0" ]; then
MESSAGE="<!here>. Someone pushed 1.999.0 tag. Please delete it ASAP from remote and local."
curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
-H 'Content-type: application/json; charset=utf-8' \
--data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$MESSAGE"'"}' \
https://slack.com/api/chat.postMessage
exit 1
fi
displayName: Check 1.999.0 tag

- bash: |
# Install build dependencies
(cd build && yarn)
Expand Down
5 changes: 4 additions & 1 deletion build/azure-pipelines/win32/product-build-win32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,15 @@ steps:
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- powershell: |
# Figure out the full absolute path of the product we just built
# including the remote server and configure the integration tests
# to run with these builds instead of running out of sources.
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
$AppNameShort = $AppProductJson.nameShort
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; .\scripts\test-integration.bat --build --tfs "Integration Tests" }
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"; .\scripts\test-integration.bat --build --tfs "Integration Tests" }
displayName: Run integration tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

Expand Down
35 changes: 19 additions & 16 deletions build/gulpfile.extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const nlsDev = require('vscode-nls-dev');
const root = path.dirname(__dirname);
const commit = util.getVersion(root);
const plumber = require('gulp-plumber');
const _ = require('underscore');
const ext = require('./lib/extensions');

const extensionsPath = path.join(path.dirname(__dirname), 'extensions');
Expand All @@ -37,16 +36,16 @@ const tasks = compilations.map(function (tsconfigFile) {
const absolutePath = path.join(extensionsPath, tsconfigFile);
const relativeDirname = path.dirname(tsconfigFile);

const tsconfig = require(absolutePath);
const tsOptions = _.assign({}, tsconfig.extends ? require(path.join(extensionsPath, relativeDirname, tsconfig.extends)).compilerOptions : {}, tsconfig.compilerOptions);
tsOptions.verbose = false;
tsOptions.sourceMap = true;
const overrideOptions = {};
overrideOptions.sourceMap = true;

const name = relativeDirname.replace(/\//g, '-');

const root = path.join('extensions', relativeDirname);
const srcBase = path.join(root, 'src');
const src = path.join(srcBase, '**');
const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };

const out = path.join(root, 'out');
const baseUrl = getBaseUrl(out);

Expand All @@ -63,12 +62,12 @@ const tasks = compilations.map(function (tsconfigFile) {
function createPipeline(build, emitError) {
const reporter = createReporter();

tsOptions.inlineSources = !!build;
tsOptions.base = path.dirname(absolutePath);
overrideOptions.inlineSources = Boolean(build);
overrideOptions.base = path.dirname(absolutePath);

const compilation = tsb.create(tsOptions, null, null, err => reporter(err.toString()));
const compilation = tsb.create(absolutePath, overrideOptions, false, err => reporter(err.toString()));

return function () {
const pipeline = function () {
const input = es.through();
const tsFilter = filter(['**/*.ts', '!**/lib/lib*.d.ts', '!**/node_modules/**'], { restore: true });
const output = input
Expand Down Expand Up @@ -98,15 +97,19 @@ const tasks = compilations.map(function (tsconfigFile) {

return es.duplex(input, output);
};
}

const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };
// add src-stream for project files
pipeline.tsProjectSrc = () => {
return compilation.src(srcOpts);
};
return pipeline;
}

const cleanTask = task.define(`clean-extension-${name}`, util.rimraf(out));

const compileTask = task.define(`compile-extension:${name}`, task.series(cleanTask, () => {
const pipeline = createPipeline(false, true);
const input = gulp.src(src, srcOpts);
const input = pipeline.tsProjectSrc();

return input
.pipe(pipeline())
Expand All @@ -115,8 +118,8 @@ const tasks = compilations.map(function (tsconfigFile) {

const watchTask = task.define(`watch-extension:${name}`, task.series(cleanTask, () => {
const pipeline = createPipeline(false);
const input = gulp.src(src, srcOpts);
const watchInput = watcher(src, srcOpts);
const input = pipeline.tsProjectSrc();
const watchInput = watcher(src, { ...srcOpts, ...{ readDelay: 200 } });

return watchInput
.pipe(util.incremental(pipeline, input))
Expand All @@ -125,7 +128,7 @@ const tasks = compilations.map(function (tsconfigFile) {

const compileBuildTask = task.define(`compile-build-extension-${name}`, task.series(cleanTask, () => {
const pipeline = createPipeline(true, true);
const input = gulp.src(src, srcOpts);
const input = pipeline.tsProjectSrc();

return input
.pipe(pipeline())
Expand Down Expand Up @@ -160,4 +163,4 @@ const compileExtensionsBuildTask = task.define('compile-extensions-build', task.
));

gulp.task(compileExtensionsBuildTask);
exports.compileExtensionsBuildTask = compileExtensionsBuildTask;
exports.compileExtensionsBuildTask = compileExtensionsBuildTask;
6 changes: 3 additions & 3 deletions build/gulpfile.vscode.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const nodeModules = ['electron', 'original-fs']
const vscodeEntryPoints = _.flatten([
buildfile.entrypoint('vs/workbench/workbench.desktop.main'),
buildfile.base,
buildfile.serviceWorker,
buildfile.workbenchDesktop,
buildfile.code
]);
Expand Down Expand Up @@ -94,6 +93,7 @@ const optimizeVSCodeTask = task.define('optimize-vscode', task.series(
resources: vscodeResources,
loaderConfig: common.loaderConfig(nodeModules),
out: 'out-vscode',
inlineAmdImages: true,
bundleInfo: undefined
})
));
Expand Down Expand Up @@ -480,7 +480,7 @@ gulp.task(task.define(
optimizeVSCodeTask,
function () {
const pathToMetadata = './out-vscode/nls.metadata.json';
const pathToExtensions = './extensions/*';
const pathToExtensions = '.build/extensions/*';
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';

return es.merge(
Expand All @@ -501,7 +501,7 @@ gulp.task(task.define(
optimizeVSCodeTask,
function () {
const pathToMetadata = './out-vscode/nls.metadata.json';
const pathToExtensions = './extensions/*';
const pathToExtensions = '.build/extensions/*';
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';

return es.merge(
Expand Down
3 changes: 2 additions & 1 deletion build/gulpfile.vscode.linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ function prepareSnapPackage(arch) {

function buildSnapPackage(arch) {
const snapBuildPath = getSnapBuildPath(arch);
return shell.task(`cd ${snapBuildPath} && snapcraft build`);
// Default target for snapcraft runs: pull, build, stage and prime, and finally assembles the snap.
return shell.task(`cd ${snapBuildPath} && snapcraft`);
}

const BUILD_TARGETS = [
Expand Down
11 changes: 7 additions & 4 deletions build/gulpfile.vscode.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const nodeModules = Object.keys(product.dependencies || {})
const vscodeWebResources = [

// Workbench
'out-build/vs/{base,platform,editor,workbench}/**/*.{svg,png,html}',
'out-build/vs/{base,platform,editor,workbench}/**/*.{svg,png}',
'out-build/vs/code/browser/workbench/workbench.html',
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
'out-build/vs/**/markdown.css',

Expand All @@ -56,7 +57,6 @@ const buildfile = require('../src/buildfile');
const vscodeWebEntryPoints = _.flatten([
buildfile.entrypoint('vs/workbench/workbench.web.api'),
buildfile.base,
buildfile.serviceWorker,
buildfile.workerExtensionHost,
buildfile.keyboardMaps,
buildfile.workbenchWeb
Expand Down Expand Up @@ -118,7 +118,10 @@ function packageTask(sourceFolderName, destinationFolderName) {

const favicon = gulp.src('resources/server/favicon.ico', { base: 'resources/server' });
const manifest = gulp.src('resources/server/manifest.json', { base: 'resources/server' });
const pwaicon = gulp.src('resources/server/code.png', { base: 'resources/server' });
const pwaicons = es.merge(
gulp.src('resources/server/code-192.png', { base: 'resources/server' }),
gulp.src('resources/server/code-512.png', { base: 'resources/server' })
);

let all = es.merge(
packageJsonStream,
Expand All @@ -128,7 +131,7 @@ function packageTask(sourceFolderName, destinationFolderName) {
deps,
favicon,
manifest,
pwaicon
pwaicons
);

let result = all
Expand Down
33 changes: 9 additions & 24 deletions build/lib/compilation.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const bom = require("gulp-bom");
const sourcemaps = require("gulp-sourcemaps");
const tsb = require("gulp-tsb");
const path = require("path");
const _ = require("underscore");
const monacodts = require("../monaco/api");
const nls = require("./nls");
const reporter_1 = require("./reporter");
Expand All @@ -22,14 +21,7 @@ const watch = require('./watch');
const reporter = reporter_1.createReporter();
function getTypeScriptCompilerOptions(src) {
const rootDir = path.join(__dirname, `../../${src}`);
const tsconfig = require(`../../${src}/tsconfig.json`);
let options;
if (tsconfig.extends) {
options = Object.assign({}, require(path.join(rootDir, tsconfig.extends)).compilerOptions, tsconfig.compilerOptions);
}
else {
options = tsconfig.compilerOptions;
}
let options = {};
options.verbose = false;
options.sourceMap = true;
if (process.env['VSCODE_NO_SOURCEMAP']) { // To be used by developers in a hurry
Expand All @@ -38,14 +30,13 @@ function getTypeScriptCompilerOptions(src) {
options.rootDir = rootDir;
options.baseUrl = rootDir;
options.sourceRoot = util.toFileUri(rootDir);
options.newLine = /\r\n/.test(fs.readFileSync(__filename, 'utf8')) ? 'CRLF' : 'LF';
options.newLine = /\r\n/.test(fs.readFileSync(__filename, 'utf8')) ? 0 : 1;
return options;
}
function createCompile(src, build, emitError) {
const opts = _.clone(getTypeScriptCompilerOptions(src));
opts.inlineSources = !!build;
opts.noFilesystemLookup = true;
const ts = tsb.create(opts, true, undefined, err => reporter(err.toString()));
const projectPath = path.join(__dirname, '../../', src, 'tsconfig.json');
const overrideOptions = Object.assign(Object.assign({}, getTypeScriptCompilerOptions(src)), { inlineSources: Boolean(build) });
const ts = tsb.create(projectPath, overrideOptions, false, err => reporter(err));
return function (token) {
const utf8Filter = util.filter(data => /(\/|\\)test(\/|\\).*utf8/.test(data.path));
const tsFilter = util.filter(data => /\.ts$/.test(data.path));
Expand All @@ -64,23 +55,17 @@ function createCompile(src, build, emitError) {
.pipe(sourcemaps.write('.', {
addComment: false,
includeContent: !!build,
sourceRoot: opts.sourceRoot
sourceRoot: overrideOptions.sourceRoot
}))
.pipe(tsFilter.restore)
.pipe(reporter.end(!!emitError));
return es.duplex(input, output);
};
}
const typesDts = [
'node_modules/typescript/lib/*.d.ts',
'node_modules/@types/**/*.d.ts',
'!node_modules/@types/webpack/**/*',
'!node_modules/@types/uglify-js/**/*',
];
function compileTask(src, out, build) {
return function () {
const compile = createCompile(src, build, true);
const srcPipe = es.merge(gulp.src(`${src}/**`, { base: `${src}` }), gulp.src(typesDts));
const srcPipe = gulp.src(`${src}/**`, { base: `${src}` });
let generator = new MonacoGenerator(false);
if (src === 'src') {
generator.execute();
Expand All @@ -95,8 +80,8 @@ exports.compileTask = compileTask;
function watchTask(out, build) {
return function () {
const compile = createCompile('src', build);
const src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src(typesDts));
const watchSrc = watch('src/**', { base: 'src' });
const src = gulp.src('src/**', { base: 'src' });
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
let generator = new MonacoGenerator(true);
generator.execute();
return watchSrc
Expand Down
Loading

0 comments on commit cae7f1c

Please sign in to comment.