// Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Collections.Generic; using System.Linq; namespace Microsoft.DotNet.Tools.Build { internal class CompilerIO { public readonly IEnumerable Inputs; public readonly IEnumerable Outputs; public CompilerIO(IEnumerable inputs, IEnumerable outputs) { Inputs = inputs; Outputs = outputs; } public DiffResult DiffInputs(CompilerIO other) { var myInputSet = new HashSet(Inputs); var otherInputSet = new HashSet(other.Inputs); var additions = myInputSet.Except(otherInputSet); var deletions = otherInputSet.Except(myInputSet); return new DiffResult(additions, deletions); } internal class DiffResult { public IEnumerable Additions { get; private set; } public IEnumerable Deletions { get; private set; } public DiffResult(IEnumerable additions, IEnumerable deletions) { Additions = additions; Deletions = deletions; } } } }