richardszalay / helix-publishing-pipeline

Unified publishing for Sitecore Helix solutions that extends existing Visual Studio and command line workflows
MIT License
68 stars 18 forks source link

White-list example for version-specific binaries. #79

Closed cheeto-bandito closed 2 years ago

cheeto-bandito commented 2 years ago

Want to share an example for white-listing version-specific binaries provided as part of a Sitecore hotfix.

<ItemGroup>
  <SitecoreHotfixAssemblies Include="Sitecore.ContentSearch.dll">
      <Name>Sitecore.ContentSearch.dll</Name>
      <Version>5.0.0.0</Version>
      <FileVersion>5.0.0.0</FileVersion>
      <InfoVersion>5.0.0-r00294</InfoVersion>
  </SitecoreHotfixAssemblies> 
  <SitecoreHotfixAssemblies Include="Sitecore.Kernel.dll">
      <Name>Sitecore.Kernel.dll</Name>
      <Version>13.0.0.0</Version>
      <FileVersion>13.0.0.0</FileVersion>
      <InfoVersion>13.0.0-r00755</InfoVersion>
  </SitecoreHotfixAssemblies>
</ItemGroup>

The benefits of this method are:

  1. Allows fine-grained control over the version of the dll that's white-listed
  2. Allows for the ItemGroup to be packaged up into a .targets file (which could be included in a Nuget package)
  3. Cleaner exclusion rule which looks like this:
<ItemGroup>
  <!-- Requires NuGet reference to Sitecore.Assemblies.Platform or another Assemblies package -->
  <SitecoreAssembliesToExclude Include="@(SitecoreAssemblies)" 
                               Exclude="@(SitecoreHotfixAssemblies" />
</ItemGroup>

This example covers the issue: #64

richardszalay commented 2 years ago

Looks great, thanks @cheeto-bandito!