source: 2010/31/build_games.bat @ 1691

Revision 1690, 2.0 KB checked in by anlakane, 9 years ago (diff)

Each course folder now has its own script for building games.

Line 
1@echo off
2setlocal
3rem | Compiles all the students' games.
4rem | The students' directories should be the subdirectories of
5rem | the current directory.
6
7set DefaultFrameworkDir=%WINDIR%\Microsoft.NET\Framework
8
9if not defined FrameworkDir (
10   set FrameworkDir=%DefaultFrameworkDir%
11)
12
13if not exist %FrameworkDir%\v3.5 (
14  ECHO.
15  ECHO.
16  echo .NET Framework 3.5 required.
17  ECHO.
18  ECHO.
19  goto end
20)
21
22set msbuild=%FrameworkDir%\v3.5\MSBuild.exe
23
24if not exist lib\jypeli2.dll (
25  echo lib path expected which contains jypeli2.dll
26  goto end
27)
28
29set root=%CD%
30set pelit=%root%\pelit
31set lib=%root%\lib
32set build=%msbuild% /t:Build /p:Configuration=Release /p:"ReferencePath=%lib%"
33set copy_dir=xcopy /S /Q /I /Y
34
35if exist %pelit%\NUL rd /S /Q %pelit%
36mkdir %pelit%
37
38for /D %%d in (*) do (
39
40  mkdir "%pelit%\%%d"
41
42  for /D %%e in (%%d\*) do (
43    pushd %%e
44
45    for %%p in (*.csproj) do (
46      rem | We have at least one project file in the directory,
47      rem | let's build it.
48
49      %build% "%%p" > NUL
50
51      if errorlevel 1 (
52        echo DOES NOT BUILD: %%e
53      )
54
55      rem We don't need these.
56      if exist "bin\x86\Release\*.pdb" del /F /Q "bin\x86\Release\*.pdb"
57      if exist "bin\x86\Release\Jypeli2.xml" del /F /Q "bin\x86\Release\Jypeli2.xml"
58
59      %copy_dir% bin\x86\Release "%pelit%\%%e" > NUL
60    )
61
62    rem | In case someone has "Create directory for solution" set
63    for /D %%f in (*) do (
64      pushd %%f
65
66      for %%p in (*.csproj) do (
67        %build% "%%p" > NUL
68
69        if errorlevel 1 (
70          echo DOES NOT BUILD: %%e
71        )
72
73        rem We don't need these.
74        if exist "bin\x86\Release\*.pdb" del /F /Q "bin\x86\Release\*.pdb"
75        if exist "bin\x86\Release\Jypeli2.xml" del /F /Q "bin\x86\Release\Jypeli2.xml"
76
77        %copy_dir% bin\x86\Release "%pelit%\%%e" > NUL
78      )
79
80      popd
81    )
82
83    popd
84  )
85)
86
87echo.
88echo Tehtiin hakemisto pelit
89
90:end
91endlocal
Note: See TracBrowser for help on using the repository browser.