1

I'm trying out Teamcity and am having a problem with the Nuget Pack runner type. I've got my build working and it publishes the Nuget Package to the built in Nuget server. I'm able to use the package and everything is ok on that front.

However, I've adopted test driven development. The solution that contains the content of my Nuget Package also contains the code for my unit tests as well. The unit tests are run in the build steps to ensure that the code is behaving as expected.

The problem is that the unit test projects are being exported as nuget packages in their own right! I'd like team city not to publish the unit test projects.

In the build step I have the following

enter image description here

I've tried the following exlude files.

enter image description here

The output of the build looks like this...

enter image description here

I'd like to have Teamcity not create Cjd.LinchPin.UnitTests.*.nupkg. It's not needed.

One last thing, I'm trying to create this as a build template which I'll be able to reuse for other projects in the future. Hence why I'm trying to use Wildcards for the include and excludes.

The question is, how can I make the nuget pack build step ignore any project with UnitTest in it's name?

Colin Dawson
  • 435
  • 2
  • 12

1 Answers1

0

I figured out an answer to this that will be acceptable. The trick is to use a .nuspec file. This has to be created specifically for your nuget package. It can be checked into the source control alongside the project.

This allows you to do clever things with the nuget package content as it's driven by the nuspec file rather than wildcards or anything like that.

Colin Dawson
  • 435
  • 2
  • 12