var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var solutions = GetFiles("./**/*.sln");
var solutionPaths = solutions.Select(solution => solution.GetDirectory());
.Description("Cleans all directories that are used during the build process.")
foreach(var path in solutionPaths)
Information("Cleaning {0}", path);
CleanDirectories(path + "/**/bin/" + configuration);
CleanDirectories(path + "/**/obj/" + configuration);
.Description("Restores all the NuGet packages that are used by the specified solution.")
foreach(var solution in solutions)
Information("Restoring {0}...", solution);
.Description("Builds all the different parts of the project.")
.IsDependentOn("Restore")
foreach(var solution in solutions)
Information("Building {0}", solution);
MSBuild(solution, settings =>
settings.SetPlatformTarget(PlatformTarget.MSIL)
.WithProperty("TreatWarningsAsErrors","true")
.SetConfiguration(configuration));
.Description("This is the default task which will be ran if no specific target is passed in.")