OSDN Git Service

Adjust to the introduction of FolderType ENUM in libomv
[radegast/radegast.git] / runprebuild2012.bat
1 @echo off
2 ::
3 :: Prebuild generator for the Radegast
4 ::
5 :: Command Line Options:
6 :: (none)            - create solution/project files and create compile.bat file to build solution
7 :: msbuild           - Create project files, compile solution
8 :: msbuild runtests  - create project files, compile solution, run unit tests
9 :: msbuild docs      - create project files, compile solution, build API documentation
10 :: msbuild docs dist - Create project files, compile solution, run unit tests, build api documentation, create binary zip
11 ::                   - and exe installer
12 ::
13 :: nant              - Create project files, run nant to compile solution
14 :: nant runtests     - Create project files, run nant to compile solution, run unit tests
15 ::
16
17 echo ##########################################
18 echo creating prebuild files for: vs2010
19 echo Parameters: %1 %2
20 echo ##########################################
21
22 if not exist bin mkdir bin
23
24 :: run prebuild to generate solution/project files from prebuild.xml configuration file
25 Radegast\prebuild.exe /target vs2012
26
27 :: build compile.bat file based on command line parameters
28 echo @echo off > compile.bat
29 if(.%1)==(.) echo %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\msbuild Radegast.sln >> compile.bat
30
31 if(.%1)==(.msbuild) echo echo ==== COMPILE BEGIN ==== >> compile.bat
32 if(.%1)==(.msbuild) echo %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Release Radegast.sln >> compile.bat
33 if(.%1)==(.msbuild) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
34
35 if(.%1)==(.nant) echo nant >> compile.bat
36 if(.%1)==(.nant) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
37
38 if(.%3)==(.docs) echo echo ==== GENERATE DOCUMENTATION BEGIN ==== >> compile.bat
39 if(.%2)==(.docs) echo %SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /p:Configuration=Release docs\Radegast.shfbproj >> compile.bat
40 if(.%2)==(.docs) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
41 if(.%2)==(.docs) echo 7z.exe a -tzip docs\documentation.zip docs\trunk >> compile.bat
42 if(.%2)==(.docs) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
43
44 if(.%2)==(.runtests) echo echo ==== UNIT TESTS BEGIN ==== >> compile.bat
45 if(.%2)==(.runtests) echo nunit-console bin\Radegast.Tests.dll /exclude:Network /nodots /labels /xml:testresults.xml >> compile.bat
46
47 if(.%2)==(.runtests) echo IF ERRORLEVEL 1 GOTO FAIL >> compile.bat
48
49 if not (.%2)==(.dist) goto NODIST
50 echo echo ==== GENERATE DISTRIBUTION BEGIN ==== >> compile.bat
51 copy Radegast\radegast.nsi bin
52 echo del /q Radegast-*-installer.exe >> compile.bat
53 echo del /q radegast-latest.zip >> compile.bat
54
55 if not exist "%PROGRAMFILES%\NSIS\Unicode\makensis.exe" goto NOUNINSIS
56 echo "%PROGRAMFILES%\NSIS\Unicode\makensis.exe" bin\radegast.nsi >> compile.bat
57 goto NONSIS
58 :NOUNINSIS
59
60 if not exist "%PROGRAMFILES%\NSIS\makensis.exe" goto NONSIS
61 echo "%PROGRAMFILES%\NSIS\makensis.exe" bin\radegast.nsi >> compile.bat
62 :NONSIS
63
64 echo cd bin >> compile.bat
65 echo 7z.exe a -r -tzip ..\radegast-latest.zip *.* >> compile.bat
66 echo cd .. >> compile.bat
67
68 :NODIST
69
70 echo :SUCCESS >> compile.bat
71 echo echo Build Successful! >> compile.bat
72 echo exit /B 0 >> compile.bat
73 echo :FAIL >> compile.bat
74 echo echo Build Failed, check log for reason >> compile.bat
75 echo exit /B 1 >> compile.bat
76
77 :: perform the appropriate action
78 if(.%1)==(.msbuild) compile.bat
79 if(.%1)==(.nant) compile.bat
80 if(.%1)==(.dist) compile.bat
81