mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
SQL Operations Studio Public Preview 1 (0.23) release source code
This commit is contained in:
9
scripts/build.bat
Normal file
9
scripts/build.bat
Normal file
@@ -0,0 +1,9 @@
|
||||
@echo off
|
||||
|
||||
CALL gulp --max_old_space_size=2000 electron-ia32
|
||||
CALL "%~dp0\test.bat"
|
||||
CALL gulp --max_old_space_size=2000 optimize-vscode
|
||||
|
||||
:error
|
||||
echo Exit code %errorlevel%
|
||||
exit /b %errorlevel%
|
||||
5
scripts/build.sh
Normal file
5
scripts/build.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
gulp --max_old_space_size=8196 electron || { echo 'gulp electron failed' ; exit 1; }
|
||||
./scripts/test.sh || { echo 'Tests failed' ; exit 1; }
|
||||
gulp --max_old_space_size=8196 optimize-vscode || { echo 'gulp optimize vscode failed' ; exit 1; }
|
||||
40
scripts/code-cli.bat
Normal file
40
scripts/code-cli.bat
Normal file
@@ -0,0 +1,40 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
title VSCode Dev
|
||||
|
||||
pushd %~dp0\..
|
||||
|
||||
:: Node modules
|
||||
if not exist node_modules call .\scripts\npm.bat install
|
||||
|
||||
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
|
||||
|
||||
:: Build
|
||||
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
||||
|
||||
:: Configuration
|
||||
set ELECTRON_RUN_AS_NODE=1
|
||||
set NODE_ENV=development
|
||||
set VSCODE_DEV=1
|
||||
set ELECTRON_DEFAULT_ERROR_MODE=1
|
||||
set ELECTRON_ENABLE_LOGGING=1
|
||||
set ELECTRON_ENABLE_STACK_DUMPING=1
|
||||
|
||||
:: Launch Code
|
||||
%CODE% --debug=5874 out\cli.js . %*
|
||||
popd
|
||||
|
||||
endlocal
|
||||
41
scripts/code-cli.sh
Normal file
41
scripts/code-cli.sh
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env 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
|
||||
|
||||
function code() {
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
# Get electron
|
||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
|
||||
ELECTRON_RUN_AS_NODE=1 \
|
||||
NODE_ENV=development \
|
||||
VSCODE_DEV=1 \
|
||||
ELECTRON_ENABLE_LOGGING=1 \
|
||||
ELECTRON_ENABLE_STACK_DUMPING=1 \
|
||||
"$CODE" --debug=5874 "$ROOT/out/cli.js" . "$@"
|
||||
}
|
||||
|
||||
code "$@"
|
||||
44
scripts/code.bat
Normal file
44
scripts/code.bat
Normal file
@@ -0,0 +1,44 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
title VSCode Dev
|
||||
|
||||
pushd %~dp0\..
|
||||
|
||||
:: Node modules
|
||||
if not exist node_modules call .\scripts\npm.bat install
|
||||
|
||||
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
|
||||
|
||||
:: Build
|
||||
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
||||
|
||||
:: Configuration
|
||||
set NODE_ENV=development
|
||||
set VSCODE_DEV=1
|
||||
set VSCODE_CLI=1
|
||||
set ELECTRON_DEFAULT_ERROR_MODE=1
|
||||
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
|
||||
47
scripts/code.sh
Normal file
47
scripts/code.sh
Normal file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env 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
|
||||
|
||||
function code() {
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
# Get electron
|
||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
|
||||
# Configuration
|
||||
export NODE_ENV=development
|
||||
export VSCODE_DEV=1
|
||||
export VSCODE_CLI=1
|
||||
export ELECTRON_ENABLE_LOGGING=1
|
||||
export ELECTRON_ENABLE_STACK_DUMPING=1
|
||||
|
||||
# Launch Code
|
||||
exec "$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 "$@"
|
||||
3
scripts/env.ps1
Normal file
3
scripts/env.ps1
Normal file
@@ -0,0 +1,3 @@
|
||||
$env:npm_config_disturl="https://atom.io/download/electron"
|
||||
$env:npm_config_target=(node -p "require('./package.json').electronVersion")
|
||||
$env:npm_config_runtime="electron"
|
||||
6
scripts/env.sh
Normal file
6
scripts/env.sh
Normal file
@@ -0,0 +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_runtime=electron
|
||||
export npm_config_cache="$HOME/.npm-electron"
|
||||
mkdir -p "$npm_config_cache"
|
||||
38
scripts/monaco-editor-setup.js
Normal file
38
scripts/monaco-editor-setup.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var cp = require('child_process');
|
||||
var path = require('path');
|
||||
|
||||
var ROOT = path.join(__dirname, '..');
|
||||
var ROOT_NODE_MODULES_PATH = path.join(ROOT, 'node_modules');
|
||||
var EDITOR_ROOT = path.join(ROOT, 'build/monaco')
|
||||
var EDITOR_NODE_MODULES_PATH = path.join(EDITOR_ROOT, 'node_modules')
|
||||
|
||||
var cmd = `npm install`;
|
||||
cp.execSync(cmd, {
|
||||
cwd: EDITOR_ROOT,
|
||||
stdio:[0,1,2]
|
||||
});
|
||||
|
||||
if (!fs.existsSync(ROOT_NODE_MODULES_PATH)) {
|
||||
fs.mkdirSync(ROOT_NODE_MODULES_PATH);
|
||||
}
|
||||
|
||||
// Move deps over
|
||||
var modules = fs.readdirSync(EDITOR_NODE_MODULES_PATH);
|
||||
modules.forEach(function(module) {
|
||||
var src = path.join(EDITOR_NODE_MODULES_PATH, module);
|
||||
var dst = path.join(ROOT_NODE_MODULES_PATH, module);
|
||||
if (!fs.existsSync(dst)) {
|
||||
console.log('Moving ' + module + '...');
|
||||
fs.renameSync(src, dst);
|
||||
} else {
|
||||
console.log('Skipping moving ' + module + '.');
|
||||
}
|
||||
});
|
||||
8
scripts/npm.bat
Normal file
8
scripts/npm.bat
Normal file
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
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
|
||||
29
scripts/npm.sh
Normal file
29
scripts/npm.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
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 $*
|
||||
41
scripts/sql-cli.sh
Normal file
41
scripts/sql-cli.sh
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env 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
|
||||
|
||||
function code() {
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
# Get electron
|
||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
|
||||
ELECTRON_RUN_AS_NODE=1 \
|
||||
NODE_ENV=development \
|
||||
VSCODE_DEV=1 \
|
||||
ELECTRON_ENABLE_LOGGING=1 \
|
||||
ELECTRON_ENABLE_STACK_DUMPING=1 \
|
||||
"$CODE" --debug=5874 "$ROOT/out/cli.js" . "$@"
|
||||
}
|
||||
|
||||
code "$@"
|
||||
40
scripts/sql.bat
Normal file
40
scripts/sql.bat
Normal file
@@ -0,0 +1,40 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
title VSCode Dev
|
||||
|
||||
pushd %~dp0\..
|
||||
|
||||
:: Node modules
|
||||
if not exist node_modules call .\scripts\npm.bat install
|
||||
|
||||
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
|
||||
|
||||
:: Build
|
||||
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
||||
|
||||
:: Configuration
|
||||
set NODE_ENV=development
|
||||
set VSCODE_DEV=1
|
||||
set VSCODE_CLI=1
|
||||
set ELECTRON_DEFAULT_ERROR_MODE=1
|
||||
set ELECTRON_ENABLE_LOGGING=1
|
||||
set ELECTRON_ENABLE_STACK_DUMPING=1
|
||||
|
||||
:: Launch Code
|
||||
%CODE% . %*
|
||||
popd
|
||||
|
||||
endlocal
|
||||
44
scripts/sql.sh
Normal file
44
scripts/sql.sh
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env 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
|
||||
|
||||
function code() {
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
# Get electron
|
||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
|
||||
# Configuration
|
||||
export NODE_ENV=development
|
||||
export VSCODE_DEV=1
|
||||
export VSCODE_CLI=1
|
||||
export ELECTRON_ENABLE_LOGGING=1
|
||||
export ELECTRON_ENABLE_STACK_DUMPING=1
|
||||
|
||||
# Launch Code
|
||||
exec "$CODE" . "$@"
|
||||
}
|
||||
|
||||
code "$@"
|
||||
19
scripts/test-electron.bat
Normal file
19
scripts/test-electron.bat
Normal file
@@ -0,0 +1,19 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
set ELECTRON_RUN_AS_NODE=
|
||||
|
||||
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%"
|
||||
|
||||
rem Run tests in electron
|
||||
%CODE% .\test\electron\index.js %*
|
||||
|
||||
popd
|
||||
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
42
scripts/test-electron.sh
Normal file
42
scripts/test-electron.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/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
|
||||
|
||||
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
|
||||
|
||||
# Get electron
|
||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
echo "code $CODE"
|
||||
# Unit Tests
|
||||
export VSCODE_DEV=1
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
cd $ROOT ; ulimit -n 4096 ; \
|
||||
"$CODE" \
|
||||
test/electron/index.js "$@"
|
||||
else
|
||||
cd $ROOT ; \
|
||||
"$CODE" \
|
||||
test/electron/index.js "$@"
|
||||
fi
|
||||
1
scripts/test-int-mocha.bat
Normal file
1
scripts/test-int-mocha.bat
Normal file
@@ -0,0 +1 @@
|
||||
.\scripts\test.bat --runGlob **\*.integrationTest.js -g integration %*
|
||||
1
scripts/test-int-mocha.sh
Normal file
1
scripts/test-int-mocha.sh
Normal file
@@ -0,0 +1 @@
|
||||
./scripts/test.sh --runGlob **/*.integrationTest.js -g integration "$@"
|
||||
20
scripts/test-integration.bat
Normal file
20
scripts/test-integration.bat
Normal file
@@ -0,0 +1,20 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
pushd %~dp0\..
|
||||
|
||||
if not "%APPVEYOR%" == "" (
|
||||
set ELECTRON_RUN_AS_NODE=
|
||||
)
|
||||
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
|
||||
|
||||
rmdir /s /q %VSCODEUSERDATADIR%
|
||||
|
||||
popd
|
||||
|
||||
endlocal
|
||||
20
scripts/test-integration.sh
Normal file
20
scripts/test-integration.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
|
||||
ROOT=$(dirname $(dirname $(realpath "$0")))
|
||||
VSCODEUSERDATADIR=`mktemp -d -t 'myuserdatadir'`
|
||||
else
|
||||
ROOT=$(dirname $(dirname $(readlink -f $0)))
|
||||
VSCODEUSERDATADIR=`mktemp -d 2>/dev/null`
|
||||
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
|
||||
|
||||
rm -r $VSCODEUSERDATADIR
|
||||
25
scripts/test-mocha.bat
Normal file
25
scripts/test-mocha.bat
Normal file
@@ -0,0 +1,25 @@
|
||||
@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%"
|
||||
|
||||
rem TFS Builds
|
||||
if not "%BUILD_BUILDID%" == "" (
|
||||
%CODE% .\node_modules\mocha\bin\_mocha %*
|
||||
)
|
||||
|
||||
rem Otherwise
|
||||
if "%BUILD_BUILDID%" == "" (
|
||||
%CODE% .\node_modules\mocha\bin\_mocha --reporter dot %*
|
||||
)
|
||||
popd
|
||||
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
42
scripts/test-mocha.sh
Normal file
42
scripts/test-mocha.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/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
|
||||
|
||||
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
|
||||
|
||||
# Get electron
|
||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
|
||||
# Unit Tests
|
||||
export VSCODE_DEV=1
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
cd $ROOT ; ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \
|
||||
"$CODE" \
|
||||
node_modules/mocha/bin/_mocha "$@"
|
||||
else
|
||||
cd $ROOT ; ELECTRON_RUN_AS_NODE=1 \
|
||||
"$CODE" \
|
||||
node_modules/mocha/bin/_mocha "$@"
|
||||
fi
|
||||
25
scripts/test.bat
Normal file
25
scripts/test.bat
Normal file
@@ -0,0 +1,25 @@
|
||||
@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%"
|
||||
|
||||
rem TFS Builds
|
||||
if not "%BUILD_BUILDID%" == "" (
|
||||
%CODE% .\node_modules\mocha\bin\_mocha %*
|
||||
)
|
||||
|
||||
rem Otherwise
|
||||
if "%BUILD_BUILDID%" == "" (
|
||||
%CODE% .\node_modules\mocha\bin\_mocha --reporter dot %*
|
||||
)
|
||||
popd
|
||||
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
42
scripts/test.sh
Normal file
42
scripts/test.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/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
|
||||
|
||||
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
|
||||
|
||||
# Get electron
|
||||
(test -f "$CODE" && [ $INTENDED_VERSION == $INSTALLED_VERSION ]) || ./node_modules/.bin/gulp electron
|
||||
|
||||
# Build
|
||||
test -d out || ./node_modules/.bin/gulp compile
|
||||
|
||||
# Unit Tests
|
||||
export VSCODE_DEV=1
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
cd $ROOT ; ulimit -n 4096 ; ELECTRON_RUN_AS_NODE=1 \
|
||||
"$CODE" \
|
||||
node_modules/mocha/bin/_mocha "$@"
|
||||
else
|
||||
cd $ROOT ; ELECTRON_RUN_AS_NODE=1 \
|
||||
"$CODE" \
|
||||
node_modules/mocha/bin/_mocha "$@"
|
||||
fi
|
||||
4
scripts/watch.bat
Normal file
4
scripts/watch.bat
Normal file
@@ -0,0 +1,4 @@
|
||||
CALL gulp --max_old_space_size=2000 watch || goto :error
|
||||
:error
|
||||
echo Failed with error #%errorlevel%
|
||||
exit /b %errorlevel%
|
||||
2
scripts/watch.sh
Normal file
2
scripts/watch.sh
Normal file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
gulp --max_old_space_size=2000 watch || { echo 'gulp electron failed' ; exit 1; }
|
||||
Reference in New Issue
Block a user