// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; namespace RepoTools.BuildGraph { [DebuggerDisplay("{Name}")] public class Repository : IEquatable { public Repository(string name) { Name = name; } public string Name { get; private set; } public string RootDir { get; set; } public IList Projects { get; } = new List(); public IList SupportProjects { get; } = new List(); public IEnumerable AllProjects => Projects.Concat(SupportProjects); public bool Equals(Repository other) => string.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase); public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Name); } }