Skip to content

Add Spectre.Console latest (0.48.0) to Source Build #244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
[submodule "abstractions-xunit"]
path = src/abstractions-xunit
url = https://github.com/xunit/abstractions.xunit
[submodule "src/spectre-console"]
path = src/spectre-console
url = https://github.com/spectreconsole/spectre.console
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From ad9eef0f848288b6fdc23c93e6e90f367d62c361 Mon Sep 17 00:00:00 2001
From: baronfel <chusk3@gmail.com>
Date: Mon, 18 Dec 2023 14:09:06 -0600
Subject: [PATCH] wip

---
src/Directory.Build.props | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 6bf853f..59c8130 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -31,7 +31,7 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

- <ItemGroup Label="Package References">
+ <!-- <ItemGroup Label="Package References">
<PackageReference Include="MinVer" PrivateAssets="All" Version="4.2.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Version="1.1.1" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
@@ -40,5 +40,5 @@
<PackageReference Include="Roslynator.Analyzers" Version="4.1.2">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
- </ItemGroup>
+ </ItemGroup> -->
Comment on lines +19 to +28
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need these analyzers or build-time dependencies in the source-build build of Spectre.Console because they mainly exist to check logic and set versions.

We don't need to check logic here (we're assuming upstream is generally good), and we know the version of Spectre we're building (it's set in the repro-projects wrapper project) so we can skip all of these dependencies outright.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, I am wondering if it would be feasible to introduce a conditional based on a property that source-build could then set? If so this change could be pushed upstream. The advantage of this is it would eliminate the need for this patch and the potential maintenance burden of it.

</Project>
\ No newline at end of file
--
2.40.1

38 changes: 38 additions & 0 deletions repo-projects/spectre-console.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<PackagesOutput>$(ProjectDirectory)/src/Spectre.Console/bin/$(Configuration)/</PackagesOutput>
<SpectreConsolePackageVersion>0.48.0</SpectreConsolePackageVersion>
</PropertyGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

<Target Name="RepoBuild">
<PropertyGroup>
<BuildCommandArgs>$(ProjectDirectory)/src/Spectre.Console/Spectre.Console.csproj</BuildCommandArgs>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only take the main project - the Spectre analyzers aren't required, and we're not currently planning on using any functionality from the minor extensions packages that Spectre provides.

<BuildCommandArgs>$(BuildCommandArgs) /p:Configuration=$(Configuration)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /v:$(LogVerbosity)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) $(RedirectRepoOutputToLog)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:Version=$(SpectreConsolePackageVersion)</BuildCommandArgs>
<BuildCommandArgs>$(BuildCommandArgs) /p:TargetFrameworks=$(NetCurrent)</BuildCommandArgs>
</PropertyGroup>

<Exec Command="$(DotnetToolCommand) restore /bl:restore.binlog $(BuildCommandArgs)"
EnvironmentVariables="@(EnvironmentVariables)"
WorkingDirectory="$(ProjectDirectory)"
IgnoreStandardErrorWarningFormat="true" />

<Exec Command="$(DotnetToolCommand) build /bl:build.binlog $(BuildCommandArgs)"
EnvironmentVariables="@(EnvironmentVariables)"
WorkingDirectory="$(ProjectDirectory)"
IgnoreStandardErrorWarningFormat="true" />

<Exec Command="$(DotnetToolCommand) pack /bl:pack.binlog $(BuildCommandArgs)"
EnvironmentVariables="@(EnvironmentVariables)"
WorkingDirectory="$(ProjectDirectory)"
IgnoreStandardErrorWarningFormat="true" />
</Target>

</Project>

1 change: 1 addition & 0 deletions src/spectre-console
Submodule spectre-console added at 739716