SolutionInfo.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (c) .NET Foundation. All rights reserved.
  2. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
  3. using System;
  4. using System.Collections.Generic;
  5. using System.IO;
  6. namespace RepoTasks.ProjectModel
  7. {
  8. internal class SolutionInfo
  9. {
  10. public SolutionInfo(string fullPath, string configName, IReadOnlyList<ProjectInfo> projects, bool shouldBuild, bool shipped)
  11. {
  12. if (string.IsNullOrEmpty(fullPath))
  13. {
  14. throw new ArgumentException(nameof(fullPath));
  15. }
  16. if (string.IsNullOrEmpty(configName))
  17. {
  18. throw new ArgumentException(nameof(configName));
  19. }
  20. Directory = Path.GetDirectoryName(fullPath);
  21. FullPath = fullPath;
  22. Directory = Path.GetDirectoryName(fullPath);
  23. ConfigName = configName;
  24. Projects = projects ?? throw new ArgumentNullException(nameof(projects));
  25. ShouldBuild = shouldBuild;
  26. Shipped = shipped;
  27. foreach (var proj in Projects)
  28. {
  29. proj.SolutionInfo = this;
  30. }
  31. }
  32. public string Directory { get; }
  33. public string FullPath { get; }
  34. public string Directory { get; }
  35. public string ConfigName { get; }
  36. public IReadOnlyList<ProjectInfo> Projects { get; }
  37. public bool ShouldBuild { get; }
  38. public bool Shipped { get; }
  39. }
  40. }