I have a travis build script In that script it packs a nuget package
dotnet pack src/Google.Analytics.SDK.Core --configuration $BUILD_CONFIGURATION --no-restore --no-build --output $NUPKG_DIR /p:NuspecFile=$NUSPEC_PATH
the $NUSPEC_PATH is a .nuspec
file.
I am getting the following warning in my build.
/usr/share/dotnet/sdk/2.1.301/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(198,5): warning NU5119: File '/home/travis/build/LindaLawton/google-analytics-dotnet-sdk/deploy/.nuspec' was not added to the package. Files and folders starting with '.' or ending with '.nupkg' are excluded by default. To include this file, use -NoDefaultExcludes from the commandline [/home/travis/build/LindaLawton/google-analytics-dotnet-sdk/src/Google.Analytics.SDK.Core/Google.Analytics.SDK.Core.csproj] Successfully created package '/home/travis/build/LindaLawton/google-analytics-dotnet-sdk/NuPkg/Daimto.Google.Analytics.Tracker.SDK.1.0.0-beta.nupkg'.
I am having trouble figureing out where it wants me to add this -NoDefaultExcludes
Add the tag NoDefaultExcludes to PropertyGroup of the project you are targeting in pack command. Something like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageType>Template</PackageType>
...
<NoDefaultExcludes>true</NoDefaultExcludes>
</PropertyGroup>
</Project>
Set a property called NoPackageAnalysis to true in your csproj file or from the command line pass /p:NoPackageAnalysis=true
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