Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 199 lines (167 sloc) 6.893 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 downl…
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=
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
35
36 :next-arg
37 if "%1"=="" goto args-done
c3f1762 @piscisaureus Fix vcbuild.bat, print error when an unrecognized option is encountered
piscisaureus authored
38 if /i "%1"=="debug" set config=Debug&goto arg-ok
39 if /i "%1"=="release" set config=Release&goto arg-ok
40 if /i "%1"=="clean" set target=Clean&goto arg-ok
41 if /i "%1"=="ia32" set target_arch=ia32&goto arg-ok
42 if /i "%1"=="x86" set target_arch=ia32&goto arg-ok
43 if /i "%1"=="x64" set target_arch=x64&goto arg-ok
44 if /i "%1"=="noprojgen" set noprojgen=1&goto arg-ok
45 if /i "%1"=="nobuild" set nobuild=1&goto arg-ok
46 if /i "%1"=="nosign" set nosign=1&goto arg-ok
47 if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
35a1421 Windows: Enable ETW events.
Igor Zinkovsky authored
48 if /i "%1"=="noetw" set noetw=1&goto arg-ok
2728dcc @piscisaureus Windows: add build step that generates license.rtf from LICENSE
piscisaureus authored
49 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
50 if /i "%1"=="test-uv" set test=test-uv&goto arg-ok
51 if /i "%1"=="test-internet" set test=test-internet&goto arg-ok
52 if /i "%1"=="test-pummel" set test=test-pummel&goto arg-ok
53 if /i "%1"=="test-simple" set test=test-simple&goto arg-ok
54 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 downl…
TooTallNate authored
55 if /i "%1"=="test-gc" set test=test-gc&set buildnodeweak=1&goto arg-ok
56 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
57 if /i "%1"=="test" set test=test&goto arg-ok
2728dcc @piscisaureus Windows: add build step that generates license.rtf from LICENSE
piscisaureus authored
58 if /i "%1"=="msi" set msi=1&set licensertf=1&goto arg-ok
c3f1762 @piscisaureus Fix vcbuild.bat, print error when an unrecognized option is encountered
piscisaureus authored
59 if /i "%1"=="upload" set upload=1&goto arg-ok
0c68604 add jslint to vcbuild.bat
Igor Zinkovsky authored
60 if /i "%1"=="jslint" set jslint=1&goto arg-ok
9c70b09 @piscisaureus Fix strange vcbuild "label not found" error
piscisaureus authored
61
c3f1762 @piscisaureus Fix vcbuild.bat, print error when an unrecognized option is encountered
piscisaureus authored
62 echo Warning: ignoring invalid command line option `%1`.
9c70b09 @piscisaureus Fix strange vcbuild "label not found" error
piscisaureus authored
63
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
64 :arg-ok
029e01b @piscisaureus vcbuild.bat: add duplicate arg-ok label to work around cmd.exe bug
piscisaureus authored
65 :arg-ok
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
66 shift
67 goto next-arg
6a8b5b3 @TooTallNate test: bundle node-weak in test/gc so that it doesn't need to be downl…
TooTallNate authored
68
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
69 :args-done
2af6431 @ry Add upload command to vcbuild.bat
ry authored
70 if defined upload goto upload
0c68604 add jslint to vcbuild.bat
Igor Zinkovsky authored
71 if defined jslint goto jslint
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
72
dc75232 @TooTallNate vcbuild: run the 'configure' script in vcbuild.bat
TooTallNate authored
73 if "%config%"=="Debug" set debug_arg=--debug
9fe39ed @mattness windows: don't install x64 version into the 'program files (x86)' folder
mattness authored
74 if "%target_arch%"=="x64" set msiplatform=x64
dc75232 @TooTallNate vcbuild: run the 'configure' script in vcbuild.bat
TooTallNate authored
75 if defined nosnapshot set nosnapshot_arg=--without-snapshot
35a1421 Windows: Enable ETW events.
Igor Zinkovsky authored
76 if defined noetw set noetw_arg=--without-etw& set noetw_msi_arg=/p:NoETW=1
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
77
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
78 :project-gen
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
79 @rem Skip project generation if requested.
80 if defined noprojgen goto msbuild
81
82 @rem Generate the VS project.
35a1421 Windows: Enable ETW events.
Igor Zinkovsky authored
83 python configure %debug_arg% %nosnapshot_arg% %noetw_arg% --dest-cpu=%target_arch%
bca88b2 @ry support nosnapshot in vcbuild.bat
ry authored
84 if errorlevel 1 goto create-msvs-files-failed
85 if not exist node.sln goto create-msvs-files-failed
86 echo Project files generated.
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
87
88 :msbuild
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
89 @rem Skip project generation if requested.
2728dcc @piscisaureus Windows: add build step that generates license.rtf from LICENSE
piscisaureus authored
90 if defined nobuild goto sign
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
91
d01b87d @piscisaureus win: vcbuild.bat should attempt to run vcvarsall.bat
piscisaureus authored
92 @rem Bail out early if not running in VS build env.
93 if defined VCINSTALLDIR goto msbuild-found
94 if not defined VS100COMNTOOLS goto msbuild-not-found
95 if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found
96 call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat"
97 if not defined VCINSTALLDIR goto msbuild-not-found
98 goto msbuild-found
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
99
d01b87d @piscisaureus win: vcbuild.bat should attempt to run vcvarsall.bat
piscisaureus authored
100 :msbuild-not-found
101 echo Build skipped. To build, this file needs to run from VS cmd prompt.
102 goto run
103
104 :msbuild-found
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
105 @rem Build the sln with msbuild.
cdb5864 @bnoordhuis Make msbuild run in parallel.
bnoordhuis authored
106 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
107 if errorlevel 1 goto exit
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
108
2728dcc @piscisaureus Windows: add build step that generates license.rtf from LICENSE
piscisaureus authored
109 :sign
110 @rem Skip signing if the `nosign` option was specified.
111 if defined nosign goto licensertf
112
055a933 @ry Add exe and msi signing to vcbuild.bat
ry authored
113 signtool sign /a Release\node.exe
114
2728dcc @piscisaureus Windows: add build step that generates license.rtf from LICENSE
piscisaureus authored
115 :licensertf
116 @rem Skip license.rtf generation if not requested.
117 if not defined licensertf goto msi
118
119 %config%\node tools\license2rtf.js < LICENSE > %config%\license.rtf
120 if errorlevel 1 echo Failed to generate license.rtf&goto exit
121
6fadbec @tjanczuk wix project to create msi installer for windows
tjanczuk authored
122 :msi
123 @rem Skip msi generation if not requested
124 if not defined msi goto run
895fa3a @ry Simplify and move getnodeversion.py
ry authored
125 python "%~dp0tools\getnodeversion.py" > "%temp%\node_version.txt"
6fadbec @tjanczuk wix project to create msi installer for windows
tjanczuk authored
126 if not errorlevel 0 echo Cannot determine current version of node.js & goto exit
127 for /F "tokens=*" %%i in (%temp%\node_version.txt) do set NODE_VERSION=%%i
35a1421 Windows: Enable ETW events.
Igor Zinkovsky authored
128 msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build /p:Configuration=%config% /p:Platform=%msiplatform% /p:NodeVersion=%NODE_VERSION% %noetw_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
6fadbec @tjanczuk wix project to create msi installer for windows
tjanczuk authored
129 if errorlevel 1 goto exit
130
055a933 @ry Add exe and msi signing to vcbuild.bat
ry authored
131 if defined nosign goto run
e2126e0 @japj windows/msi: cleanup WiX project files
japj authored
132 signtool sign /a Release\node-v%NODE_VERSION%-%msiplatform%.msi
055a933 @ry Add exe and msi signing to vcbuild.bat
ry authored
133
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
134 :run
135 @rem Run tests if requested.
136 if "%test%"=="" goto exit
137
138 if "%config%"=="Debug" set test_args=--mode=debug
139 if "%config%"=="Release" set test_args=--mode=release
140
141 if "%test%"=="test" set test_args=%test_args% simple message
142 if "%test%"=="test-internet" set test_args=%test_args% internet
143 if "%test%"=="test-pummel" set test_args=%test_args% pummel
144 if "%test%"=="test-simple" set test_args=%test_args% simple
145 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 downl…
TooTallNate authored
146 if "%test%"=="test-gc" set test_args=%test_args% gc
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
147 if "%test%"=="test-all" set test_args=%test_args%
148
6a8b5b3 @TooTallNate test: bundle node-weak in test/gc so that it doesn't need to be downl…
TooTallNate authored
149 :build-node-weak
150 @rem Build node-weak if required
151 if "%buildnodeweak%"=="" goto run-tests
152 "%config%\node" deps\npm\node_modules\node-gyp\bin\node-gyp rebuild --directory="%~dp0test\gc\node_modules\weak" --nodedir="%~dp0."
153 if errorlevel 1 goto build-node-weak-failed
154 goto run-tests
155
156 :build-node-weak-failed
157 echo Failed to build node-weak.
158 goto exit
159
160 :run-tests
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
161 echo running 'python tools/test.py %test_args%'
162 python tools/test.py %test_args%
0c68604 add jslint to vcbuild.bat
Igor Zinkovsky authored
163 if "%test%"=="test" goto jslint
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
164 goto exit
165
166 :create-msvs-files-failed
167 echo Failed to create vc project files.
168 goto exit
169
2af6431 @ry Add upload command to vcbuild.bat
ry authored
170 :upload
171 echo uploading .exe .msi .pdb to nodejs.org
172 python "%~dp0tools\getnodeversion.py" > "%temp%\node_version.txt"
173 if not errorlevel 0 echo Cannot determine current version of node.js & goto exit
174 for /F "tokens=*" %%i in (%temp%\node_version.txt) do set NODE_VERSION=%%i
175 @echo on
176 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
177 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
178 scp Release\node.exe node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node.exe
179 scp Release\node.pdb node@nodejs.org:~/web/nodejs.org/dist/v%NODE_VERSION%/node.pdb
180 @echo off
181 goto exit
182
0c68604 add jslint to vcbuild.bat
Igor Zinkovsky authored
183 :jslint
184 echo running jslint
185 set PYTHONPATH=tools/closure_linter/
186 python tools/closure_linter/closure_linter/gjslint.py --unix_mode --strict --nojsdoc -r lib/ -r src/ -r test/ --exclude_files lib/punycode.js
187 goto exit
188
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
189 :help
9fe39ed @mattness windows: don't install x64 version into the 'program files (x86)' folder
mattness authored
190 echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [nobuild] [nosign] [x86/x64]
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
191 echo Examples:
18acdff @shigeki build: fix the help output of vcbuild.bat
shigeki authored
192 echo vcbuild.bat : builds release build
193 echo vcbuild.bat debug : builds debug build
6fadbec @tjanczuk wix project to create msi installer for windows
tjanczuk authored
194 echo vcbuild.bat release msi : builds release build and MSI installer package
779c93c merge vcbuild.bat and generate_projects.bat
Igor Zinkovsky authored
195 echo vcbuild.bat test : builds debug build and runs tests
19ff87a vcbuild.bat - for building from cmd-line using msbuild
Igor Zinkovsky authored
196 goto exit
197
198 :exit
Something went wrong with that request. Please try again.