Skip to content

Commit

Permalink
Enable Central Package Management and NuGetAudit (#325)
Browse files Browse the repository at this point in the history
* Enable Central Package Management and NuGetAudit

Contributes to dotnet/arcade#15019

* Delete eng/SourceBuildPrebuiltBaseline.xml

* Don't hardcode package relative path
  • Loading branch information
ViktorHofer authored Aug 27, 2024
1 parent d578f29 commit 4291030
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 26 deletions.
4 changes: 4 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
</packageSources>
<auditSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</auditSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
Expand Down
1 change: 1 addition & 0 deletions eng/SourceBuild.props → eng/DotNetBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<GitHubRepositoryName>symreader</GitHubRepositoryName>
<SourceBuildManagedOnly>true</SourceBuildManagedOnly>
</PropertyGroup>

</Project>
7 changes: 0 additions & 7 deletions eng/SourceBuildPrebuiltBaseline.xml

This file was deleted.

4 changes: 0 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e3bdd9a0f2a65fe037ba1adb2261eea48a840fa4</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.24426.3">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>e3bdd9a0f2a65fe037ba1adb2261eea48a840fa4</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24426.3">
<Uri>https://github.com/dotnet/arcade</Uri>
Expand Down
3 changes: 0 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
<UsingToolPdbConverter>false</UsingToolPdbConverter>
<UsingToolNuGetRepack>true</UsingToolNuGetRepack>
<FlagNetStandard1XDependencies>true</FlagNetStandard1XDependencies>
<!-- Pinned -->
<MicrosoftDiaSymReaderNativeVersion>17.0.0-beta1.21524.1</MicrosoftDiaSymReaderNativeVersion>
<SystemCollectionsImmutableVersion>7.0.0</SystemCollectionsImmutableVersion>
</PropertyGroup>
</Project>
3 changes: 3 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

<!-- Any code that allows overflows intentionally should be explicitly in an unchecked region. -->
<CheckForOverflowUnderflow Condition="'$(Configuration)' == 'Debug'">true</CheckForOverflowUnderflow>

<!-- Only upgrade NuGetAudit warnings to errors for official builds. -->
<WarningsNotAsErrors Condition="'$(OfficialBuild)' != 'true'">$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>

</Project>
24 changes: 24 additions & 0 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<!-- Using multiple feeds isn't supported by Maestro: https://github.com/dotnet/arcade/issues/14155. -->
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>

<ItemGroup>
<!-- Runtime dependencies -->
<PackageVersion Include="System.Collections.Immutable" Version="8.0.0" />

<!-- DiaSymReader dependency -->
<PackageVersion Include="Microsoft.DiaSymReader.Native" Version="17.0.0-beta1.21524.1" />
</ItemGroup>

<!-- External dependencies -->
<ItemGroup>
<PackageVersion Include="xunit.assert" Version="$(XUnitVersion)" Condition="'$(IsTestUtilityProject)' == 'true'" />
<PackageVersion Include="xunit.extensibility.core" Version="$(XUnitVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(NetCurrent);$(NetFrameworkMinimum)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -7,26 +8,29 @@
Testing 64bit only on Desktop suffixiently covers our interop code paths.
-->
<TestArchitectures Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">x64;x86</TestArchitectures>

</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)" />
<PackageReference Include="Microsoft.DiaSymReader.Native" GeneratePathProperty="true" />
</ItemGroup>

<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<Content Include="$(NuGetPackageRoot)\Microsoft.DiaSymReader.Native\$(MicrosoftDiaSymReaderNativeVersion)\runtimes\win\native\Microsoft.DiaSymReader.Native.x86.dll">
<Content Include="$(PkgMicrosoft_DiaSymReader_Native)\runtimes\win\native\Microsoft.DiaSymReader.Native.x86.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
<Link>Microsoft.DiaSymReader.Native.x86.dll</Link>
</Content>
<Content Include="$(NuGetPackageRoot)\Microsoft.DiaSymReader.Native\$(MicrosoftDiaSymReaderNativeVersion)\runtimes\win\native\Microsoft.DiaSymReader.Native.amd64.dll">
<Content Include="$(PkgMicrosoft_DiaSymReader_Native)\runtimes\win\native\Microsoft.DiaSymReader.Native.amd64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
<Link>Microsoft.DiaSymReader.Native.amd64.dll</Link>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.DiaSymReader\Microsoft.DiaSymReader.csproj" />
<ProjectReference Include="..\PdbTestResources\PdbTestResources.csproj" />
<ProjectReference Include="..\TestUtilities\TestUtilities.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(NetCurrent);$(NetFrameworkMinimum)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -7,28 +8,30 @@
Testing 64bit only on Desktop sufficiently covers our interop code paths.
-->
<TestArchitectures Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">x64;x86</TestArchitectures>

<NoWarn>1701;1702;1705;1591;436</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(MicrosoftDiaSymReaderNativeVersion)" />
<PackageReference Include="Microsoft.DiaSymReader.Native" GeneratePathProperty="true" />
</ItemGroup>

<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<!-- Copy DSRN to a subdirectory of the output directory, so that we can test alternative load path -->
<Content Include="$(NuGetPackageRoot)\Microsoft.DiaSymReader.Native\$(MicrosoftDiaSymReaderNativeVersion)\runtimes\win\native\Microsoft.DiaSymReader.Native.x86.dll">
<Content Include="$(PkgMicrosoft_DiaSymReader_Native)\runtimes\win\native\Microsoft.DiaSymReader.Native.x86.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
<Link>DSRN\Microsoft.DiaSymReader.Native.x86.dll</Link>
</Content>
<Content Include="$(NuGetPackageRoot)\Microsoft.DiaSymReader.Native\$(MicrosoftDiaSymReaderNativeVersion)\runtimes\win\native\Microsoft.DiaSymReader.Native.amd64.dll">
<Content Include="$(PkgMicrosoft_DiaSymReader_Native)\runtimes\win\native\Microsoft.DiaSymReader.Native.amd64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>false</Visible>
<Link>DSRN\Microsoft.DiaSymReader.Native.amd64.dll</Link>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.DiaSymReader\Microsoft.DiaSymReader.csproj" />
<ProjectReference Include="..\PdbTestResources\PdbTestResources.csproj" />
<ProjectReference Include="..\TestUtilities\TestUtilities.csproj" />
</ItemGroup>

</Project>
11 changes: 8 additions & 3 deletions src/TestUtilities/TestUtilities.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(NetCurrent);$(NetFrameworkMinimum)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="xunit.assert" Version="$(XunitVersion)" />
<PackageReference Include="xunit.extensibility.core" Version="$(XunitVersion)" />
<PackageReference Include="xunit.assert" />
<PackageReference Include="xunit.extensibility.core" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
<PackageReference Include="System.Collections.Immutable" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.DiaSymReader\Microsoft.DiaSymReader.csproj" />
</ItemGroup>

</Project>

0 comments on commit 4291030

Please sign in to comment.