Skip to content

Instantly share code, notes, and snippets.

@Insire
Created August 8, 2017 17:38
Show Gist options
  • Select an option

  • Save Insire/87f7f581c2ce4aed9eb6a77cf5280ded to your computer and use it in GitHub Desktop.

Select an option

Save Insire/87f7f581c2ce4aed9eb6a77cf5280ded to your computer and use it in GitHub Desktop.
how to get the project output directories from a solution with cake
#addin Cake.Incubator
var target = Argument("target", "Default");
var solutionPath ="./WpfApp2.sln";
Task("Information")
.Does(()=>
{
Information("Parsing {0}",solutionPath);
var solution = ParseSolution(solutionPath);
foreach(var project in solution.Projects)
{
var customProject = ParseProject(project.Path, configuration: "Release", platform: "anyCPU");
Information(@"Name: {0}
Path: {1}
Id: {2}
Type: {3}
OutputPath: {4}",
project.Name,
project.Path.FullPath,
project.Id,
project.Type,
customProject.OutputPath
);
}
});
Task("Default").IsDependentOn("Information");
RunTarget(target);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment