Cake MSBuild setting properties

Viewed 5698

I have a batch file that I am trying to replicate with Cake (C# Make). It makes a call to MSBuild with a few properties. Here is the line from the batch;

"%MSBuildPath%msbuild.exe" ..\public\projectToBeBuilt.sln /t:Rebuild /p:Configuration=RELEASE;platform=%platform% /maxcpucount:%cpucount% /v:%verboselevel%

These are the properties I need to set. I think its something like this;

MSBuild(@"..\public\projectToBeBuilt.sln", s=> s.SetConfiguration("Release")
    .UseToolVersion(MSBuildToolVersion.Default)
    .WithProperty("Verbosity", Verbosity)
    .WithProperty("MaxCpuCount", cpuCount)
    .WithProperty("Platform", "x64")
    .WithProperty("OutDir", buildDir));

I'm having trouble making this work. I think it may be something to do with how I'm designating the cpu count. I also cant find any way to set it to Rebuild, the way the batch does it.

1 Answers
Related