5 if /i "%1"=="help" goto help
6 if /i "%1"=="--help" goto help
7 if /i "%1"=="-help" goto help
8 if /i "%1"=="/help" goto help
9 if /i "%1"=="?" goto help
10 if /i "%1"=="-?" goto help
11 if /i "%1"=="--?" goto help
12 if /i "%1"=="/?" goto help
14 @rem Process arguments.
28 if "%1"=="" goto args-done
29 if /i "%1"=="debug" set config=Debug&goto arg-ok
30 if /i "%1"=="release" set config=Release&goto arg-ok
31 if /i "%1"=="clean" set target=Clean&goto arg-ok
32 if /i "%1"=="ia32" set target_arch=ia32&goto arg-ok
33 if /i "%1"=="x86" set target_arch=ia32&goto arg-ok
34 if /i "%1"=="x64" set target_arch=x64&goto arg-ok
35 if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
36 if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
37 if /i "%1"=="nosign" set nosign=1&goto arg-ok
38 if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
39 if /i "%1"=="test-uv" set test=test-uv&goto arg-ok
40 if /i "%1"=="test-internet" set test=test-internet&goto arg-ok
41 if /i "%1"=="test-pummel" set test=test-pummel&goto arg-ok
42 if /i "%1"=="test-simple" set test=test-simple&goto arg-ok
43 if /i "%1"=="test-message" set test=test-message&goto arg-ok
44 if /i "%1"=="test-all" set test=test-all&goto arg-ok
45 if /i "%1"=="test" set test=test&goto arg-ok
46 if /i "%1"=="msi" set msi=1&goto arg-ok
47 if /i "%1"=="upload" set upload=1&goto arg-ok
49 echo Warning: ignoring invalid command line option `%1`.
55 if defined upload goto upload
59 @rem Skip project generation if requested.
60 if defined noprojgen goto msbuild
62 @rem Generate the VS project.
63 if defined nosnapshot goto nosnapshotgen
64 python tools\gyp_node -f msvs -G msvs_version=2010 -Dtarget_arch=%target_arch%
65 if errorlevel 1 goto create-msvs-files-failed
66 if not exist node.sln goto create-msvs-files-failed
67 echo Project files generated.
71 python tools\gyp_node -f msvs -G msvs_version=2010 -D v8_use_snapshot='false' -Dtarget_arch=%target_arch%
72 if errorlevel 1 goto create-msvs-files-failed
73 if not exist node.sln goto create-msvs-files-failed
74 echo Project files generated.
77 @rem Skip project generation if requested.
78 if defined nobuild goto msi
80 @rem Bail out early if not running in VS build env.
81 if defined VCINSTALLDIR goto msbuild-found
82 if not defined VS100COMNTOOLS goto msbuild-not-found
83 if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found
84 call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat"
85 if not defined VCINSTALLDIR goto msbuild-not-found
89 echo Build skipped. To build, this file needs to run from VS cmd prompt.
93 @rem Build the sln with msbuild.
94 msbuild node.sln /m /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
95 if errorlevel 1 goto exit
97 if defined nosign goto msi
98 signtool sign /a Release\node.exe
101 @rem Skip msi generation if not requested
102 if not defined msi goto run
103 python "%~dp0tools\getnodeversion.py" > "%temp%\node_version.txt"
104 if not errorlevel 0 echo Cannot determine current version of node.js & goto exit
105 for /F "tokens=*" %%i in (%temp%\node_version.txt) do set NODE_VERSION=%%i
106 heat dir deps\npm -var var.NPMSourceDir -dr NodeModulesFolder -cg NPMFiles -gg -template fragment -nologo -out npm.wxs
107 msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:Configuration=%config% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
108 if errorlevel 1 goto exit
110 if defined nosign goto run
111 signtool sign /a Release\node.msi
114 @rem Run tests if requested.
115 if "%test%"=="" goto exit
117 if "%config%"=="Debug" set test_args=--mode=debug
118 if "%config%"=="Release" set test_args=--mode=release
120 if "%test%"=="test" set test_args=%test_args% simple message
121 if "%test%"=="test-internet" set test_args=%test_args% internet
122 if "%test%"=="test-pummel" set test_args=%test_args% pummel
123 if "%test%"=="test-simple" set test_args=%test_args% simple
124 if "%test%"=="test-message" set test_args=%test_args% message
125 if "%test%"=="test-all" set test_args=%test_args%
127 echo running 'python tools/test.py %test_args%'
128 python tools/test.py %test_args%
131 :create-msvs-files-failed
132 echo Failed to create vc project files.
136 echo uploading .exe .msi .pdb to nodejs.org
137 python "%~dp0tools\getnodeversion.py" > "%temp%\node_version.txt"
138 if not errorlevel 0 echo Cannot determine current version of node.js & goto exit
139 for /F "tokens=*" %%i in (%temp%\node_version.txt) do set NODE_VERSION=%%i
141 ssh node@nodejs.org mkdir -p web/nodejs.org/dist/v%NODE_VERSION%
142 scp Release\node.msi node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node-v%NODE_VERSION%.msi
143 scp Release\node.exe node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node.exe
144 scp Release\node.pdb node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node.pdb
149 echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [nobuild] [nosign]
151 echo vcbuild.bat : builds debug build
152 echo vcbuild.bat release msi : builds release build and MSI installer package
153 echo vcbuild.bat test : builds debug build and runs tests