In another languages, when a build for production is performed, there are configurations to avoid libraries or dependencies not related to the build like: unit test, code coverage, etc
npm install --production
<dependency>...<scope>test</scope>...</dependency>mvn clean package
So my question is:
How to skip unit test libraries download on production build using c# and dotnet?
Unsuccessful attempts
- conditional package references
Workaround
To have 02 different *.csproj
- src/Api.csproj with required runtime dependencies
- test/Api.Test.csproj with only unit test dependencies
This is a problem because I cannot set the csproj for testing when I run custom tasks
dotnet msbuild -target:DisplayMessages --project test/Api.Test.csproj