|
|
|
@ -51,16 +51,17 @@ public class SolutionFileModifier : ITransientDependency |
|
|
|
|
|
|
|
private async Task AddModuleAsync(ModuleWithMastersInfo module, string solutionFile) |
|
|
|
{ |
|
|
|
var slnDir = Path.GetDirectoryName(solutionFile); |
|
|
|
var projectsUnderModule = Directory.GetFiles( |
|
|
|
Path.Combine(Path.GetDirectoryName(solutionFile), "modules", module.Name), |
|
|
|
Path.Combine(slnDir, "modules", module.Name), |
|
|
|
"*.csproj", |
|
|
|
SearchOption.AllDirectories); |
|
|
|
|
|
|
|
var projectsUnderTest = new List<string>(); |
|
|
|
if (Directory.Exists(Path.Combine(Path.GetDirectoryName(solutionFile), "modules", module.Name, "test"))) |
|
|
|
if (Directory.Exists(Path.Combine(slnDir, "modules", module.Name, "test"))) |
|
|
|
{ |
|
|
|
projectsUnderTest = Directory.GetFiles( |
|
|
|
Path.Combine(Path.GetDirectoryName(solutionFile), "modules", module.Name, "test"), |
|
|
|
Path.Combine(slnDir, "modules", module.Name, "test"), |
|
|
|
"*.csproj", |
|
|
|
SearchOption.AllDirectories).ToList(); |
|
|
|
} |
|
|
|
@ -68,11 +69,9 @@ public class SolutionFileModifier : ITransientDependency |
|
|
|
foreach (var projectPath in projectsUnderModule) |
|
|
|
{ |
|
|
|
var folder = projectsUnderTest.Contains(projectPath) ? "test" : "src"; |
|
|
|
|
|
|
|
var projectId = Path.GetFileName(projectPath).Replace(".csproj", ""); |
|
|
|
var package = @$"modules\{module.Name}\{folder}\{projectId}\{projectId}.csproj"; |
|
|
|
|
|
|
|
_cmdHelper.RunCmd($"dotnet sln \"{solutionFile}\" add \"{package}\" --solution-folder {folder}", workingDirectory: Path.GetDirectoryName(solutionFile)); |
|
|
|
var package = Path.Combine(slnDir, "modules", module.Name, folder, projectId, $"{projectId}.csproj"); |
|
|
|
_cmdHelper.RunCmd($"dotnet sln \"{solutionFile}\" add \"{package}\" --solution-folder {folder}", workingDirectory: slnDir); |
|
|
|
} |
|
|
|
|
|
|
|
if (module.MasterModuleInfos != null) |
|
|
|
|