Introducing the realfiction builder...MsBuild without XML

I have previously talked about using rake for building .NET apps. While I do like ruby, I’m not a big fan of the whole idea. It takes time to set up the correct environment, problems no .NET developer is aware of lurk around corners. If you want to learn ruby, that’s fine. But do you want to learn a language just to get some build scripts going?

On the other hand I can understand if you can’t stand XML anymore. I’d go as far as saying that you need to have loved something to truly hate it. Which is why I kicked off rfb. The realfiction builder parses a syntax that is much lighter on the eye, but nonetheless gives you access to the MsBuild capabilities (well, currently not all, but it does run the Rf.Sites build script). The syntax is fairly self-explanatory. Nonetheless here a small introduction:

Project "Default"
  UsingTask -TaskName:ATask -AssemblyFile:lib/SomeAssembly.dll
  // This variable controls the forces of evil
  $Foo = Bar Baz
  Target "Default" -Depends:Deps
    // This one a dir will be made of.
    $bar = Bang Bop
    @stuff = $(iisOutDir)\**\*.*
    MakeDir "This_$(bar).plonk"

This is the same as:

<?xml version="1.0" encoding="utf-16"?>
<Project DefaultTargets="Default" xmlns="">
    <Foo>Bar Baz</Foo>
  <UsingTask TaskName="ATask" AssemblyFile="lib/SomeAssembly.dll" />
  <Target Name="Default" DependsOnTargets="Deps">
    <CreateProperty Value="Bang Bop">
      <Output TaskParameter="Value" PropertyName="bar" />
    <CreateItem Include="$(iisOutDir)\**\*.*">
      <Output TaskParameter="Include" ItemName="stuff" />
    <MakeDir Directories="This_$(bar).plonk" />

Let me ask you. Which one is easier to read? Which one is easier to write?

A few words about the syntax:

A first version to play with is available here. The whole thing compiles into an exe of 37 KB (Compare to my roughly 40MB of my current ruby installation). A lot of stuff is still missing, but if there’s interest out there, I’ll keep adding to it.


The currently supported syntax will be documented here.