-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added Trimming/NativeAOT support.
- Loading branch information
Showing
10 changed files
with
151 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
|
||
<PublishTrimmed>true</PublishTrimmed> | ||
<PublishAot>true</PublishAot> | ||
<!-- <TrimMode>partial</TrimMode>--> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\libs\QrCodes\QrCodes.csproj" /> | ||
<ProjectReference Include="..\..\libs\QrCodes.SkiaSharp\QrCodes.SkiaSharp.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<!-- <TrimmableAssembly Include="QrCodes" />--> | ||
<!-- <TrimmerRootAssembly Include="QrCodes" />--> | ||
<!-- <TrimmerRootAssembly Include="QrCodes.SkiaSharp" />--> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Label="Publish"> | ||
<RuntimeIdentifier Condition="$([MSBuild]::IsOSPlatform('windows'))">win-x64</RuntimeIdentifier> | ||
<RuntimeIdentifier Condition="!$([MSBuild]::IsOSPlatform('windows'))">osx-arm64</RuntimeIdentifier> | ||
|
||
<SelfContained>true</SelfContained> | ||
</PropertyGroup> | ||
|
||
<Target Name="ProduceAotWarnings" AfterTargets="Build"> | ||
<CallTarget Targets="Publish"/> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using QrCodes; | ||
using QrCodes.Renderers; | ||
|
||
Console.WriteLine("Build, rebuild or publish this app to see aot warnings."); | ||
|
||
var qr = QrCodeGenerator.Generate("Hello World!", ErrorCorrectionLevel.Medium); | ||
|
||
Console.WriteLine(AsciiRenderer.Render(qr, 1)); | ||
|
||
var bytes = new SkiaSharpRenderer().RenderToBytes(qr); | ||
|
||
File.WriteAllBytes("qr.png", bytes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Console.WriteLine("Build, rebuild or publish this app to see trimming warnings."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
|
||
<PublishTrimmed>true</PublishTrimmed> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\libs\QrCodes\QrCodes.csproj" /> | ||
<ProjectReference Include="..\..\libs\QrCodes.ImageSharp\QrCodes.ImageSharp.csproj" /> | ||
<ProjectReference Include="..\..\libs\QrCodes.SkiaSharp\QrCodes.SkiaSharp.csproj" /> | ||
<ProjectReference Include="..\..\libs\QrCodes.System.Drawing\QrCodes.System.Drawing.csproj" /> | ||
<ProjectReference Include="..\..\libs\QrCodes.Maui\QrCodes.Maui.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<TrimmerRootAssembly Include="QrCodes" /> | ||
<TrimmerRootAssembly Include="QrCodes.ImageSharp" /> | ||
<TrimmerRootAssembly Include="QrCodes.SkiaSharp" /> | ||
<TrimmerRootAssembly Include="QrCodes.System.Drawing" /> | ||
<TrimmerRootAssembly Include="QrCodes.Maui" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Label="Publish"> | ||
<RuntimeIdentifier Condition="$([MSBuild]::IsOSPlatform('windows'))">win-x64</RuntimeIdentifier> | ||
<RuntimeIdentifier Condition="!$([MSBuild]::IsOSPlatform('windows'))">osx-arm64</RuntimeIdentifier> | ||
|
||
<SelfContained>true</SelfContained> | ||
</PropertyGroup> | ||
|
||
<Target Name="ProduceTrimmingWarnings" AfterTargets="Build"> | ||
<CallTarget Targets="Publish"/> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters