Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 272 lines (231 sloc) 9.212 kb
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
1 @echo off
2
3 cd %~dp0
4
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
13
14 @rem Process arguments.
c1fcb1d @shigeki build: change default BUILDTYPE of vcbuild.bat
shigeki authored
15 set config=Release
9fe39ed @mattness windows: don't install x64 version into the 'program files (x86)' folder
mattness authored
16 set msiplatform=x86
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
17 set target=Build
0a34755 enable x64 windows build
Igor Zinkovsky authored
18 set target_arch=ia32
dc75232 @TooTallNate vcbuild: run the 'configure' script in vcbuild.bat
TooTallNate authored
19 set debug_arg=
20 set nosnapshot_arg=
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
21 set noprojgen=
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
22 set nobuild=
055a933 @ry Add exe and msi signing to vcbuild.bat
ry authored
23 set nosign=
bca88b2 @ry support nosnapshot in vcbuild.bat
ry authored
24 set nosnapshot=
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
25 set test=
26 set test_args=
6fadbec @tjanczuk wix project to create msi installer for windows
tjanczuk authored
27 set msi=
2728dcc @piscisaureus Windows: add build step that generates license.rtf from LICENSE
piscisaureus authored
28 set licensertf=
2af6431 @ry Add upload command to vcbuild.bat
ry authored
29 set upload=
0c68604 add jslint to vcbuild.bat
Igor Zinkovsky authored
30 set jslint=
6a8b5b3 @TooTallNate test: bundle node-weak in test/gc so that it doesn't need to be download...
TooTallNate authored
31 set buildnodeweak=
35a1421 Windows: Enable ETW events.
Igor Zinkovsky authored
32 set noetw=
33 set noetw_arg=
34 set noetw_msi_arg=
f657ce6 @sblom windows: add tracing with performance counters
sblom authored
35 set noperfctr=
36 set noperfctr_arg=
37 set noperfctr_msi_arg=
ac2857b @srl295 build, i18n: improve Intl build, add "--with-intl"
srl295 authored
38 set i18n_arg=
a308395 @srl295 build: i18n: add icu config options
srl295 authored
39 set download_arg=
e670732 @misterdjules build: enable small-icu support for build-release
misterdjules authored
40 set build_release=
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
41
42 :next-arg
43 if "%1"=="" goto args-done
c3f1762 @piscisaureus Fix vcbuild.bat, print error when an unrecognized option is encountered
piscisaureus authored
44 if /i "%1"=="debug" set config=Debug&goto arg-ok
45 if /i "%1"=="release" set config=Release&goto arg-ok
46 if /i "%1"=="clean" set target=Clean&goto arg-ok
47 if /i "%1"=="ia32" set target_arch=ia32&goto arg-ok
48 if /i "%1"=="x86" set target_arch=ia32&goto arg-ok
49 if /i "%1"=="x64" set target_arch=x64&goto arg-ok
50 if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
51 if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
52 if /i "%1"=="nosign" set nosign=1&goto arg-ok
53 if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
35a1421 Windows: Enable ETW events.
Igor Zinkovsky authored
54 if /i "%1"=="noetw" set noetw=1&goto arg-ok
f657ce6 @sblom windows: add tracing with performance counters
sblom authored
55 if /i "%1"=="noperfctr" set noperfctr=1&goto arg-ok
2728dcc @piscisaureus Windows: add build step that generates license.rtf from LICENSE
piscisaureus authored
56 if /i "%1"=="licensertf" set licensertf=1&goto arg-ok
c3f1762 @piscisaureus Fix vcbuild.bat, print error when an unrecognized option is encountered
piscisaureus authored
57 if /i "%1"=="test-uv" set test=test-uv&goto arg-ok
58 if /i "%1"=="test-internet" set test=test-internet&goto arg-ok
59 if /i "%1"=="test-pummel" set test=test-pummel&goto arg-ok
60 if /i "%1"=="test-simple" set test=test-simple&goto arg-ok
61 if /i "%1"=="test-message" set test=test-message&goto arg-ok
6a8b5b3 @TooTallNate test: bundle node-weak in test/gc so that it doesn't need to be download...
TooTallNate authored
62 if /i "%1"=="test-gc" set test=test-gc&set buildnodeweak=1&goto arg-ok
63 if /i "%1"=="test-all" set test=test-all&set buildnodeweak=1&goto arg-ok
c3f1762 @piscisaureus Fix vcbuild.bat, print error when an unrecognized option is encountered
piscisaureus authored
64 if /i "%1"=="test" set test=test&goto arg-ok
67f87a7 @misterdjules build: add small-icu support for binary packages
misterdjules authored
65 @rem Include small-icu support with MSI installer
66 if /i "%1"=="msi" set msi=1&set licensertf=1&set download_arg="--download=all"&set i18n_arg=small-icu&goto arg-ok
c3f1762 @piscisaureus Fix vcbuild.bat, print error when an unrecognized option is encountered
piscisaureus authored
67 if /i "%1"=="upload" set upload=1&goto arg-ok
0c68604 add jslint to vcbuild.bat
Igor Zinkovsky authored
68 if /i "%1"=="jslint" set jslint=1&goto arg-ok
ac2857b @srl295 build, i18n: improve Intl build, add "--with-intl"
srl295 authored
69 if /i "%1"=="small-icu" set i18n_arg=%1&goto arg-ok
70 if /i "%1"=="full-icu" set i18n_arg=%1&goto arg-ok
a308395 @srl295 build: i18n: add icu config options
srl295 authored
71 if /i "%1"=="intl-none" set i18n_arg=%1&goto arg-ok
72 if /i "%1"=="download-all" set download_arg="--download=all"&goto arg-ok
e670732 @misterdjules build: enable small-icu support for build-release
misterdjules authored
73 if /i "%1"=="build-release" set build_release=1&goto arg-ok
9c70b09 @piscisaureus Fix strange vcbuild "label not found" error
piscisaureus authored
74
c3f1762 @piscisaureus Fix vcbuild.bat, print error when an unrecognized option is encountered
piscisaureus authored
75 echo Warning: ignoring invalid command line option `%1`.
9c70b09 @piscisaureus Fix strange vcbuild "label not found" error
piscisaureus authored
76
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
77 :arg-ok
029e01b @piscisaureus vcbuild.bat: add duplicate arg-ok label to work around cmd.exe bug
piscisaureus authored
78 :arg-ok
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
79 shift
80 goto next-arg
6a8b5b3 @TooTallNate test: bundle node-weak in test/gc so that it doesn't need to be download...
TooTallNate authored
81
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
82 :args-done
2af6431 @ry Add upload command to vcbuild.bat
ry authored
83 if defined upload goto upload
0c68604 add jslint to vcbuild.bat
Igor Zinkovsky authored
84 if defined jslint goto jslint
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
85
e670732 @misterdjules build: enable small-icu support for build-release
misterdjules authored
86 if defined build_release (
87 set nosnapshot=1
88 set config=Release
89 set msi=1
90 set licensertf=1
91 set download_arg="--download=all"
92 set i18n_arg=small-icu
93 )
94
dc75232 @TooTallNate vcbuild: run the 'configure' script in vcbuild.bat
TooTallNate authored
95 if "%config%"=="Debug" set debug_arg=--debug
9fe39ed @mattness windows: don't install x64 version into the 'program files (x86)' folder
mattness authored
96 if "%target_arch%"=="x64" set msiplatform=x64
dc75232 @TooTallNate vcbuild: run the 'configure' script in vcbuild.bat
TooTallNate authored
97 if defined nosnapshot set nosnapshot_arg=--without-snapshot
35a1421 Windows: Enable ETW events.
Igor Zinkovsky authored
98 if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1
f657ce6 @sblom windows: add tracing with performance counters
sblom authored
99 if defined noperfctr set noperfctr_arg=--without-perfctr& set noperfctr_msi_arg=/p:NoPerfCtr=1
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
100
ac2857b @srl295 build, i18n: improve Intl build, add "--with-intl"
srl295 authored
101 if "%i18n_arg%"=="full-icu" set i18n_arg=--with-intl=full-icu
102 if "%i18n_arg%"=="small-icu" set i18n_arg=--with-intl=small-icu
a308395 @srl295 build: i18n: add icu config options
srl295 authored
103 if "%i18n_arg%"=="intl-none" set i18n_arg=--with-intl=none
ac2857b @srl295 build, i18n: improve Intl build, add "--with-intl"
srl295 authored
104
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
105 :project-gen
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
106 @rem Skip project generation if requested.
107 if defined noprojgen goto msbuild
108
f9ba9f7 @tjfontaine build: define nightly tag external to build system
tjfontaine authored
109 if defined NIGHTLY set TAG=nightly-%NIGHTLY%
110
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
111 @rem Generate the VS project.
a616774 @sblom windows: improve Visual Studio Express build support
sblom authored
112 SETLOCAL
113 if defined VS100COMNTOOLS call "%VS100COMNTOOLS%\VCVarsQueryRegistry.bat"
a308395 @srl295 build: i18n: add icu config options
srl295 authored
114 python configure %download_arg% %i18n_arg% %debug_arg% %nosnapshot_arg% %noetw_arg% %noperfctr_arg% --dest-cpu=%target_arch% --tag=%TAG%
a616774 @sblom windows: improve Visual Studio Express build support
sblom authored
115 if errorlevel 1 goto create-msvs-files-failed
116 if not exist node.sln goto create-msvs-files-failed
117 echo Project files generated.
118 ENDLOCAL
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
119
120 :msbuild
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
121 @rem Skip project generation if requested.
2728dcc @piscisaureus Windows: add build step that generates license.rtf from LICENSE
piscisaureus authored
122 if defined nobuild goto sign
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
123
d2d56d0 @gimelfarb build: add settings for VS 2013 to vcbuild.bat
gimelfarb authored
124 @rem Look for Visual Studio 2013
125 if not defined VS120COMNTOOLS goto vc-set-2012
126 if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2012
d22637c @orangemocha build: vcbuild fix "The input line is too long."
orangemocha authored
127 if "%VCVARS_VER%" NEQ "120" (
128 call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat"
129 SET VCVARS_VER=120
130 )
d2d56d0 @gimelfarb build: add settings for VS 2013 to vcbuild.bat
gimelfarb authored
131 if not defined VCINSTALLDIR goto msbuild-not-found
132 set GYP_MSVS_VERSION=2013
133 goto msbuild-found
134
135 :vc-set-2012
0602fbb @bajtos build: added support for Visual Studio 2012
bajtos authored
136 @rem Look for Visual Studio 2012
137 if not defined VS110COMNTOOLS goto vc-set-2010
138 if not exist "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2010
d22637c @orangemocha build: vcbuild fix "The input line is too long."
orangemocha authored
139 if "%VCVARS_VER%" NEQ "110" (
140 call "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat"
141 SET VCVARS_VER=110
142 )
0602fbb @bajtos build: added support for Visual Studio 2012
bajtos authored
143 if not defined VCINSTALLDIR goto msbuild-not-found
144 set GYP_MSVS_VERSION=2012
145 goto msbuild-found
146
147 :vc-set-2010
d01b87d @piscisaureus win: vcbuild.bat should attempt to run vcvarsall.bat
piscisaureus authored
148 if not defined VS100COMNTOOLS goto msbuild-not-found
149 if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found
d22637c @orangemocha build: vcbuild fix "The input line is too long."
orangemocha authored
150 if "%VCVARS_VER%" NEQ "100" (
151 call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat"
152 SET VCVARS_VER=100
153 )
d01b87d @piscisaureus win: vcbuild.bat should attempt to run vcvarsall.bat
piscisaureus authored
154 if not defined VCINSTALLDIR goto msbuild-not-found
155 goto msbuild-found
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
156
d01b87d @piscisaureus win: vcbuild.bat should attempt to run vcvarsall.bat
piscisaureus authored
157 :msbuild-not-found
158 echo Build skipped. To build, this file needs to run from VS cmd prompt.
159 goto run
160
161 :msbuild-found
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
162 @rem Build the sln with msbuild.
cdb5864 @bnoordhuis Make msbuild run in parallel.
bnoordhuis authored
163 msbuild node.sln /m /t:%target% /p:Configuration=%config% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
164 if errorlevel 1 goto exit
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
165
2728dcc @piscisaureus Windows: add build step that generates license.rtf from LICENSE
piscisaureus authored
166 :sign
167 @rem Skip signing if the `nosign` option was specified.
168 if defined nosign goto licensertf
169
a9d2224 @daguej build: windows signing should include timestamps
daguej authored
170 signtool sign /a /d "Node.js" /t http://timestamp.globalsign.com/scripts/timestamp.dll Release\node.exe
171 if errorlevel 1 echo Failed to sign exe&goto exit
055a933 @ry Add exe and msi signing to vcbuild.bat
ry authored
172
2728dcc @piscisaureus Windows: add build step that generates license.rtf from LICENSE
piscisaureus authored
173 :licensertf
174 @rem Skip license.rtf generation if not requested.
175 if not defined licensertf goto msi
176
177 %config%\node tools\license2rtf.js < LICENSE > %config%\license.rtf
178 if errorlevel 1 echo Failed to generate license.rtf&goto exit
179
6fadbec @tjanczuk wix project to create msi installer for windows
tjanczuk authored
180 :msi
181 @rem Skip msi generation if not requested
182 if not defined msi goto run
6366a30 @sblom build/windows: don't use wrong version number
sblom authored
183 call :getnodeversion
f0f87d8 @tjfontaine build: windows should append date if nightly
tjfontaine authored
184
185 if not defined NIGHTLY goto msibuild
f9ba9f7 @tjfontaine build: define nightly tag external to build system
tjfontaine authored
186 set NODE_VERSION=%NODE_VERSION%.%NIGHTLY%
f0f87d8 @tjfontaine build: windows should append date if nightly
tjfontaine authored
187
188 :msibuild
189 echo Building node-%NODE_VERSION%
f657ce6 @sblom windows: add tracing with performance counters
sblom authored
190 msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:Configuration=%config% /p:Platform=%msiplatform% /p:NodeVersion=%NODE_VERSION% %noetw_msi_arg% %noperfctr_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
6fadbec @tjanczuk wix project to create msi installer for windows
tjanczuk authored
191 if errorlevel 1 goto exit
192
055a933 @ry Add exe and msi signing to vcbuild.bat
ry authored
193 if defined nosign goto run
a9d2224 @daguej build: windows signing should include timestamps
daguej authored
194 signtool sign /a /d "Node.js" /t http://timestamp.globalsign.com/scripts/timestamp.dll Release\node-v%NODE_VERSION%-%msiplatform%.msi
195 if errorlevel 1 echo Failed to sign msi&goto exit
055a933 @ry Add exe and msi signing to vcbuild.bat
ry authored
196
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
197 :run
198 @rem Run tests if requested.
199 if "%test%"=="" goto exit
200
201 if "%config%"=="Debug" set test_args=--mode=debug
202 if "%config%"=="Release" set test_args=--mode=release
203
204 if "%test%"=="test" set test_args=%test_args% simple message
205 if "%test%"=="test-internet" set test_args=%test_args% internet
206 if "%test%"=="test-pummel" set test_args=%test_args% pummel
207 if "%test%"=="test-simple" set test_args=%test_args% simple
208 if "%test%"=="test-message" set test_args=%test_args% message
6a8b5b3 @TooTallNate test: bundle node-weak in test/gc so that it doesn't need to be download...
TooTallNate authored
209 if "%test%"=="test-gc" set test_args=%test_args% gc
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
210 if "%test%"=="test-all" set test_args=%test_args%
211
6a8b5b3 @TooTallNate test: bundle node-weak in test/gc so that it doesn't need to be download...
TooTallNate authored
212 :build-node-weak
213 @rem Build node-weak if required
214 if "%buildnodeweak%"=="" goto run-tests
215 "%config%\node" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild --directory="%~dp0test\gc\node_modules\weak" --nodedir="%~dp0."
216 if errorlevel 1 goto build-node-weak-failed
217 goto run-tests
218
219 :build-node-weak-failed
220 echo Failed to build node-weak.
221 goto exit
222
223 :run-tests
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
224 echo running 'python tools/test.py %test_args%'
225 python tools/test.py %test_args%
0c68604 add jslint to vcbuild.bat
Igor Zinkovsky authored
226 if "%test%"=="test" goto jslint
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
227 goto exit
228
229 :create-msvs-files-failed
230 echo Failed to create vc project files.
231 goto exit
232
2af6431 @ry Add upload command to vcbuild.bat
ry authored
233 :upload
234 echo uploading .exe .msi .pdb to nodejs.org
6366a30 @sblom build/windows: don't use wrong version number
sblom authored
235 call :getnodeversion
2af6431 @ry Add upload command to vcbuild.bat
ry authored
236 @echo on
237 ssh node@nodejs.org mkdir -p web/nodejs.org/dist/v%NODE_VERSION%
d214576 @ry Be consistent with v before version in packages
ry authored
238 scp Release\node.msi node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node-v%NODE_VERSION%.msi
2af6431 @ry Add upload command to vcbuild.bat
ry authored
239 scp Release\node.exe node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node.exe
240 scp Release\node.pdb node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node.pdb
241 @echo off
242 goto exit
243
0c68604 add jslint to vcbuild.bat
Igor Zinkovsky authored
244 :jslint
245 echo running jslint
246 set PYTHONPATH=tools/closure_linter/
f36bfd1 @shigeki build: remove jslint test/ on Windows
shigeki authored
247 python tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ --exclude_files lib/punycode.js
0c68604 add jslint to vcbuild.bat
Igor Zinkovsky authored
248 goto exit
249
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
250 :help
a308395 @srl295 build: i18n: add icu config options
srl295 authored
251 echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/intl-none] [nobuild] [nosign] [x86/x64] [download-all]
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
252 echo Examples:
18acdff @shigeki build: fix the help output of vcbuild.bat
shigeki authored
253 echo vcbuild.bat : builds release build
254 echo vcbuild.bat debug : builds debug build
6fadbec @tjanczuk wix project to create msi installer for windows
tjanczuk authored
255 echo vcbuild.bat release msi : builds release build and MSI installer package
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
256 echo vcbuild.bat test : builds debug build and runs tests
6168fe6 @tjfontaine build: add win32 convenience build rule
tjfontaine authored
257 echo vcbuild.bat build-release : builds the release distribution as used by nodejs.org
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
258 goto exit
259
260 :exit
6366a30 @sblom build/windows: don't use wrong version number
sblom authored
261 goto :EOF
262
263 rem ***************
264 rem Subroutines
265 rem ***************
266
267 :getnodeversion
268 set NODE_VERSION=
269 for /F "usebackq tokens=*" %%i in (`python "%~dp0tools\getnodeversion.py"`) do set NODE_VERSION=%%i
270 if not defined NODE_VERSION echo Cannot determine current version of node.js & exit /b 1
271 goto :EOF
Something went wrong with that request. Please try again.