Skip to content

Commit

Permalink
Native AOT projects should also copy SettingsWeWantToCopy (#2665)
Browse files Browse the repository at this point in the history
Co-authored-by: Keegan Caruso <[email protected]>
  • Loading branch information
keegan-caruso and Keegan Caruso authored Nov 15, 2024
1 parent b9d69a4 commit 25308bf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using BenchmarkDotNet.ConsoleArguments;
using BenchmarkDotNet.Detectors;
using BenchmarkDotNet.Detectors.Cpu;
Expand Down Expand Up @@ -155,8 +156,20 @@ private string GenerateProjectForNuGetBuild(BuildPartition buildPartition, Artif
<ItemGroup>
{string.Join(Environment.NewLine, GetRdXmlFiles(buildPartition.RepresentativeBenchmarkCase.Descriptor.Type, logger).Select(file => $"<RdXmlFile Include=\"{file}\" />"))}
</ItemGroup>
{GetCustomProperties(buildPartition, logger)}
</Project>";

private string GetCustomProperties(BuildPartition buildPartition, ILogger logger)
{
var projectFile = GetProjectFilePath(buildPartition.RepresentativeBenchmarkCase.Descriptor.Type, logger);
var xmlDoc = new XmlDocument();
xmlDoc.Load(projectFile.FullName);

(string customProperties, _) = GetSettingsThatNeedToBeCopied(xmlDoc, projectFile);
return customProperties;
}


private string GetILCompilerPackageReference()
=> string.IsNullOrEmpty(ilCompilerVersion) ? "" : $@"<PackageReference Include=""Microsoft.DotNet.ILCompiler"" Version=""{ilCompilerVersion}"" />";

Expand Down

0 comments on commit 25308bf

Please sign in to comment.