2015-11-13 21:39:38 +08:00
|
|
|
@echo off
|
2016-02-18 23:50:33 +08:00
|
|
|
setlocal
|
|
|
|
|
2015-11-13 21:39:38 +08:00
|
|
|
title VSCode Dev
|
|
|
|
|
2015-11-26 16:29:43 +08:00
|
|
|
pushd %~dp0\..
|
|
|
|
|
|
|
|
:: Node modules
|
2017-11-16 17:47:02 +08:00
|
|
|
if not exist node_modules call yarn
|
2015-11-26 16:29:43 +08:00
|
|
|
|
2016-08-09 23:11:07 +08:00
|
|
|
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%"
|
|
|
|
|
2017-11-16 21:43:41 +08:00
|
|
|
:: Download Electron if needed
|
|
|
|
node build\lib\electron.js
|
|
|
|
if %errorlevel% neq 0 node .\node_modules\gulp\bin\gulp.js electron
|
2015-11-26 16:29:43 +08:00
|
|
|
|
2018-01-29 19:23:43 +08:00
|
|
|
:: Sync built-in extensions
|
2018-01-24 12:41:05 +08:00
|
|
|
node build\lib\builtInExtensions.js
|
2018-01-24 08:51:31 +08:00
|
|
|
|
2015-11-26 17:07:11 +08:00
|
|
|
:: Build
|
|
|
|
if not exist out node .\node_modules\gulp\bin\gulp.js compile
|
|
|
|
|
2015-11-26 16:29:43 +08:00
|
|
|
:: Configuration
|
2015-11-13 21:39:38 +08:00
|
|
|
set NODE_ENV=development
|
|
|
|
set VSCODE_DEV=1
|
2016-08-08 22:12:32 +08:00
|
|
|
set VSCODE_CLI=1
|
2015-12-01 22:26:04 +08:00
|
|
|
set ELECTRON_DEFAULT_ERROR_MODE=1
|
2015-11-13 21:39:38 +08:00
|
|
|
set ELECTRON_ENABLE_LOGGING=1
|
|
|
|
set ELECTRON_ENABLE_STACK_DUMPING=1
|
|
|
|
|
2015-11-26 16:29:43 +08:00
|
|
|
:: Launch Code
|
2017-02-14 00:51:53 +08:00
|
|
|
|
|
|
|
:: 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" . %*
|
|
|
|
|
2016-08-09 23:11:07 +08:00
|
|
|
%CODE% . %*
|
2015-11-13 21:39:38 +08:00
|
|
|
popd
|
2015-12-18 16:21:19 +08:00
|
|
|
|
2016-08-09 23:11:07 +08:00
|
|
|
endlocal
|