1+ @ echo off & setlocal EnableDelayedExpansion
2+
3+ if " %1 " == " " (
4+ goto :Help
5+ )
6+
7+ goto :Start
8+
9+
10+ :Help
11+ Echo **********************************************************
12+ Echo Usage:
13+ Echo buildall.cmd tscPath
14+ Echo Example:
15+ Echo buildall c:\typescript\built\local\tsc.js
16+ Echo **********************************************************
17+ goto :Done
18+
19+
20+ :Start
21+ set tscPath = %1
22+ set CURRENTDIR = %~dp0
23+
24+ call :buildProject " amd" " --sourcemap --module amd %CURRENTDIR% amd\app.ts"
25+ call :buildProject " d3" " --sourcemap %CURRENTDIR% d3\data.ts"
26+ call :buildProject " greeter" " --sourcemap %CURRENTDIR% greeter\greeter.ts"
27+ call :buildProject " imageboard" " --sourcemap --module commonjs %CURRENTDIR% imageboard\app.ts"
28+ call :buildProject " interfaces" " --sourcemap %CURRENTDIR% interfaces\interfaces.ts"
29+ call :buildProject " jquery" " --sourcemap --target ES5 %CURRENTDIR% jquery\parallax.ts"
30+ call :buildProject " mankala" " Driver.ts --sourcemap -out %CURRENTDIR% mankalagame.js"
31+ call :buildProject " node" " --sourcemap --module commonjs %CURRENTDIR% node\HttpServer.ts"
32+ call :buildProject " node" " --sourcemap --module commonjs %CURRENTDIR% node\TcpServer.ts"
33+ call :buildProject " raytracer" " --sourcemap %CURRENTDIR% raytracer\raytracer.ts"
34+ call :buildProject " simple" " --sourcemap %CURRENTDIR% simple\animals.ts"
35+ call :buildProject " todomvc" " --sourcemap %CURRENTDIR% todomvc\js\todos.ts"
36+ call :buildProject " warship" " --sourcemap --target ES5 %CURRENTDIR% warship\warship.ts"
37+
38+ goto :Done
39+
40+ :buildProject
41+ pushd %CURRENTDIR% %~1
42+ echo Running %~1 using node...
43+
44+ echo on
45+ call node " %tscPath% " %~2
46+ echo off
47+
48+ if not %errorlevel% == 0 (
49+ echo Failed!
50+ ) else (
51+ echo Done.
52+ )
53+
54+ echo Running %~1 using cscript...
55+
56+ echo on
57+ call cscript /nologo " %tscPath% " %~2
58+ echo off
59+
60+ if not %errorlevel% == 0 (
61+ echo Failed!
62+ ) else (
63+ echo Done.
64+ )
65+
66+ popd
67+ goto :eof
68+
69+
70+ :Done
71+ ENDLOCAL
0 commit comments