Dec 2 2008

My tool belt

image

Earlier this fall I was tagged by Gøran Hansen. He wondered what tools I use besides Visual Studio. Here is my response to his post:

Addins:

- ReShaper (How can you program without this one?)
- Testdriven.NET (Great addin, but I don't use it much because of ReSharpers possibilities to run unit tests.)
- GhostDoc

Developer tool belt:
- NUnit (I know there are many frameworks out there, but this is a safe one that "everything" supports)
- Moq (mocking framework --> If you haven't looked at this framework, you should!)
- Tortoise SVN (code repository)
- Git (local code repository. I normally use this as a "shelf" for SVN.)
- CruiseControl.NET
- Team City (I really like this one. I don't like XML hacking :-) )
- MSBuild
- Nant
- RhinoMocks (Great framework, but maybe not so intuitive?)

Well, there's my list.
Do you have suggestions to tools I should look into?

Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Sep 29 2008

This is the way I version most projects

I understand that Microsoft uses this template when versioning their products: Major.Minor.Build.Revision. Major is changed when the "developers" want to show that there is a big change in the software and backward compatibility cannot be assumed. Maybe a major rewrite of the code is done. Minor number represents a significant enhancement with the intention of backward compatibility. Build number is a small change, for example a recompilation of the same source. Revision is used to fix a security hole and should be fully interchangeable. Both Build and Revision are optional. This information is based on MSDN Version Class.

The way I version most projects is the same way that Microsoft does, but I increase the Build and Revision each time I build the project. The build number is created this way: MMdd. MM is number of months since the project started and dd is the rest in days. A project started yesterday (25.09.2008) will have this build number to day: 0001. Revision is created this way: HHmm. HH is the hour of the day, and mm is the minute of the hour. It will for example show like this: 1302.
Major and Minor is used much the same as Microsoft suggests. A beta product will have a zero as the Major number.
I often use MSBuild as the build scripting language and I have created a MSBuild task for increasing the build number and revision. It can be downloaded from the link below.

To use it you have to add these lines to your MSBuild file:

<UsingTask TaskName="TFTasks.TFBuildNumber" 
    AssemblyFile="$(MSBuildStartupDirectory)\tools\treefrog.tasks\TFTasks.dll"/>
<UsingTask TaskName="TFTasks.TFRevisionNumber" 
    AssemblyFile="$(MSBuildStartupDirectory)\tools\treefrog.tasks\TFTasks.dll"/> 


And use the task by doing something like this:

<TFBuildNumber StartDate="09.09.08">
  <Output TaskParameter="BuildNum" PropertyName="buildNumber"/>
</TFBuildNumber>
<TFRevisionNumber>
  <Output TaskParameter="RevisionNum" PropertyName="revisionNumber"/>
</TFRevisionNumber> 


You can then update your AssemblyInfo file by doing something like this:

<Target Name="SetVersionInfo" DependsOnTargets="SetTimeStamp" >
  <Attrib Files="@(AssemblyInfoFiles)" Normal="true" />
  <FileUpdate Files="@(AssemblyInfoFiles)"
     Regex="AssemblyFileVersion\(&quot;.*&quot;\)\]"
     ReplacementText="AssemblyFileVersion(&quot;
     $(Major).$(Minor).$(buildNumber).$(revisionNumber)&quot;)]" />
</Target> 

To get this running, you also need to use the MSBuild Community Tasks. It can be downloaded from tigris.

I posted a question on StackOverflow and asked how people version their projects.
The answers can be found here.

How do you version your projects?

 

TFTasks-1.0.0927.0.zip (2.48 kb)

Tags: ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Sep 22 2008

TeamCity 3.1 tip

Category: Software | Testing | Continuous Integrationfossmo @ 17:42

I have used Cruise Control from ThoughtWorks at my CI server for a long time. CC.NET is a very good tool, but you have to spend a lot of time messing around with XML and tasks. It's time consuming. I have heard a lot of positive things about TeamCity from Jetbrains, so I figured that I wanted to try it. And, yes Jetbrains is the same company that makes ReSharper. A wonderful tool. I started out installing TeamCity on my server, and everything went like a breeze. I had my test project up and running within 10 minutes. Very easy configuration due to the web GUI. All good, BUT MY TESTS DID NOT RUN! I searched the Internet and could not find a good answer to why the tests did not run. I finally started to look at my build file, and it turns out that I imported my MSBuild community tasks this way:

image

This makes TeamCity very sad, and it won't display the test results. What TeamCity accepts is this:

image

So, the tip is: stay away from importing your tasks by using <UsingTask> tag, and rather use <Import>.

Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5