Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 245 lines (206 sloc) 7.052 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
@echo off
pushd %~dp0

set NANT=Tools\nant\bin\NAnt.exe -t:net-3.5

echo --- SETUP ---
echo A. Set up for Visual Studio (creates AssemblyInfo.cs files).
echo.
echo --- TESTING ---
echo B. Learn how to set up database and connection string for testing.
echo C. How to increase the window scroll/size so you can see more test output.
echo D. Build and run all tests.
echo.
echo --- BUILD ---
echo E. Build NHibernate (Debug)
echo F. Build NHibernate (Release)
echo G. Build Release Package (Also runs tests and creates documentation)
echo.
echo --- GRAMMAR ---
echo H. Grammar operations (related to Hql.g and HqlSqlWalker.g)
echo.
echo --- TeamCity (CI) build options
echo I. TeamCity build menu
echo.

if exist %SYSTEMROOT%\System32\choice.exe ( goto prompt-choice )
goto prompt-set

:prompt-choice
choice /C:abcdefghi

if errorlevel 255 goto end
if errorlevel 9 goto teamcity-menu
if errorlevel 8 goto grammar
if errorlevel 7 goto build-release-package
if errorlevel 6 goto build-release
if errorlevel 5 goto build-debug
if errorlevel 4 goto build-test
if errorlevel 3 goto help-larger-window
if errorlevel 2 goto help-test-setup
if errorlevel 1 goto build-visual-studio
if errorlevel 0 goto end

:prompt-set
set /p OPT=[A, B, C, D, E, F, G, H, I]?

if /I "%OPT%"=="A" goto build-visual-studio
if /I "%OPT%"=="B" goto help-test-setup
if /I "%OPT%"=="C" goto help-larger-window
if /I "%OPT%"=="D" goto build-test
if /I "%OPT%"=="E" goto build-debug
if /I "%OPT%"=="F" goto build-release
if /I "%OPT%"=="G" goto build-release-package
if /I "%OPT%"=="H" goto grammar
if /I "%OPT%"=="I" goto teamcity-menu
goto prompt-set

:help-test-setup
echo.
echo 1. Install SQL Server 2008 (or use the database included with VS).
echo 2. Edit connection settings in build-common\nhibernate-properties.xml
echo.
echo 3. If you want to run NUnit tests in Visual Studio directly,
echo edit src\NHibernate.Test\App.config and change this property:
echo connection.connection_string
echo Note that you will need a third party tool to run tests in VS.
echo.
echo You will also need to create a database called "nhibernate"
echo if you just run the tests directly from VS.
echo.
goto end

:help-larger-window
echo.
echo 1. Right click on the title bar of this window.
echo 2. Select "Properties".
echo 3. Select the "Layout" tab.
echo 4. Set the following options.
echo Screen Buffer Size
echo Width: 160
echo Height: 9999
echo Window Size
echo Width: 160
echo Height: 50
echo.
goto end

:build-visual-studio
%NANT% visual-studio
goto end

:build-debug
%NANT% clean build
echo.
echo Assuming the build succeeded, your results will be in the build folder.
echo.
goto end

:build-release
%NANT% -D:project.config=release clean release
echo.
echo Assuming the build succeeded, your results will be in the build folder.
echo.
goto end

:build-release-package
%NANT% -D:project.config=release clean package
echo.
echo Assuming the build succeeded, your results will be in the build folder.
echo.
goto end

:build-test
%NANT% test
goto end

:grammar
echo.
echo --- GRAMMAR ---
echo A. Regenerate HqlLexer.cs and HqlParser.cs from Hql.g.
echo B. Regenerate HqlSqlWalker.cs from HqlSqlWalker.g.
echo C. Regenerate SqlGenerator.cs from SqlGenerator.g.
echo D. Regenerate Hql.g in debug mode.
echo E. Regenerate HqlSqlWalker.g in debug mode.
echo H. Quick instructions on using debug mode.
echo.

if exist %SYSTEMROOT%\System32\choice.exe ( goto grammar-prompt-choice )
goto grammar-prompt-set

:grammar-prompt-choice
choice /C:abcde

if errorlevel 255 goto end
if errorlevel 5 goto antlr-debug
if errorlevel 4 goto antlr-hqlsqlwalker-debug
if errorlevel 3 goto antlr-hql-debug
if errorlevel 2 goto antlr-hqlsqlwalker
if errorlevel 1 goto antlr-hql
if errorlevel 0 goto end

:grammar-prompt-set
set /p OPT=[A, B, C, D, E, H]?

if /I "%OPT%"=="A" goto antlr-hql
if /I "%OPT%"=="B" goto antlr-hqlsqlwalker
if /I "%OPT%"=="C" goto antlr-sqlgenerator
if /I "%OPT%"=="D" goto antlr-hql-debug
if /I "%OPT%"=="E" goto antlr-hqlsqlwalker-debug
if /I "%OPT%"=="H" goto antlr-debug
goto grammar-prompt-set

:antlr-hql
call src\NHibernate\Hql\Ast\ANTLR\AntlrHql.bat
goto end

:antlr-hqlsqlwalker
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalker.bat
goto end

:antlr-sqlgenerator
call src\NHibernate\Hql\Ast\ANTLR\AntlrSqlGenerator.bat
goto end

:antlr-hql-debug
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlDebug.bat
goto end

:antlr-hqlsqlwalker-debug
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalkerDebug.bat
goto end

:antlr-debug
echo To use the debug grammar:
echo 1. Create a unit test that runs the hql parser on the input you're interested in.
echo 2. Run the unit test. It will appear to stall.
echo 3. Download and run AntlrWorks.
echo 4. Choose "Debug Remote" and allow the default ports.
echo 5. You should now be connected and able to step through your grammar.
goto end

:teamcity-menu
echo.
echo --- TeamCity (CI) build options
echo A. NHibernate Trunk (default SQL Server)
echo B. NHibernate Trunk - Firebird (32-bit)
echo C. NHibernate Trunk - Firebird (64-bit)
echo D. NHibernate Trunk - SQLite (32-bit)
echo E. NHibernate Trunk - SQLite (64-bit)
echo F. NHibernate Trunk - PostgreSQL
echo.

if exist %SYSTEMROOT%\System32\choice.exe ( goto teamcity-menu-prompt-choice )
goto teamcity-menu-prompt-set

:teamcity-menu-prompt-choice
choice /C:abcdef

if errorlevel 255 goto end
if errorlevel 6 goto teamcity-postgresql
if errorlevel 5 goto teamcity-sqlite64
if errorlevel 4 goto teamcity-sqlite32
if errorlevel 3 goto teamcity-firebird64
if errorlevel 2 goto teamcity-firebird32
if errorlevel 1 goto teamcity-trunk
if errorlevel 0 goto end

:teamcity-menu-prompt-set
set /p OPT=[A, B, C, D, E, F]?

if /I "%OPT%"=="A" goto teamcity-trunk
if /I "%OPT%"=="B" goto teamcity-firebird32
if /I "%OPT%"=="C" goto teamcity-firebird64
if /I "%OPT%"=="D" goto teamcity-sqlite32
if /I "%OPT%"=="E" goto teamcity-sqlite64
if /I "%OPT%"=="F" goto teamcity-postgresql
goto teamcity-menu-prompt-set

:teamcity-trunk
%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1
goto end

:teamcity-firebird32
%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1 -D:config.teamcity=firebird32
goto end

:teamcity-firebird64
%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1 -D:config.teamcity=firebird64
goto end

:teamcity-sqlite32
%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1 -D:config.teamcity=sqlite32
goto end

:teamcity-sqlite64
%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1 -D:config.teamcity=sqlite64
goto end

:teamcity-postgresql
%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1 -D:config.teamcity=postgresql
goto end

:end
popd
pause
Something went wrong with that request. Please try again.