SkiaSharp
SkiaSharp copied to clipboard
Reduce Runtime output footprint
Is your feature request related to a problem? Please describe.
Currently, all runtimes are being generated in the output folder - Linux (x86/x64/ARM/MUSL), OSX, Windows (x86/x64/Arm64), Win7 - which generates ~132 MB of space, when I only need Windows and Linux.
Describe the solution you'd like
As a user, I want to be able to select at compile time which runtimes are to be generated in the output folder. For instance, the required Windows x64 and Linux x64 files, reduce the output down to 21 MB.
Describe alternatives you've considered
Manually delete the files before packaging. This needs to be performed across all of our projects which reference SkiaSharp.
Additional context We are using, Avalonia.Skia.dll
Specify <RuntimeIdentifiers>
in your project file
https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#runtimeidentifiers
https://learn.microsoft.com/en-us/dotnet/core/rid-catalog
Thank you, @ojb500 for the quick reply and for providing reference resources.
Unfortunately, the project is still generating all of the runtimes regardless of the addition to the .csproj
file. I tried even just specifying win10-x64
only and linux & mac runtimes are still being generated. I can keep toying around.. perhaps, i'm doing something incorrectly?
<PropertyGroup>
<!-- Reduce Build Resources -->
<!-- Supported languages https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#satelliteresourcelanguages -->
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<!-- Supported runtimes (https://learn.microsoft.com/en-us/dotnet/core/rid-catalog) -->
<RuntimeIdentifiers>win10-x64;linux-x64</RuntimeIdentifiers>
</PropertyGroup>
Hmm, I'm pretty sure this is all I needed to do in my project to solve the same problem 🤔
Did you clean the output folder before rebuilding? And what kind of project is this?
Oh yes, cleaned it via VS2022 and even manually removed obj
and bin
folders. This is a project that uses Avalonia v0.10.21.
UPDATE:
What I found was, using the singular, <RuntimeIdentifier>linux-x64</RuntimeIdentifier>
limits the output to just linux-x64
, but the plural <RuntimeIdentifiers>
generates the subfolder runtimes
for all of them. Interesting stuff indeed.
Any luck on fixing this? Having the same issue.