Skip to content

Instantly share code, notes, and snippets.

@Xeinaemm
Last active October 27, 2019 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xeinaemm/3bda8e7f4255ae6b69e7636670723f17 to your computer and use it in GitHub Desktop.
Save Xeinaemm/3bda8e7f4255ae6b69e7636670723f17 to your computer and use it in GitHub Desktop.
#addin "Cake.FileHelpers&version=3.2.0"
void Build(string root = "")
{
var solution = Argument<string>("Solution", "") != "" ?
new FilePath($"{root}{Argument<string>("Solution")}/{Argument<string>("Solution")}.sln") :
new FilePath(root + "BuildSolution.sln");
MSBuild(solution, settings => settings
.SetConfiguration(Argument<string>("Configuration", "Debug"))
.UseToolVersion(MSBuildToolVersion.VS2019)
.SetNoLogo(true)
.SetVerbosity(Verbosity.Quiet)
.WithConsoleLoggerParameter("ErrorsOnly")
.SetMaxCpuCount(0)
.SetNodeReuse(true)
.WithProperty("BuildInParallel", "true")
.WithProperty("CreateHardLinksForCopyFilesToOutputDirectoryIfPossible", "true")
.WithProperty("CreateHardLinksForCopyAdditionalFilesIfPossible", "true")
.WithProperty("CreateHardLinksForCopyLocalIfPossible", "true")
.WithProperty("CreateHardLinksForPublishFilesIfPossible", "true"));
}
Task("Build").Does(() => Build());
RunTarget(Argument<string>("Target", ""));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment