Skip to content

Instantly share code, notes, and snippets.

@iBener
Created February 24, 2023 13:16
Show Gist options
  • Save iBener/24286164587de9c100d1f8444cb86ea6 to your computer and use it in GitHub Desktop.
Save iBener/24286164587de9c100d1f8444cb86ea6 to your computer and use it in GitHub Desktop.
public class Compiler
{
/// <summary>
/// Compile all the projects of the solution
/// </summary>
public void Compile(Solution solution)
{
foreach (var project in solution.Projects)
{
Compile(project);
}
}
/// <summary>
/// Compile the project and its dependencies. It also recursively compile all the dependencies of the project
/// </summary>
public void Compile(Project project)
{
foreach (var dependencyProject in project.ProjectDependencies)
{
Compile(dependencyProject);
}
if (!project.IsBuild)
{
project.Build();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment