From 96555ae16f077124a853ffad1a643d990a331ce8 Mon Sep 17 00:00:00 2001 From: Brad Wilson Date: Wed, 6 Sep 2023 16:42:24 -0700 Subject: [PATCH] #383: Use ILRepack due to conflicts --- Versions.props | 1 + .../xunit.runner.visualstudio.csproj | 106 +++++++++++++----- .../xunit.runner.visualstudio.nuspec | 40 +++++++ tools/builder/targets/Packages.cs | 15 +++ 4 files changed, 134 insertions(+), 28 deletions(-) create mode 100644 src/xunit.runner.visualstudio/xunit.runner.visualstudio.nuspec create mode 100644 tools/builder/targets/Packages.cs diff --git a/Versions.props b/Versions.props index e2316d05..bf8edc56 100644 --- a/Versions.props +++ b/Versions.props @@ -1,6 +1,7 @@ + 2.0.13 6.0.11 17.7.0 1.1.1 diff --git a/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj b/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj index 47e3ec24..8efe7280 100644 --- a/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj +++ b/src/xunit.runner.visualstudio/xunit.runner.visualstudio.csproj @@ -1,23 +1,15 @@ - xUnit.net [Runner: Visual Studio] xUnit.net Runner for Visual Studio ($(TargetFramework)) true Xunit.Runner.VisualStudio net462;net6.0 true - Visual Studio 2022+ Test Explorer runner for the xUnit.net framework. Capable of running xUnit.net v1.9.2 and v2.0+ tests. Supports .NET 4.6.2 or later, and .NET 6 or later. - true build - true + true $(NoWarn);CS0436 enable - _content/logo-128-transparent.png - Apache-2.0 - _content/README.md - - xunit.runner.visualstudio @@ -31,6 +23,7 @@ + @@ -41,25 +34,6 @@ - - - - - - - - - - - - - - - - - - - true @@ -82,4 +56,80 @@ + + + + + + + -dev + + + Configuration=$(Configuration); + GitAssertModuleCommitId=$(GitAssertModuleCommitId); + GitCommitId=$(GitCommitId); + MicrosoftBclAsyncInterfacesVersion=$(MicrosoftBclAsyncInterfacesVersion); + MonoCecilVersion=$(MonoCecilVersion); + PackageVersion=$(PackageVersion); + SystemIoPipelinesVersion=$(SystemIoPipelinesVersion); + SystemNetHttpVersion=$(SystemNetHttpVersion); + SystemThreadingTasksExtensionsVersion=$(SystemThreadingTasksExtensionsVersion); + XunitAbstractionsVersion=$(XunitAbstractionsVersion); + XunitAnalyzersVersion=$(XunitAnalyzersVersion); + + + + + + + + $([System.IO.Path]::Combine($(TargetDir), "merged", "$(TargetFileName)")) + + + + + + + + + + + + + + + + + + + + $([System.IO.Path]::Combine($(NuGetPackageRoot), "ilrepack.msbuild.task", $(ILRepackVersion), "tools", "ilrepack.exe")) + mono $(ILRepackExe) + $([System.IO.Path]::Combine($(TargetDir), "premerge", "$(TargetFileName)")) + $([System.IO.Path]::Combine($(TargetDir), "merged", "$(TargetFileName)")) + + + + + + + + + + + + + diff --git a/src/xunit.runner.visualstudio/xunit.runner.visualstudio.nuspec b/src/xunit.runner.visualstudio/xunit.runner.visualstudio.nuspec new file mode 100644 index 00000000..3fb45b15 --- /dev/null +++ b/src/xunit.runner.visualstudio/xunit.runner.visualstudio.nuspec @@ -0,0 +1,40 @@ + + + + xunit.runner.visualstudio + $PackageVersion$ + xUnit.net [Runner: Visual Studio] + jnewkirk,bradwilson + false + Apache-2.0 + https://licenses.nuget.org/Apache-2.0 + _content/logo-128-transparent.png + _content/README.md + https://xunit.net/releases/visualstudio/$PackageVersion$ + Visual Studio 2022+ Test Explorer runner for the xUnit.net framework. Capable of running xUnit.net v1.9.2 and v2.0+ tests. Supports .NET 4.6.2 or later, and .NET 6 or later. + Copyright (C) .NET Foundation + + true + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/builder/targets/Packages.cs b/tools/builder/targets/Packages.cs new file mode 100644 index 00000000..d2ab11d0 --- /dev/null +++ b/tools/builder/targets/Packages.cs @@ -0,0 +1,15 @@ +using System.Threading.Tasks; +using Xunit.BuildTools.Models; + +namespace Xunit.BuildTools.Targets; + +public static partial class Packages +{ + public static async Task OnExecute(BuildContext context) + { + context.BuildStep("Creating NuGet packages"); + + var packArgs = $"pack --nologo --no-build --configuration {context.ConfigurationText} --output {context.PackageOutputFolder} --verbosity {context.Verbosity} src/xunit.runner.visualstudio -p:NuspecFile=xunit.runner.visualstudio.nuspec"; + await context.Exec("dotnet", packArgs); + } +}