Tuesday, January 17, 2006

Moving from NAnt to Rake

Build scripts often contain both trivial and non-trivial tasks. Many of the non-trivial tasks can be completed easily by creating a ruby script to perform the complex logic. The new ruby script can be executed via a NAnt exec task.

If you are working with an existing NAnt script that is a burden to maintain consider converting the more complicated tasks into ruby scripts. When the majority of the complicated tasks are written in ruby it will make sense move the remaining tasks into a rakefile.

I used this approach recently at a client site. Whenever the NAnt tasks needed updating we converted them to a ruby script. When we finally decided to make the move to rake exclusively it took less than an hour to convert the remaining tasks. The resulting rakefile was about 1/2 as long. Additionally, the team agreed that the resulting rakefile was significantly more readable and maintainable.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.