Skip to content

Commit 3831f9a

Browse files
jjonesczjonathanpeppers
authored andcommitted
Add Spectre.Console 0.52.0 (dotnet#1287)
Context: dotnet#1287 * Update spectre-console submodule to 0.52.0 * Add patch file to delete problematic binaries: dotnet#1287 (comment) Co-authored-by: Jan Jones <[email protected]>
1 parent 2f540e9 commit 3831f9a

36 files changed

+44879
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
[submodule "vs-solutionpersistence"]
2323
path = src/externalPackages/src/vs-solutionpersistence
2424
url = https://github.com/microsoft/vs-solutionpersistence.git
25+
[submodule "spectre-console"]
26+
path = src/externalPackages/src/spectre-console
27+
url = https://github.com/spectreconsole/spectre.console

eng/Versions.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<HumanizerReleaseVersion>2.14.1</HumanizerReleaseVersion>
1616
<MSBuildLocatorReleaseVersion>1.10.2</MSBuildLocatorReleaseVersion>
1717
<SolutionPersistenceVersion>1.0.52</SolutionPersistenceVersion>
18+
<SpectreConsoleReleaseVersion>0.52.0</SpectreConsoleReleaseVersion>
1819
</PropertyGroup>
1920
<PropertyGroup>
2021
<!-- NuGet dependencies -->
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 152b8a363213133fc3ec87e3abd6595ac98f0b57 Mon Sep 17 00:00:00 2001
2+
From: Jan Jones <[email protected]>
3+
Date: Mon, 7 Jul 2025 11:04:42 +0000
4+
Subject: [PATCH] Remove PolySharp
5+
6+
---
7+
src/Spectre.Console/Spectre.Console.csproj | 4 ----
8+
1 file changed, 4 deletions(-)
9+
10+
diff --git a/src/Spectre.Console/Spectre.Console.csproj b/src/Spectre.Console/Spectre.Console.csproj
11+
index bb56ec6..ddfa90e 100644
12+
--- a/src/Spectre.Console/Spectre.Console.csproj
13+
+++ b/src/Spectre.Console/Spectre.Console.csproj
14+
@@ -22,10 +22,6 @@
15+
<PackageReference Include="Wcwidth.Sources">
16+
<PrivateAssets>all</PrivateAssets>
17+
</PackageReference>
18+
- <PackageReference Include="PolySharp">
19+
- <PrivateAssets>all</PrivateAssets>
20+
- <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
21+
- </PackageReference>
22+
</ItemGroup>
23+
24+
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
25+
--
26+
2.34.1
27+

src/externalPackages/patches/spectre-console/0002-Remove-problematic-binary-files.patch

Lines changed: 12152 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<Project Sdk="Microsoft.Build.NoTargets">
2+
3+
<PropertyGroup>
4+
<PackagesOutput>$(ProjectDirectory)src/Spectre.Console/bin/$(Configuration)/</PackagesOutput>
5+
<GlobalJsonFile>$(ProjectDirectory)global.json</GlobalJsonFile>
6+
<CustomRepoBuild>true</CustomRepoBuild>
7+
</PropertyGroup>
8+
9+
<Target Name="CustomRepoBuild">
10+
<PropertyGroup>
11+
<BuildCommandArgs>$(ProjectDirectory)src/Spectre.Console/Spectre.Console.csproj</BuildCommandArgs>
12+
<BuildCommandArgs>$(BuildCommandArgs) /p:Configuration=$(Configuration)</BuildCommandArgs>
13+
<BuildCommandArgs>$(BuildCommandArgs) /v:$(LogVerbosity)</BuildCommandArgs>
14+
<BuildCommandArgs>$(BuildCommandArgs) $(RedirectRepoOutputToLog)</BuildCommandArgs>
15+
<BuildCommandArgs>$(BuildCommandArgs) /p:Version=$(SpectreConsoleReleaseVersion)</BuildCommandArgs>
16+
<BuildCommandArgs>$(BuildCommandArgs) /p:TargetFrameworks=$(NetCurrent)</BuildCommandArgs>
17+
<BuildCommandArgs>$(BuildCommandArgs) /p:UseBuildTimeTools=false</BuildCommandArgs>
18+
<BuildCommandArgs>$(BuildCommandArgs) /p:IsAotCompatible=false</BuildCommandArgs>
19+
</PropertyGroup>
20+
21+
<Exec Command="$(DotNetTool) restore /bl:$(ArtifactsLogRepoDir)restore.binlog $(BuildCommandArgs)"
22+
EnvironmentVariables="@(EnvironmentVariables)"
23+
WorkingDirectory="$(ProjectDirectory)"
24+
IgnoreStandardErrorWarningFormat="true" />
25+
26+
<Exec Command="$(DotNetTool) build /bl:$(ArtifactsLogRepoDir)build.binlog $(BuildCommandArgs)"
27+
EnvironmentVariables="@(EnvironmentVariables)"
28+
WorkingDirectory="$(ProjectDirectory)"
29+
IgnoreStandardErrorWarningFormat="true" />
30+
31+
<Exec Command="$(DotNetTool) pack /bl:$(ArtifactsLogRepoDir)pack.binlog $(BuildCommandArgs)"
32+
EnvironmentVariables="@(EnvironmentVariables)"
33+
WorkingDirectory="$(ProjectDirectory)"
34+
IgnoreStandardErrorWarningFormat="true" />
35+
</Target>
36+
37+
</Project>
Submodule spectre-console added at 3c21562
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0</TargetFrameworks>
5+
<PackageVersion>3.0.0</PackageVersion>
6+
<AssemblyName>Wcwidth.Sources</AssemblyName>
7+
</PropertyGroup>
8+
9+
</Project>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using System;
2+
3+
namespace Wcwidth
4+
{
5+
internal static class IntegerExtensions
6+
{
7+
public static bool Exist(this uint[,] table, uint value)
8+
{
9+
return Find(table, value) != 0;
10+
}
11+
12+
public static int Find(this uint[,] table, uint value)
13+
{
14+
if (table is null)
15+
{
16+
throw new ArgumentNullException(nameof(table));
17+
}
18+
19+
var min = 0;
20+
var max = table.GetUpperBound(0);
21+
int mid;
22+
23+
if (value < table[0, 0] || value > table[max, 1])
24+
{
25+
return 0;
26+
}
27+
28+
while (max >= min)
29+
{
30+
mid = (min + max) / 2;
31+
if (value > table[mid, 1])
32+
{
33+
min = mid + 1;
34+
}
35+
else if (value < table[mid, 0])
36+
{
37+
max = mid - 1;
38+
}
39+
else
40+
{
41+
return 1;
42+
}
43+
}
44+
45+
return 0;
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)