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