cake-build/cake — pull request #43 by devlead (2014-06-24 15:29:10+00:00)
Title: Refactored NuGetPacker + Added NugetRestorer

1.Moved common nuget.exe functionality to NuGetResolver
2.Added NuGetRestorer - which adds extensions to restore soluton nuget dependencies
Example where solution is path to sln file:

var target = Argument("target", "Build");
var solution = Argument("solution", ".\src\test.sln");
var configuration = Argument("configuration", "Release");
var solutionDir = System.IO.Path.GetDirectoryName(solution);

Task("Clean")
.Does(() =>
{
// Clean directories.
CleanDirectories(solutionDir + "/**/bin/" + configuration);
CleanDirectories(solutionDir + "/**/obj/" + configuration);
});

Task("Restore")
.Does(() =>
{
NuGetRestore(solution,
settings=>settings.SetToolPath("C:/temp/priv/cakeTest/NuGet.exe")
.WithVerbosityDetailed());
});

Task("Build")
.IsDependentOn("Clean")
.IsDependentOn("Restore")
.Does(() =>
{
// Build project using MSBuild.
MSBuild(solution, settings =>
settings.SetPlatformTarget(PlatformTarget.MSIL)
.UseToolVersion(MSBuildToolVersion.NET45)
.WithTarget("Build")
.SetConfiguration(configuration));
});
RunTarget(target);