Running Tarantino With MSBuild

To set up Tarantino to run you follow the instructions from my last couple of posts.  Once you've done that, you set up a file to run the project.

This is how you set up your folder structure.

 Tarantino_FolderStructure

Under db are two folders, Create and Update. In MSBuild, all of the required files to run, plus my MSBuild file (tarantino.proj).

Here is how you set up a batch file to call MSBuild to run your database updates. This file is named dbdeploy.bat.

@echo on

SET DIR=%~d0%~p0%

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe "%DIR%msbuild\tarantino.proj" /t:default

pause

I included another file called dbdeploy.Create.bat to show how I override a property.

@echo on

SET DbAction=Create

SET DIR=%~d0%~p0%

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe "%DIR%msbuild\tarantino.proj" /t:default /p:DbAction=%DbAction%

pause

Here's the contents of the tarantino.proj file

Update ..\\db . test And the contents of the tarantino.targets file. Very small and to the point. It gives me the ability to make the call to ManageSqlDatabaseTask above. Here's a picture of the run. Isn't it pretty? :D [![Tarantino\_MSBuild](/images/robz/running-tarantino-with-msbuild/c8d5b14a-Tarantino_MSBuild_thumb_1.jpg)](/images/robz/running-tarantino-with-msbuild/14152a42-Tarantino_MSBuild_4.jpg) But what is reading versus trying? Download the code below and try this out for yourself! **Update:** I caught a small annoyance that occurs if you call msbuild and the path to the .proj has spaces in it (like C:\\Documents and Settings\\). When you download, surround the path in quotes (C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\msbuild.exe **"**%DIR%msbuild\\tarantino.proj**"** /t:default). **Update (29 MAR 2009)**: I fixed the download to have that path in it. [![kick it on DotNetKicks.com](http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fferventcoder.com%2farchive%2f2009%2f03%2f25%2frunning-tarantino-with-msbuild.aspx)](http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fferventcoder.com%2farchive%2f2009%2f03%2f25%2frunning-tarantino-with-msbuild.aspx)
This article is part of the GWB Archives. Original Author: Robz / Fervent Coder

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.