- | rssFeed | My book on MSBuild and Team Build | Archives and Categories Tuesday, October 16, 2007

Sedodream Relase: MSBuild Linq Tasks

I’ve created a new release of MSBuild tasks, at www.codeplex.com/sedodream. This release includes 4 .NET 3.5 tasks built on Visual Studio B2. Those are all Linq MSBuild tasks. They are:

Name

Description

CreateLinqCode

Creates a Linq code file from a database.

CreateLinqDbml

Creates a Linq DBML file from a database.

CreateLinqMap

Creates a Linq Map file from a database.

CreateDatabase

Creates a database from an Linq DataContext which is contained in an assembly.


The first three tasks simply wrap the SqlMetal command line utility. The last, CreateDatabse, will create a database from a Linq DataContext that is contained in an assembly. Right now there is little validation of the parameters passed, but I plan on adding additional validation. Also I will add more meaningful error messages, when invalid parameters are passed through.

Below you’ll find an example of the CreateLinqCode task.

<?xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="3.5" DefaultTargets="Create" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <Import Project="$(MSBuildExtensionsPath)\Sedodream\Sedodream35.tasks"/>

  <Target Name="Create">

    <!-- sqlmetal /pluralize

              /conn:"data source=(local);initial catalog=ibrtest;integrated security=SSPI;packet size=4096"

              /timeout:15

              /language:C#

              /context:IbrTestDataContext

              /code:ibrtest.cs

              /views

              /functions

              /sprocs

              /serialization:Unidirectional

              /namespace:Sedodream.Linq.Test

              -->

    <CreateLinqCode

      CodeFileName="ibrahimTest.cs"

     

      ConnectionString="data source=(local);initial catalog=ibrtest;integrated security=SSPI;packet size=4096"

      Timeout="15"

      Language="C#"

      ContextClassName="IbrTestDataContext"

      IncludeViews="true"

      IncludeSprocs="true"

      IncludeFunctions="true"

      TargetNamespace="Sedodream.Linq.Test"

      >

    </CreateLinqCode>

</Target>

</Project>

Here is the CreateLinqDbml task usage.

<?xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="3.5" DefaultTargets="Create" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <Import Project="$(MSBuildExtensionsPath)\Sedodream\Sedodream35.tasks"/>

  <Target Name="Create">

<!-- sqlmetal /pluralize

              /conn:"data source=(local);initial catalog=ibrtest;integrated security=SSPI;packet size=4096"

              /timeout:15

              /language:C#

              /context:IbrTestDataContext

              /dbml:../LinqObjects\ibrtest.dbml

              /views

              /functions

              /sprocs

              /serialization:Unidirectional

              /namespace:Sedodream.Linq.Test

              -->

    <CreateLinqDbml

      DbmlFileName="ibrahimTest.dbml"

      OutDir="."

      ConnectionString="data source=(local);initial catalog=ibrtest;integrated security=SSPI;packet size=4096"

      Timeout="15"

      Language="C#"

      ContextClassName="IbrTestDataContext"

      IncludeViews="true"

      IncludeSprocs="true"

      IncludeFunctions="true"

      TargetNamespace="Sedodream.Linq.Test"

      >

    </CreateLinqDbml>

  </Target> 

</Project>

 

Please let me know if you have any questions/comments about these items.

Sayed Ibrahim Hashimi

msbuild | Sedodream MSBuild Project | Visual Studio Tuesday, October 16, 2007 12:50:48 AM (GMT Daylight Time, UTC+01:00)  #     | 
Wednesday, June 27, 2007

MSBuild log4net logger

Ok, I know there are many MSBuild loggers available so why create a new one? Because for a while I’ve been thinking that it would be cool to have a logger that would transform an MSBuild log into a log4net log. This is because obviously log4net has many appenders and tools that you can use out of the box. For example if you wanted to put your logs into a database, then attach the AdoNetAppender. Because of this, and because I couldn’t already find one, I wrote one. You can find it on my Sedodream MSBuild project. This logger is called SedoLogger. I figured this would be a good name, in the case that later on I wanted to abstract out the specific logging mechanism behind it. I have just created a new release that contains all the necessary files. I have posted some usage information about this logger on the SedoLogger WiKi page. I’ll be posting some more details about this logger here in the near future.

Sayed Ibrahim Hashimi

msbuild | Sedodream MSBuild Project | Visual Studio Wednesday, June 27, 2007 6:09:10 AM (GMT Daylight Time, UTC+01:00)  #     | 
Monday, February 19, 2007

Using MSBuild & WiX to automate build and release

I’ve got a new article titled “WiX Tricks: Automate Releases With MSBuild And Windows Installer XML”. This article covers in detail how to create an automated build & release process using MSBuild & the Windows Installer Xml Toolset. Not only does it describe how to achieve an automated process, but I actually provide you will an extensible set of MSBuild files that can be used to easily do it for you! If you are already using WiX to create your installation packages then integrating my targets into your process should be very straight forward. You can download all the sources from article site, but you may be better off getting it from my Sedodream MSBuild project site. I’ll be maintaining the files on that site, so it is better to get the latest directly from there. If you do use my targets, please let me know what your experiences are. I’ll be continuing to expand on those and your feedback is important.  One of the items that are pretty important for me is to integrate Install Shield installations into this process. I’ve created an internal process to do this for me, but it is not re-usable as the WiX ones are. Soon I hope to be able to complete this.

Also in this article I do cover some more advanced MSBuild topics such as MSBuild batching in pretty good detail. As far as I know this is the only published article that covers batching in any kind of detail.

 

Sayed Ibrahim Hashimi

msbuild | Sedodream MSBuild Project | WiX Monday, February 19, 2007 3:15:58 AM (GMT Standard Time, UTC+00:00)  #     | 
Wednesday, November 22, 2006

Sedodream MSBuild Project MSI

Just wanted to let everyone know that my Sedodream MSBuild Project now has an MSI that can be downloaded. You can find that latest downloads at http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=Sedodream. The installer will place all MSBuild tasks in the %Program Files%\MSBuild\Sedodream directory. In your MSBuild project files you  can refer to this location as $(MSBuildExtensionsPath)\Sedodream\.

Here is a list of what is currently included in the project

Tasks Included

Name

Description

AddMetadata

Allows you to add metadata to an item

FindUnder

Finds and returns all directories (empty or not) under a specified path

GetDate

Returns a string representation of the date in a specified format

GetRegKey

Returns the value of a registry key

Move

Task to move a file (or set of files)

NUnitTask

Task to run NUnit test cases as a part of the build process

TempFile

Returns the path to a new temporary file

ReplaceInFile

Can be used to replace specified text in a file.

GetExternalIp

Can be used to determine the external IP address of the executing machine

GetInternalIp

Can be used to determine all the Internal IP addresses of the executing machine

Loggers Included

Name

Description

EmailLogger

An MSBuild logger capable of emailing the resulting log

SimpleFileLogger

A simple MSBuild file based logger

XmlLogger

An MSBuild logger which creates an Xml file

Sayed Ibrahim Hashimi

msbuild | Visual Studio | Sedodream MSBuild Project Wednesday, November 22, 2006 3:14:56 AM (GMT Standard Time, UTC+00:00)  #     |