Skip to content

Commit

Permalink
build package correlation and include in updater
Browse files Browse the repository at this point in the history
  • Loading branch information
brettfo authored and randhircs committed Jan 9, 2025
1 parent 26d642a commit 10e5576
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = nuget/helpers/lib/NuGet.Client
url = https://github.com/NuGet/NuGet.Client
branch = release-6.12.x
[submodule "nuget/helpers/lib/dotnet-core"]
path = nuget/helpers/lib/dotnet-core
url = https://github.com/dotnet/core
1 change: 1 addition & 0 deletions nuget/helpers/lib/NuGetUpdater/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ bin/
obj/
Properties/launchSettings.json
NuGetUpdater.sln.DotSettings.user
NuGetUpdater.Core/dotnet-package-correlation.json
*.binlog
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public static async Task<int> Main(string[] args)
// the tool is expected to be given the path to the .NET Core repository, but the correlator only needs a specific subdirectory
var releaseNotesDirectory = new DirectoryInfo(Path.Combine(coreLocationDirectory.FullName, "release-notes"));
var correlator = new Correlator(releaseNotesDirectory);
var result = await correlator.RunAsync();
var json = JsonSerializer.Serialize(result, Correlator.SerializerOptions);
var (packages, _warnings) = await correlator.RunAsync();
var json = JsonSerializer.Serialize(packages, Correlator.SerializerOptions);
await File.WriteAllTextAsync(output.FullName, json);
}, coreLocationOption, outputOption);
var exitCode = await command.InvokeAsync(args);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project>

<PropertyGroup>
<PackageCorrelationDirectory>$(MSBuildThisFileDirectory)..\DotNetPackageCorrelation</PackageCorrelationDirectory>
<DotNetCoreDirectory>$(MSBuildThisFileDirectory)..\..\dotnet-core</DotNetCoreDirectory>
<PackageCorrelationFile>$(MSBuildThisFileDirectory)dotnet-package-correlation.json</PackageCorrelationFile>
</PropertyGroup>

<ItemGroup>
<None Include="$(PackageCorrelationFile)" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<Target Name="BuildDotNetPackageCorrelationFile" BeforeTargets="Build" DependsOnTargets="Restore">
<Exec Command="dotnet run --core-location &quot;$(DotNetCoreDirectory)&quot; --output &quot;$(PackageCorrelationFile)&quot;" WorkingDirectory="$(PackageCorrelationDirectory)" />
</Target>

<Target Name="CleanDotNetPackageCorrelationFile" BeforeTargets="Clean">
<Delete Files="$(PackageCorrelationFile)" Condition="Exists('$(PackageCorrelationFile)')" />
</Target>

<Target Name="RebuildDotNetPackageCorrelationFile" BeforeTargets="Rebuild" DependsOnTargets="CleanDotNetPackageCorrelationFile">
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@
<InternalsVisibleTo Include="NuGetUpdater.Core.Test" />
</ItemGroup>

<Import Project="EnsureDotNetPackageCorrelation.targets" />

</Project>
1 change: 1 addition & 0 deletions nuget/helpers/lib/dotnet-core
Submodule dotnet-core added at 649080

0 comments on commit 10e5576

Please sign in to comment.