Skip to content

Commit

Permalink
Use MSBuild.Obfuscar
Browse files Browse the repository at this point in the history
  • Loading branch information
aimenux committed Dec 19, 2024
1 parent 9fdc6cd commit b243dcd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="FluentAssertions" Version="7.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="MSBuild.Obfuscar" Version="2.2.35.2" />
<PackageVersion Include="Obfuscar" Version="2.2.40" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0" />
</ItemGroup>
</Project>
</Project>
14 changes: 4 additions & 10 deletions src/App/App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSBuild.Obfuscar">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Obfuscar">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<None Update="Assets\obfuscar.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<Target Name="Obfuscate" AfterTargets="PostBuildEvent">
<Exec Command="if $(ConfigurationName) == Release $(Obfuscar) Assets\obfuscar.xml" />
</Target>

</Project>
2 changes: 1 addition & 1 deletion src/App/Assets/obfuscar.xml → src/App/obfuscar.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<Obfuscator>
<Var name="InPath" value="bin\release\net8.0" />
<Var name="OutPath" value="bin\release\obfuscated" />
<Var name="OutPath" value="$(InPath)\obfuscated" />
<Var name="RegenerateDebugInfo" value="false" />
<Var name="OptimizeMethods" value="true" />
<Var name="SuppressIldasm" value="true" />
Expand Down

0 comments on commit b243dcd

Please sign in to comment.