Skip to content

Commit 2cad6cd

Browse files
committed
Add project to test trimming compatibility
1 parent de87973 commit 2cad6cd

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
name: NuGet packages
3131
path: bin/Packages/
3232
retention-days: 7
33+
- name: Verify trimming compatibility
34+
run: dotnet publish TrimmingTestApp
3335
test:
3436
name: Test / ${{ matrix.os }} / ${{ matrix.arch }} / ${{ matrix.tfm }}
3537
runs-on: ${{ matrix.os }}

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
<MinVerBuildMetadata Condition="'$(libgit2_hash)' != ''">libgit2-$(libgit2_hash.Substring(0,7))</MinVerBuildMetadata>
2424
</PropertyGroup>
2525

26+
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
27+
<IsTrimmable>true</IsTrimmable>
28+
</PropertyGroup>
29+
2630
<ItemGroup>
2731
<None Include="..\square-logo.png" Pack="true" PackagePath="" Visible="false" />
2832
<None Include="..\README.md" Pack="true" PackagePath="App_Readme/" Visible="false" />

TrimmingTestApp/Program.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
using LibGit2Sharp;
2+
3+
_ = new Repository();
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<OutputType>Exe</OutputType>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
9+
<PublishTrimmed>true</PublishTrimmed>
10+
<PublishSingleFile>true</PublishSingleFile>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\LibGit2Sharp\LibGit2Sharp.csproj" />
15+
<TrimmerRootAssembly Include="LibGit2Sharp" />
16+
</ItemGroup>
17+
18+
</Project>

0 commit comments

Comments
 (0)