I have the following script in my project.json
file which I am using to build my class library project into a NuGet package. I don't want to build any Debug NuGet packages. How can I limit this script to only run when the solution configuration is set to Release mode to speed up the build time in debug mode?
Alternatively, as a matter of curiosity, how can I pass the solution configuration into the command below so that 'Release' is not hard coded.
"scripts": {
"postcompile": [
"dotnet pack --no-build --configuration Release"
]
}
You can use %compile:Configuration%
to get the current Configuration. Here is the list of variables available to precompile
and postcompile
scripts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With