Skip to content

Commit ed4c3db

Browse files
committed
Trim with Squash
Unreachable IL is removed from DiffEngine at build time. It honors InternalsVisibleTo, since DiffEngineTray, the benchmarks and the tests use its internals. Version 20.7.1.
1 parent c581096 commit ed4c3db

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎src/DiffEngine/DiffEngine.csproj‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<!-- The .NET Framework legs, which only Windows can build -->
55
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT'">net462;net472;net48;$(TargetFrameworks)</TargetFrameworks>
66
<AllowUnsafeBlocks Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</AllowUnsafeBlocks>
7+
<!-- DiffEngineTray, the benchmarks and the tests use internals through InternalsVisibleTo -->
8+
<SquashInternalsVisibleTo>Honor</SquashInternalsVisibleTo>
79
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
810
</PropertyGroup>
911
<ItemGroup>
@@ -21,6 +23,7 @@
2123
<PackageReference Include="EmptyFiles" PrivateAssets="None" />
2224
<PackageReference Include="Polyfill" PrivateAssets="all" />
2325
<PackageReference Include="ProjectDefaults" PrivateAssets="all" />
26+
<PackageReference Include="Squash" PrivateAssets="all" />
2427
<None Include="buildTransitive\DiffEngine.targets" Pack="true" PackagePath="buildTransitive\" />
2528
</ItemGroup>
2629

‎src/Directory.Build.props‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<PropertyGroup>
4-
<Version>20.7.0</Version>
4+
<Version>20.7.1</Version>
55
<AssemblyVersion>1.0.0</AssemblyVersion>
66
<PackageTags>Testing, Snapshot, Diff, Compare</PackageTags>
77
<Description>Launches diff tools based on file extensions. Designed to be consumed by snapshot testing libraries.</Description>
@@ -17,8 +17,11 @@
1717
One NoWarn, because a second property of the same name replaces the first rather than adding to
1818
it. There were two, so CS0649, NU1608 and NU1109 were not suppressed at all - and with
1919
TreatWarningsAsErrors below they would have failed a build rather than warned in one.
20+
21+
IL2070 is a linker warning from Squash, for reflection inside Polyfill that is kept on .NET
22+
Framework because DiffEngine honors InternalsVisibleTo.
2023
-->
21-
<NoWarn>CS1591;CS0649;NU1608;NU1109;CA1416</NoWarn>
24+
<NoWarn>CS1591;CS0649;NU1608;NU1109;CA1416;IL2070</NoWarn>
2225
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2326
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
2427
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>

‎src/Directory.Packages.props‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="4.153.1" />
2222
<PackageVersion Include="Polyfill" Version="11.4.3" />
2323
<PackageVersion Include="ProjectDefaults" Version="1.0.184" />
24+
<PackageVersion Include="Squash" Version="0.1.0-beta.2" />
2425
<PackageVersion Include="Sbom" Version="0.3.1" />
2526
<PackageVersion Include="Serilog" Version="4.4.0" />
2627
<PackageVersion Include="Serilog.Sinks.File" Version="7.0.0" />

0 commit comments

Comments
 (0)