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

Remove additional files by pattern #28

Closed richardszalay closed 6 years ago

richardszalay commented 6 years ago

See #25 for more information.

This PR allows specific file patterns to be deleted if they're not included in the deployment. The implementation actually determines superfluous files, which avoids side effects like recycling the app pool when there's nothing to delete.

Currently only supported for FileSystem-based deployments, though there's room to generate MSDeploy rules based on the patterns in the future in order to support a number of other deployment types.

The syntax is as follows:

<!-- In ProjectName.wpp.targets or PublishProfile.wpp.targets -->
<ItemGroup>
  <AdditionalFilesToRemoveFromTarget Include="ContosoAssemblies">
    <TargetPath>bin\Contoso.*.dll</TargetPath>
  </AdditionalFilesToRemoveFromTarget>
  <AdditionalFilesToRemoveFromTarget Include="ContosoConfig">
    <TargetPath>App_Config\**\Contoso.*.config</TargetPath>
  </AdditionalFilesToRemoveFromTarget>
</ItemGroup>
richardszalay commented 6 years ago

@jeneaux / @coreyasmith Let me know if you have any feedback on how the feature works, the syntax, and whether the updates to the README are clear.

coreyasmith commented 6 years ago

This looks great. Can't wait to get it integrated into my project.