Skip to content

Commit 99630eb

Browse files
committed
Add project to test trimming compatibility
1 parent de87973 commit 99630eb

File tree

5 files changed

+33
-0
lines changed

5 files changed

+33
-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.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NativeLibraryLoadTestApp.x8
1919
EndProject
2020
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NativeLibraryLoadTestApp.x64", "NativeLibraryLoadTestApp\x64\NativeLibraryLoadTestApp.x64.csproj", "{5C55175D-6A1F-4C51-B791-BF7DD00124EE}"
2121
EndProject
22+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrimmingTestApp", "TrimmingTestApp\TrimmingTestApp.csproj", "{AB2CAE85-9F4F-4AB6-9965-47ED92FCC719}"
23+
EndProject
2224
Global
2325
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2426
Debug|Any CPU = Debug|Any CPU
@@ -41,6 +43,10 @@ Global
4143
{5C55175D-6A1F-4C51-B791-BF7DD00124EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
4244
{5C55175D-6A1F-4C51-B791-BF7DD00124EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
4345
{5C55175D-6A1F-4C51-B791-BF7DD00124EE}.Release|Any CPU.Build.0 = Release|Any CPU
46+
{AB2CAE85-9F4F-4AB6-9965-47ED92FCC719}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47+
{AB2CAE85-9F4F-4AB6-9965-47ED92FCC719}.Debug|Any CPU.Build.0 = Debug|Any CPU
48+
{AB2CAE85-9F4F-4AB6-9965-47ED92FCC719}.Release|Any CPU.ActiveCfg = Release|Any CPU
49+
{AB2CAE85-9F4F-4AB6-9965-47ED92FCC719}.Release|Any CPU.Build.0 = Release|Any CPU
4450
EndGlobalSection
4551
GlobalSection(SolutionProperties) = preSolution
4652
HideSolutionNode = FALSE

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+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
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)