Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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