-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
11 changed files
with
98 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.Json; | ||
using System.Text.RegularExpressions; | ||
using Amusoft.DotnetNew.Tests.Interfaces; | ||
using Amusoft.DotnetNew.Tests.Templating; | ||
|
||
namespace Amusoft.DotnetNew.Tests.Diagnostics; | ||
|
||
internal class BuildResult( | ||
string command, | ||
string content | ||
) : ICommandResult | ||
{ | ||
private static readonly Regex Regex = new("-> (?<dll>.+?\\.dll)", RegexOptions.Compiled); | ||
|
||
private IEnumerable<string> GetDlls() | ||
{ | ||
var replace = content.Replace("/u003E",">"); | ||
var matchCollection = Regex.Matches(replace); | ||
return matchCollection | ||
.Select(d => d.Groups["dll"].Value.Replace("//","/")) | ||
.OrderBy(d => d); | ||
} | ||
|
||
public void Print(StringBuilder stringBuilder) | ||
{ | ||
var serializeContent = new | ||
{ | ||
Command = command, | ||
Files = GetDlls(), | ||
}; | ||
var serialized = JsonSerializer.Serialize(serializeContent,new JsonSerializerOptions() | ||
{ | ||
WriteIndented = true | ||
} | ||
); | ||
|
||
stringBuilder.Append(TemplatingDefaults.Instance.PrintPattern("BuildResult", serialized)); | ||
} | ||
} |
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 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
12 changes: 12 additions & 0 deletions
12
...oft.DotnetNew.Tests.UnitTests/Snapshots/CommandResultTests.VerifyBuildResult.verified.txt
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,12 @@ | ||
---BuildResult--- | ||
|
||
{ | ||
"Command": "cli args", | ||
"Files": [ | ||
"C:\\Users\\A\\AppData\\Local\\Temp\\6e95ba419fa843259d960d2c4f9c4d18\\src\\Project1\\bin\\Debug\\net6.0\\Project1.dll", | ||
"C:\\Users\\A\\AppData\\Local\\Temp\\6e95ba419fa843259d960d2c4f9c4d18\\src\\Project1\\bin\\Debug\\netstandard2.0\\Project1.dll", | ||
"C:\\Users\\A\\AppData\\Local\\Temp\\6e95ba419fa843259d960d2c4f9c4d18\\tests\\Project1.IntegrationTests\\bin\\Debug\\net6.0\\Project1.IntegrationTests.dll", | ||
"C:\\Users\\A\\AppData\\Local\\Temp\\6e95ba419fa843259d960d2c4f9c4d18\\tests\\Project1.UnitTests\\bin\\Debug\\net6.0\\Project1.UnitTests.dll" | ||
] | ||
} | ||
|
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