Assertfail

All Posts assertfail

View the Blog on GitHub wallymathieu

Build tools and package managers for .net

27 Aug 2015

What criteria do I use

I prefer for the build tool to work on both *nix and windows. I do some of the .net coding on os x. The build systems mentioned here are all related to working with .net (and all except psake work in *nix).

If you are coding .net

What package manager to use?

Right now there is NuGet. There is no good reason why you should deviate from using that format. However, you can choose to use NuGet.exe, NuGet in visual studio with packages.config files or use paket with ‘paket’ files.

Paket assumes that you want to have the same version of a package in all your projects in a solution. There is also a bootstrapper so that you don’t need to install NuGet.exe on you build environment or add it to the repository (the paket.bootstrapper is only 27.5KB). Paket and FAKE makes a nice package (an example can be found here).

What build tool to use?

I would generally unless there is some good reason avoid writing msbuild files. They are better suited to describe projects (csproj).

Gulp it’s Grunt

Since there is a lot of tools available for web developers that leverage grunt, many .net developers use grunt. It works, the api is a bit odd (json can be used to configure tasks). If you code js for other reasons, then the callbacks will probably not bother you. Note that there is another js build tool called gulp. Gulp is smaller and more focused on streaming builds (if you have looked at the ideas from reactive extensions you will find it familiar).

I’ve tried to use grunt. Node is quite easy to install on windows.

Rake

I prefer to use ruby’s make like tool rake for building open source c# apps since I usually have ruby installed wherever I work. Rake has some nice syntax that looks quite clean. It requires you to know some ruby though.

Usually when using ruby you will want to use bundler to manage dependencies.

Faking it?

Fake is a build tool where you write f# scripts. For f#-project this feels like a nice way to go. Fake is delivered by NuGet (so you won’t need anything extra installed). It requires you to know some f#.

It works well under mono. I’ve not had any troubles with it.

The syntax is a bit unfamiliar, but that can be the case with f# written APIs (using operators like ==> or  »=).

PSake

Writing build scripts in powershell. This makes a lot of sense. Many times when you write build scripts, you are scripting windows servers as well; so you will have some experience using powershell. However, powershell is a bit of an odd language compared to many other common languages.

If you are doing windows only work, then this tool is valid.

The Cake is alive?

There are many different c# build tools. The most popular right now looks to be Cake. You don’t have to install cscript in order to Cake or Nake, but can download a .net exe from NuGet. You can use this exe to execute build script files. Sake is installed via chocolatey. Cake-files are actually a different language: a superset of c#. This means that visual studio and monodevelop etc wont work as expected. It will let you write build scripts in a c#-y syntax.

Tags

  • rake
  • paket
  • gulp
  • grunt
  • fake
  • Comments or errors? Fork post and do a pull request on github