libgit2 / libgit2sharp

Git + .NET = ❤
http://libgit2.github.com
MIT License
3.13k stars 879 forks source link

Way to much stuff packaged on runtimes folder #1968

Closed jmecosta closed 2 years ago

jmecosta commented 2 years ago

Hi,

the targets file for Native binaries

<Project>
  <PropertyGroup>
    <libgit2_propsfile>$(MSBuildThisFileFullPath)</libgit2_propsfile>
    <libgit2_hash>b7bad55e4bb0a285b073ba5e02b01d3f522fc95d</libgit2_hash>
    <libgit2_filename>git2-b7bad55</libgit2_filename>
  </PropertyGroup>
  <ItemGroup>
    <ContentWithTargetPath Include="$(MSBuildThisFileDirectory)\..\..\runtimes\win-x86\native\*" TargetPath="lib\win32\x86\%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
    <ContentWithTargetPath Include="$(MSBuildThisFileDirectory)\..\..\runtimes\win-x64\native\*" TargetPath="lib\win32\x64\%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
    <ContentWithTargetPath Include="$(MSBuildThisFileDirectory)\..\..\runtimes\win-arm64\native\*" TargetPath="lib\win32\arm64\%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
    <ContentWithTargetPath Include="$(MSBuildThisFileDirectory)\..\..\runtimes\**\*" Exclude="$(MSBuildThisFileDirectory)\..\..\runtimes\win-*\**\*" TargetPath="lib\%(RecursiveDir)..\%(Filename)%(Extension)" CopyToOutputDirectory="PreserveNewest" />
    <ContentWithTargetPath Include="$(MSBuildThisFileDirectory)\..\..\libgit2\LibGit2Sharp.dll.config" TargetPath="LibGit2Sharp.dll.config" CopyToOutputDirectory="PreserveNewest" />
  </ItemGroup>
</Project>

Could provide options for controling what gets deployed to each client. At the moment we get image

And our app is os, only, i know i can write a target to delete them after the build. But im creting a the nuget when the build runs, so it would be nice not to copy in first place.

Our client is net6-windows thus its not supose to run on linux or osx

If cleaning the unix stuff image

Its more than half the size of the app... speeding up a bit downloads and installation

thanks in advance

EraYaN commented 2 years ago

You can just make dotnet build you a platform specific build. I think if you build with the https://docs.microsoft.com/en-us/dotnet/core/rid-catalog RID set correctly it won't ship all the native stuff.

jmecosta commented 2 years ago

ok, works... thanks for the help