|
|
|
@ -14,6 +14,8 @@ namespace Volo.Abp.Cli.Build |
|
|
|
public List<string> Build(List<DotNetProjectInfo> projects, int maxParallelBuildCount, string arguments) |
|
|
|
{ |
|
|
|
var builtProjects = new ConcurrentBag<string>(); |
|
|
|
var totalProjectCountToBuild = GetTotalProjectCountToBuild(projects); |
|
|
|
var buildingProjectIndex = 0; |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
@ -24,6 +26,13 @@ namespace Volo.Abp.Cli.Build |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
buildingProjectIndex++; |
|
|
|
|
|
|
|
Console.WriteLine( |
|
|
|
"Building....: " + " (" + buildingProjectIndex + "/" + |
|
|
|
totalProjectCountToBuild + ")" + project.CsProjPath |
|
|
|
); |
|
|
|
|
|
|
|
BuildInternal(project, arguments, builtProjects); |
|
|
|
|
|
|
|
if (!project.Dependencies.Any()) |
|
|
|
@ -38,6 +47,13 @@ namespace Volo.Abp.Cli.Build |
|
|
|
{ |
|
|
|
if (!builtProjects.Contains(project.CsProjPath)) |
|
|
|
{ |
|
|
|
buildingProjectIndex++; |
|
|
|
|
|
|
|
Console.WriteLine( |
|
|
|
"Building....: " + " (" + buildingProjectIndex + "/" + |
|
|
|
totalProjectCountToBuild + ")" + project.CsProjPath |
|
|
|
); |
|
|
|
|
|
|
|
BuildInternal(projectDependency, arguments, builtProjects); |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -51,10 +67,17 @@ namespace Volo.Abp.Cli.Build |
|
|
|
return builtProjects.ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
private int GetTotalProjectCountToBuild(List<DotNetProjectInfo> projects) |
|
|
|
{ |
|
|
|
var mainCsProjPaths = projects.Select(e => e.CsProjPath).ToList(); |
|
|
|
var dependingCsProjPaths = projects.SelectMany(e => e.Dependencies).Select(e => e.CsProjPath).ToList(); |
|
|
|
return mainCsProjPaths.Union(dependingCsProjPaths).Distinct().Count(); |
|
|
|
} |
|
|
|
|
|
|
|
private void BuildInternal(DotNetProjectInfo project, string arguments, ConcurrentBag<string> builtProjects) |
|
|
|
{ |
|
|
|
var buildArguments = arguments.TrimStart('"').TrimEnd('"'); |
|
|
|
Console.WriteLine("Building...: dotnet build " + project.CsProjPath + " " + buildArguments); |
|
|
|
Console.WriteLine("Executing...: dotnet build " + project.CsProjPath + " " + buildArguments); |
|
|
|
|
|
|
|
var output = CmdHelper.RunCmdAndGetOutput( |
|
|
|
"dotnet build " + project.CsProjPath + " " + buildArguments, |
|
|
|
|