Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 273 lines (233 sloc) 8.479 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 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
@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 all grammars.
echo Hql.g to HqlLexer.cs
echo Hql.g to HqlParser.cs
echo HqlSqlWalker.g to HqlSqlWalker.cs
echo SqlGenerator.g to SqlGenerator.cs
echo B. Regenerate all grammars, with Hql.g in debug mode.
echo C. Regenerate all grammars, with HqlSqlWalker.g in debug mode.
echo D. Regenerate all grammars, with SqlGenerator.g in debug mode.
echo E. 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-sqlgenerator-debug
if errorlevel 3 goto antlr-hqlsqlwalker-debug
if errorlevel 2 goto antlr-hql-debug
if errorlevel 1 goto antlr-all
if errorlevel 0 goto end

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

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

:antlr-all
echo *** Regenerating from Hql.g
call src\NHibernate\Hql\Ast\ANTLR\AntlrHql.bat
echo *** Regenerating from HqlSqlWalker.g
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalker.bat
echo *** Regenerating from SqlGenerator.g
call src\NHibernate\Hql\Ast\ANTLR\AntlrSqlGenerator.bat
goto end

:antlr-hql-debug
echo *** Regenerating from Hql.g (Debug Enabled)
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlDebug.bat
echo *** Regenerating from HqlSqlWalker.g
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalker.bat
echo *** Regenerating from SqlGenerator.g
call src\NHibernate\Hql\Ast\ANTLR\AntlrSqlGenerator.bat
goto end

:antlr-hqlsqlwalker-debug
echo *** Regenerating from Hql.g
call src\NHibernate\Hql\Ast\ANTLR\AntlrHql.bat
echo *** Regenerating from HqlSqlWalker.g (Debug Enabled)
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalkerDebug.bat
echo *** Regenerating from SqlGenerator.g
call src\NHibernate\Hql\Ast\ANTLR\AntlrSqlGenerator.bat
goto end

:antlr-sqlgenerator-debug
echo *** Regenerating from Hql.g
call src\NHibernate\Hql\Ast\ANTLR\AntlrHql.bat
echo *** Regenerating from HqlSqlWalker.g
call src\NHibernate\Hql\Ast\ANTLR\AntlrHqlSqlWalker.bat
echo *** Regenerating from SqlGenerator.g (Debug Enabled)
call src\NHibernate\Hql\Ast\ANTLR\AntlrSqlGeneratorDebug.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 The one you want to debug must be the first grammar parsed.
echo 2. Run the unit test. It will appear to stall.
echo 3. Download and run AntlrWorks (java -jar AntlrWorks.jar).
echo 4. Open the grammar you intend to debug in AntlrWorks.
echo 5. Choose "Debug Remote" and accept the default port.
echo 6. 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 G. NHibernate Trunk - Oracle (32-bit)
echo.

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

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

if errorlevel 255 goto end
if errorlevel 7 goto teamcity-oracle32
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, G]?

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
if /I "%OPT%"=="G" goto teamcity-oracle32
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

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

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