Skip to content
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

Create a configuration for generating a NuGet package #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

OskiKervinen-MF
Copy link
Contributor

I am planning to distribute this adapter internally as a nuget package. It doesn't seem you had nuget support configured in this repository, so I set it up. It took quite a lot of head banging to figure out how to convince nuget to install a package consisting of managed assemblies to a native project, so I thought I'd share my configuration in case you want to set up official nuget packages some day.

  • End assembly file name in .TestAdapter to make VS recognize it from a nuget package.
  • Create Catch2TestAdapter.nuspec to configure the nuget package. I tried embedding the nuget metadata in the project, but could not get it to support the exotic combination of having .NET assemblies that are meant to be installed in a native project.

See https://github.com/microsoft/vstest/blob/main/docs/RFCs/0004-Adapter-Extensibility.md

Command to generate the package:
nuget pack Catch2.TestAdapter.nuspec -Version 1.8.0 -p Configuration=Debug

PS. For .vcxprojs VS only finds adapters mentioned in packages.config, not in PackageReferences, unless you apply extra invocations.

* End assembly file name in .TestAdapter to make VS recognize
  it from a nuget package.
* Create Catch2TestAdapter.nuspec to configure the nuget package.
  I tried embedding the nuget metadata in the project, but could
  not get it to support the exotic combination of having .NET
  assemblies that are meant to be installed in a native project.

See https://github.com/microsoft/vstest/blob/main/docs/RFCs/0004-Adapter-Extensibility.md
Command to generate the package:
`nuget pack .\Catch2TestAdapter.csproj -Version 1.8.0 -IncludeReferencedProjects -p Configuration=Debug`
@OskiKervinen-MF OskiKervinen-MF mentioned this pull request Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant