-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matthew Asplund
committed
Dec 24, 2024
1 parent
eccacde
commit a461dc2
Showing
11 changed files
with
87 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// <copyright file="SourceSetUtilities.cs" company="Soup"> | ||
// Copyright (c) Soup. All rights reserved. | ||
// </copyright> | ||
|
||
using System.Collections.Generic; | ||
using Path = Opal.Path; | ||
|
||
namespace Soup.Build.Discover; | ||
|
||
public static class SourceSetUtilities | ||
{ | ||
/// <summary> | ||
/// Add a new source path and cleanup sub folders | ||
/// </summary> | ||
public static void Add(HashSet<Path> sourceSet, Path value) | ||
{ | ||
bool isIncluded = false; | ||
var current = value; | ||
while (true) | ||
{ | ||
if (sourceSet.Contains(current)) | ||
{ | ||
isIncluded = true; | ||
break; | ||
} | ||
|
||
var next = current.GetParent(); | ||
if (current == next) | ||
break; | ||
|
||
current = next; | ||
} | ||
|
||
if (!isIncluded) | ||
{ | ||
// TODO: Remove already added values that this folder contains | ||
_ = sourceSet.Add(value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters