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
|
|
|
|
if not exist node_modules call .\scripts\npm.bat install
|
|
|
|
|
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%"
|
|
|
|
|
2016-11-17 18:15:08 +08:00
|
|
|
for /f "tokens=2 delims=:," %%a in ('findstr /R /C:"\"electronVersion\":.*" package.json') do set DESIREDVERSION=%%~a
|
|
|
|
set DESIREDVERSION=%DESIREDVERSION: "=%
|
|
|
|
set DESIREDVERSION=v%DESIREDVERSION:"=%
|
2016-11-24 05:56:48 +08:00
|
|
|
if exist .\.build\electron\version (set /p INSTALLEDVERSION=<.\.build\electron\version) else (set INSTALLEDVERSION="")
|
2016-11-17 18:15:08 +08:00
|
|
|
|
2015-11-26 16:29:43 +08:00
|
|
|
:: Get electron
|
2016-08-09 23:11:07 +08:00
|
|
|
if not exist %CODE% node .\node_modules\gulp\bin\gulp.js electron
|
2016-11-17 18:15:08 +08:00
|
|
|
if not "%INSTALLEDVERSION%" == "%DESIREDVERSION%" node .\node_modules\gulp\bin\gulp.js electron
|
2015-11-26 16:29:43 +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
|