From dea7104d706491c7d640badebd8f4e2f9123bbe4 Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Thu, 20 May 2021 18:09:02 -0700 Subject: [PATCH 1/2] Place mibc data into RuntimeList.xml with AssetType PgoData --- .../src/CreateFrameworkListFile.cs | 15 +++++++++++++-- .../targets/sharedfx.targets | 5 +++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.DotNet.SharedFramework.Sdk/src/CreateFrameworkListFile.cs b/src/Microsoft.DotNet.SharedFramework.Sdk/src/CreateFrameworkListFile.cs index 90bd96b13af..ce2979bce1b 100644 --- a/src/Microsoft.DotNet.SharedFramework.Sdk/src/CreateFrameworkListFile.cs +++ b/src/Microsoft.DotNet.SharedFramework.Sdk/src/CreateFrameworkListFile.cs @@ -87,13 +87,15 @@ public override bool Execute() AssemblyName = FileUtilities.GetAssemblyName(item.ItemSpec), FileVersion = FileUtilities.GetFileVersion(item.ItemSpec), IsNative = item.GetMetadata("IsNative") == "true", + IsProfile = item.GetMetadata("IsNative") == "true", IsSymbolFile = item.GetMetadata("IsSymbolFile") == "true", + IsPgoData = item.GetMetadata("IsPgoData") == "true", IsResourceFile = item.ItemSpec .EndsWith(".resources.dll", StringComparison.OrdinalIgnoreCase) }) .Where(f => !f.IsSymbolFile && - (f.Filename.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || f.IsNative)) + (f.Filename.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) || f.IsNative || f.IsPgoData)) // Remove duplicate files this task is given. .GroupBy(f => f.Item.ItemSpec) .Select(g => g.First()) @@ -111,6 +113,10 @@ public override bool Execute() { type = "Resources"; } + else if (f.IsPgoData) + { + type = "PgoData"; + } string path = Path.Combine(f.TargetPath, f.Filename).Replace('\\', '/'); @@ -137,7 +143,12 @@ public override bool Execute() new XAttribute("Culture", Path.GetFileName(Path.GetDirectoryName(path)))); } - if (f.AssemblyName != null) + if (f.IsPgoData) + { + // Pgo data is never carried with single file images + element.Add(new XAttribute("DropFromSingleFile", "true")); + } + else if (f.AssemblyName != null) { byte[] publicKeyToken = f.AssemblyName.GetPublicKeyToken(); string publicKeyTokenHex; diff --git a/src/Microsoft.DotNet.SharedFramework.Sdk/targets/sharedfx.targets b/src/Microsoft.DotNet.SharedFramework.Sdk/targets/sharedfx.targets index 860db8a71ff..ed8fe84415b 100644 --- a/src/Microsoft.DotNet.SharedFramework.Sdk/targets/sharedfx.targets +++ b/src/Microsoft.DotNet.SharedFramework.Sdk/targets/sharedfx.targets @@ -130,6 +130,10 @@ true + + true + PgoData + @@ -380,6 +384,7 @@ <_FrameworkListRootAttribute Include="FrameworkName" Value="$(SharedFrameworkName)" /> <_FrameworkListRootAttribute Include="Name" Value="$(SharedFrameworkFriendlyName)" /> <_FrameworkListTargetFilePrefix Include="ref/;runtimes/" /> + <_FrameworkListTargetFilePrefix Condition="'$(PlatformPackageType)' == 'RuntimePack'" Include="PgoData" /> Date: Thu, 20 May 2021 18:13:53 -0700 Subject: [PATCH 2/2] Forgotten detail deleted --- .../src/CreateFrameworkListFile.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Microsoft.DotNet.SharedFramework.Sdk/src/CreateFrameworkListFile.cs b/src/Microsoft.DotNet.SharedFramework.Sdk/src/CreateFrameworkListFile.cs index ce2979bce1b..984fee0faa3 100644 --- a/src/Microsoft.DotNet.SharedFramework.Sdk/src/CreateFrameworkListFile.cs +++ b/src/Microsoft.DotNet.SharedFramework.Sdk/src/CreateFrameworkListFile.cs @@ -87,7 +87,6 @@ public override bool Execute() AssemblyName = FileUtilities.GetAssemblyName(item.ItemSpec), FileVersion = FileUtilities.GetFileVersion(item.ItemSpec), IsNative = item.GetMetadata("IsNative") == "true", - IsProfile = item.GetMetadata("IsNative") == "true", IsSymbolFile = item.GetMetadata("IsSymbolFile") == "true", IsPgoData = item.GetMetadata("IsPgoData") == "true", IsResourceFile = item.ItemSpec