Skip to content

Commit

Permalink
Place mibc data into RuntimeList.xml with AssetType PgoData (#7425)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwrighton authored May 21, 2021
1 parent 50f5645 commit da05407
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ public override bool Execute()
FileVersion = FileUtilities.GetFileVersion(item.ItemSpec),
IsNative = 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())
Expand All @@ -111,6 +112,10 @@ public override bool Execute()
{
type = "Resources";
}
else if (f.IsPgoData)
{
type = "PgoData";
}

string path = Path.Combine(f.TargetPath, f.Filename).Replace('\\', '/');

Expand All @@ -137,7 +142,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@
<FilesToPackage Condition="'%(Extension)' == '.pdb' or '%(Extension)' == '.dbg' or '%(Extension)' == '.dwarf'">
<IsSymbolFile>true</IsSymbolFile>
</FilesToPackage>
<FilesToPackage Condition="'%(Extension)' == '.mibc'">
<IsPgoData>true</IsPgoData>
<TargetPath>PgoData</TargetPath>
</FilesToPackage>
<FilesToPackage Condition="$([System.String]::new('%(Filename)').Contains('.ni.{')) and
$([System.String]::new('%(Filename)').EndsWith('}')) and
'%(Extension)' == '.map'">
Expand Down Expand Up @@ -380,6 +384,7 @@
<_FrameworkListRootAttribute Include="FrameworkName" Value="$(SharedFrameworkName)" />
<_FrameworkListRootAttribute Include="Name" Value="$(SharedFrameworkFriendlyName)" />
<_FrameworkListTargetFilePrefix Include="ref/;runtimes/" />
<_FrameworkListTargetFilePrefix Condition="'$(PlatformPackageType)' == 'RuntimePack'" Include="PgoData" />
</ItemGroup>

<CreateFrameworkListFile
Expand Down

0 comments on commit da05407

Please sign in to comment.