mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 11:38:36 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -6,21 +6,16 @@ title VSCode Dev
|
||||
pushd %~dp0\..
|
||||
|
||||
:: Node modules
|
||||
if not exist node_modules call .\scripts\npm.bat install
|
||||
if not exist node_modules call yarn
|
||||
|
||||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
|
||||
set NAMESHORT=%NAMESHORT: "=%
|
||||
set NAMESHORT=%NAMESHORT:"=%.exe
|
||||
set CODE=".build\electron\%NAMESHORT%"
|
||||
|
||||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
|
||||
set DESIREDVERSION=%DESIREDVERSION: "=%
|
||||
set DESIREDVERSION=v%DESIREDVERSION:"=%
|
||||
if exist .\.build\electron\version (set /p INSTALLEDVERSION=<.\.build\electron\version) else (set INSTALLEDVERSION="")
|
||||
|
||||
:: Get electron
|
||||
if not exist %CODE% node .\node_modules\gulp\bin\gulp.js electron
|
||||
if not "%INSTALLEDVERSION%" == "%DESIREDVERSION%" node .\node_modules\gulp\bin\gulp.js electron
|
||||
:: Download Electron if needed
|
||||
node build\lib\electron.js
|
||||
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
|
||||
|
||||
:: Build
|
||||
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
||||
|
||||
@@ -18,14 +18,11 @@ function code() {
|
||||
CODE=".build/electron/$NAME"
|
||||
fi
|
||||
|
||||
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
|
||||
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
|
||||
|
||||
# Node modules
|
||||
test -d node_modules || ./scripts/npm.sh install
|
||||
test -d node_modules || yarn
|
||||
|
||||
# Get electron
|
||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
||||
node build/lib/electron.js || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
|
||||
@@ -6,21 +6,16 @@ title VSCode Dev
|
||||
pushd %~dp0\..
|
||||
|
||||
:: Node modules
|
||||
if not exist node_modules call .\scripts\npm.bat install
|
||||
if not exist node_modules call yarn
|
||||
|
||||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
|
||||
set NAMESHORT=%NAMESHORT: "=%
|
||||
set NAMESHORT=%NAMESHORT:"=%.exe
|
||||
set CODE=".build\electron\%NAMESHORT%"
|
||||
|
||||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
|
||||
set DESIREDVERSION=%DESIREDVERSION: "=%
|
||||
set DESIREDVERSION=v%DESIREDVERSION:"=%
|
||||
if exist .\.build\electron\version (set /p INSTALLEDVERSION=<.\.build\electron\version) else (set INSTALLEDVERSION="")
|
||||
|
||||
:: Get electron
|
||||
if not exist %CODE% node .\node_modules\gulp\bin\gulp.js electron
|
||||
if not "%INSTALLEDVERSION%" == "%DESIREDVERSION%" node .\node_modules\gulp\bin\gulp.js electron
|
||||
:: Download Electron if needed
|
||||
node build\lib\electron.js
|
||||
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
|
||||
|
||||
:: Build
|
||||
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
||||
|
||||
@@ -18,14 +18,11 @@ function code() {
|
||||
CODE=".build/electron/$NAME"
|
||||
fi
|
||||
|
||||
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
|
||||
INSTALLED_VERSION=`cat .build/electron/version 2> /dev/null`
|
||||
|
||||
# Node modules
|
||||
test -d node_modules || ./scripts/npm.sh install
|
||||
test -d node_modules || yarn
|
||||
|
||||
# Get electron
|
||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
||||
node build/lib/electron.js || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
$env:npm_config_disturl="https://atom.io/download/electron"
|
||||
$env:npm_config_target=(node -p "require('./package.json').electronVersion")
|
||||
$env:npm_config_target=(node "build/lib/electron.js")
|
||||
$env:npm_config_runtime="electron"
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
export npm_config_disturl=https://atom.io/download/electron
|
||||
export npm_config_target=$(node -p "require('./package.json').electronVersion")
|
||||
export npm_config_target=$(node "build/lib/electron.js")
|
||||
export npm_config_runtime=electron
|
||||
export npm_config_cache="$HOME/.npm-electron"
|
||||
mkdir -p "$npm_config_cache"
|
||||
18
scripts/node-electron.bat
Normal file
18
scripts/node-electron.bat
Normal file
@@ -0,0 +1,18 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set ELECTRON_RUN_AS_NODE=1
|
||||
|
||||
pushd %~dp0\..
|
||||
|
||||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
|
||||
set NAMESHORT=%NAMESHORT: "=%
|
||||
set NAMESHORT=%NAMESHORT:"=%.exe
|
||||
set CODE=".build\electron\%NAMESHORT%"
|
||||
|
||||
%CODE% %*
|
||||
|
||||
popd
|
||||
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
32
scripts/node-electron.sh
Normal file
32
scripts/node-electron.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
|
||||
ROOT=$(dirname $(dirname $(realpath "$0")))
|
||||
else
|
||||
ROOT=$(dirname $(dirname $(readlink -f $0)))
|
||||
fi
|
||||
|
||||
cd $ROOT
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
NAME=`node -p "require('./product.json').nameLong"`
|
||||
CODE="./.build/electron/$NAME.app/Contents/MacOS/Electron"
|
||||
else
|
||||
NAME=`node -p "require('./product.json').applicationName"`
|
||||
CODE=".build/electron/$NAME"
|
||||
fi
|
||||
|
||||
# Get electron
|
||||
node build/lib/electron.js || ./node_modules/.bin/gulp electron
|
||||
|
||||
export VSCODE_DEV=1
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
cd $ROOT ; ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \
|
||||
"$CODE" \
|
||||
"$@"
|
||||
else
|
||||
cd $ROOT ; ELECTRON_RUN_AS_NODE=1 \
|
||||
"$CODE" \
|
||||
"$@"
|
||||
fi
|
||||
@@ -1,17 +1,2 @@
|
||||
@echo off
|
||||
SET SUPPORTEDNPMVERSION=4.2.0
|
||||
|
||||
setlocal
|
||||
set npm_config_disturl="https://atom.io/download/electron"
|
||||
for /f "tokens=2 delims=:, " %%a in ('findstr /R /C:"\"electronVersion\":.*" "%~dp0..\package.json"') do set npm_config_target=%%~a
|
||||
set npm_config_runtime="electron"
|
||||
set npm_config_cache=~\.npm-electron
|
||||
npm %*
|
||||
endlocal
|
||||
|
||||
for /F "tokens=* USEBACKQ" %%V IN (`npm --version`) do (
|
||||
set CURRENTNPMVERSION=%%V
|
||||
)
|
||||
if not %CURRENTNPMVERSION%==%SUPPORTEDNPMVERSION% (
|
||||
echo NPM version %CURRENTNPMVERSION% is not supported with this project. We strongly recommend to use version %SUPPORTEDNPMVERSION%
|
||||
)
|
||||
yarn %*
|
||||
|
||||
@@ -1,35 +1,3 @@
|
||||
#!/bin/bash
|
||||
SUPPORTEDNPMVERSION="4.2.0"
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
|
||||
ROOT=$(dirname "$(dirname "$(realpath "$0")")")
|
||||
npm_config_arch=x64
|
||||
else
|
||||
ROOT=$(dirname "$(dirname "$(readlink -f $0)")")
|
||||
|
||||
# if [ -z $npm_config_arch ]; then
|
||||
# npm_config_arch=$(node -p process.arch)
|
||||
# echo "Warning: remember to set \$npm_config_arch to either x64 or ia32 to build the binaries for the right architecture. Picking '$npm_config_arch'."
|
||||
# fi
|
||||
fi
|
||||
|
||||
ELECTRON_VERSION=$(
|
||||
cat "$ROOT"/package.json |
|
||||
grep electronVersion |
|
||||
sed -e 's/[[:space:]]*"electronVersion":[[:space:]]*"\([0-9.]*\)"\(,\)*/\1/'
|
||||
)
|
||||
|
||||
ELECTRON_GYP_HOME=~/.electron-gyp
|
||||
mkdir -p $ELECTRON_GYP_HOME
|
||||
|
||||
npm_config_disturl=https://atom.io/download/electron \
|
||||
npm_config_target=$ELECTRON_VERSION \
|
||||
npm_config_runtime=electron \
|
||||
HOME=$ELECTRON_GYP_HOME \
|
||||
npm $*
|
||||
|
||||
CURRENTNPMVERSION=`npm --version`
|
||||
if [[ "$CURRENTNPMVERSION" != "$SUPPORTEDNPMVERSION" ]]; then
|
||||
echo "NPM version ${CURRENTNPMVERSION} is not supported with this project. We strongly recommend to use version ${SUPPORTEDNPMVERSION}"
|
||||
fi
|
||||
yarn $*
|
||||
@@ -6,21 +6,16 @@ title VSCode Dev
|
||||
pushd %~dp0\..
|
||||
|
||||
:: Node modules
|
||||
if not exist node_modules call .\scripts\npm.bat install
|
||||
if not exist node_modules call yarn
|
||||
|
||||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"nameShort\":.*" product.json') do set NAMESHORT=%%~a
|
||||
set NAMESHORT=%NAMESHORT: "=%
|
||||
set NAMESHORT=%NAMESHORT:"=%.exe
|
||||
set CODE=".build\electron\%NAMESHORT%"
|
||||
|
||||
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
|
||||
set DESIREDVERSION=%DESIREDVERSION: "=%
|
||||
set DESIREDVERSION=v%DESIREDVERSION:"=%
|
||||
if exist .\.build\electron\version (set /p INSTALLEDVERSION=<.\.build\electron\version) else (set INSTALLEDVERSION="")
|
||||
|
||||
:: Get electron
|
||||
if not exist %CODE% node .\node_modules\gulp\bin\gulp.js electron
|
||||
if not "%INSTALLEDVERSION%" == "%DESIREDVERSION%" node .\node_modules\gulp\bin\gulp.js electron
|
||||
:: Download Electron if needed
|
||||
node build\lib\electron.js
|
||||
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
|
||||
|
||||
:: Build
|
||||
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
||||
@@ -34,7 +29,12 @@ set ELECTRON_ENABLE_LOGGING=1
|
||||
set ELECTRON_ENABLE_STACK_DUMPING=1
|
||||
|
||||
:: Launch Code
|
||||
|
||||
:: Use the following to get v8 tracing:
|
||||
:: %CODE% --js-flags="--trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces" . %*
|
||||
|
||||
%CODE% . %*
|
||||
|
||||
popd
|
||||
|
||||
endlocal
|
||||
|
||||
@@ -8,10 +8,16 @@ if not "%APPVEYOR%" == "" (
|
||||
)
|
||||
set VSCODEUSERDATADIR=%TMP%\vscodeuserfolder-%RANDOM%-%TIME:~6,5%
|
||||
|
||||
:: Integration Tests
|
||||
.\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testWorkspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
|
||||
.\scripts\code.bat %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --user-data-dir=%VSCODEUSERDATADIR%
|
||||
.\scripts\test-int-mocha.bat
|
||||
:: Tests in the extension host
|
||||
call .\scripts\code.bat %~dp0\..\extensions\vscode-api-tests\testWorkspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
|
||||
call .\scripts\code.bat %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
|
||||
call .\scripts\code.bat $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disableExtensions --user-data-dir=%VSCODEUSERDATADIR%
|
||||
|
||||
:: Integration & performance tests in AMD
|
||||
call .\scripts\test.bat --runGlob **\*.integrationTest.js %*
|
||||
|
||||
:: Tests in commonJS (language servers tests...)
|
||||
call .\scripts\node-electron.bat .\node_modules\mocha\bin\_mocha .\extensions\html\server\out\test\
|
||||
|
||||
rmdir /s /q %VSCODEUSERDATADIR%
|
||||
|
||||
|
||||
@@ -12,9 +12,15 @@ fi
|
||||
|
||||
cd $ROOT
|
||||
|
||||
# Integration Tests
|
||||
./scripts/code.sh $ROOT/extensions/vscode-api-tests/testWorkspace --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out --disableExtensions --user-data-dir=$VSCODEUSERDATADIR
|
||||
./scripts/code.sh $ROOT/extensions/vscode-colorize-tests/test --extensionDevelopmentPath=$ROOT/extensions/vscode-colorize-tests --extensionTestsPath=$ROOT/extensions/vscode-colorize-tests/out --user-data-dir=$VSCODEUSERDATADIR
|
||||
./scripts/test-int-mocha.sh
|
||||
# Tests in the extension host
|
||||
./scripts/code.sh $ROOT/extensions/vscode-api-tests/testWorkspace --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out --disableExtensions --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started
|
||||
./scripts/code.sh $ROOT/extensions/vscode-colorize-tests/test --extensionDevelopmentPath=$ROOT/extensions/vscode-colorize-tests --extensionTestsPath=$ROOT/extensions/vscode-colorize-tests/out --disableExtensions --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started
|
||||
./scripts/code.sh $ROOT/extensions/emmet/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test --disableExtensions --user-data-dir=$VSCODEUSERDATADIR --skip-getting-started
|
||||
|
||||
# Integration tests in AMD
|
||||
./scripts/test.sh --runGlob **/*.integrationTest.js "$@"
|
||||
|
||||
# Tests in commonJS (language server tests...)
|
||||
./scripts/node-electron.sh ./node_modules/mocha/bin/_mocha ./extensions/html/server/out/test/
|
||||
|
||||
rm -r $VSCODEUSERDATADIR
|
||||
|
||||
@@ -22,4 +22,4 @@ if "%BUILD_BUILDID%" == "" (
|
||||
popd
|
||||
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
exit /b %errorlevel%
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
|
||||
ROOT=$(dirname $(dirname $(realpath "$0")))
|
||||
@@ -17,26 +18,20 @@ else
|
||||
CODE=".build/electron/$NAME"
|
||||
fi
|
||||
|
||||
INTENDED_VERSION="v`node -p "require('./package.json').electronVersion"`"
|
||||
INSTALLED_VERSION=$(cat .build/electron/version 2> /dev/null)
|
||||
|
||||
# Node modules
|
||||
test -d node_modules || ./scripts/npm.sh install
|
||||
test -d node_modules || yarn
|
||||
|
||||
# Get electron
|
||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
node build/lib/electron.js || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Unit Tests
|
||||
export VSCODE_DEV=1
|
||||
export ELECTRON_ENABLE_LOGGING=1
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
cd $ROOT ; ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \
|
||||
cd $ROOT ; ulimit -n 4096 ; \
|
||||
"$CODE" \
|
||||
node_modules/mocha/bin/_mocha "$@"
|
||||
test/electron/index.js "$@"
|
||||
else
|
||||
cd $ROOT ; ELECTRON_RUN_AS_NODE=1 \
|
||||
cd $ROOT ; \
|
||||
"$CODE" \
|
||||
node_modules/mocha/bin/_mocha "$@"
|
||||
fi
|
||||
test/electron/index.js "$@"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user