Skip to content

Commit 47d3cd0

Browse files
Enable Nuget Audit (#1149)
* Enable Nuget Audit * Update WarningsAsErorrs
1 parent a8cf0d3 commit 47d3cd0

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
<CustomizationsPrefix>Customizations</CustomizationsPrefix>
2424
<CustomizationsPropsFile>$(CustomizationsPrefix).props</CustomizationsPropsFile>
2525
<CustomizationsSourceFile>$(CustomizationsPrefix).cs</CustomizationsSourceFile>
26+
27+
<!-- Only upgrade NuGetAudit warnings to errors for official builds. -->
28+
<WarningsNotAsErrors Condition="'$(OfficialBuild)' != 'true'">$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
2629
</PropertyGroup>
2730

2831
</Project>

NuGet.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@
2424
<add key="darc-pub-DotNet-msbuild-Trusted" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-DotNet-msbuild-Trusted-a400405b/nuget/v3/index.json" />
2525
</packageSources>
2626
<disabledPackageSources />
27+
<auditSources>
28+
<clear />
29+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
30+
</auditSources>
2731
</configuration>

src/packageSourceGenerator/PackageSourceGenerator.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>$(NetCurrent)</TargetFramework>
5+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
56
<PackageSourceGeneratorTaskAssembly>$(ArtifactsBinDir)PackageSourceGeneratorTask\$(Configuration)\$(NetCurrent)\PackageSourceGeneratorTask.dll</PackageSourceGeneratorTaskAssembly>
67
<!-- The packages output directory. -->
78
<PackagesTargetDirectory Condition="'$(PackageType)' != 'text'">$(RepoRoot)src\referencePackages\src\</PackagesTargetDirectory>

src/referencePackages/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<SourceControlInformationFeatureSupported>false</SourceControlInformationFeatureSupported>
3434
<Configuration>Release</Configuration>
3535
<EnableSourceLink>false</EnableSourceLink>
36+
<NuGetAudit>false</NuGetAudit>
3637

3738
<NoStdLib>true</NoStdLib>
3839
<NoConfig>true</NoConfig>

src/targetPacks/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<TargetFramework>netstandard2.0</TargetFramework>
1111
<IncludeBuildOutput>false</IncludeBuildOutput>
1212
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
13+
<NuGetAudit>false</NuGetAudit>
1314

1415
<RestoreIlTooling>true</RestoreIlTooling>
1516

0 commit comments

Comments
 (0)