Skip to content

Commit

Permalink
Add AOT project to root all public entrypoints to library and verify …
Browse files Browse the repository at this point in the history
…they are AOT compatible
  • Loading branch information
andrewjsaid committed Oct 17, 2024
1 parent 41ff189 commit 65c368b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Levenshtypo.sln
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Levenshtypo.Generator", "sr
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Levenshtypo.Samples", "samples\Levenshtypo.Samples\Levenshtypo.Samples.csproj", "{EA373273-9ED6-45EC-9AC4-CC01A19B5B24}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Levenshtypo.Aot", "src\Levenshtypo.Aot\Levenshtypo.Aot.csproj", "{3CA5F231-8D7F-48FE-9E28-66E5EBD1579C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -43,6 +45,10 @@ Global
{EA373273-9ED6-45EC-9AC4-CC01A19B5B24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA373273-9ED6-45EC-9AC4-CC01A19B5B24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA373273-9ED6-45EC-9AC4-CC01A19B5B24}.Release|Any CPU.Build.0 = Release|Any CPU
{3CA5F231-8D7F-48FE-9E28-66E5EBD1579C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3CA5F231-8D7F-48FE-9E28-66E5EBD1579C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3CA5F231-8D7F-48FE-9E28-66E5EBD1579C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3CA5F231-8D7F-48FE-9E28-66E5EBD1579C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
17 changes: 17 additions & 0 deletions src/Levenshtypo.Aot/Levenshtypo.Aot.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Levenshtypo\Levenshtypo.csproj" />
<TrimmerRootAssembly Include="Levenshtypo" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions src/Levenshtypo.Aot/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Console.WriteLine("This is an AOT program which roots all public methods of Levenshtypo!");
Console.WriteLine("RUN dotnet publish for absolute confirmation that Levenshtypo works with AOT");
4 changes: 2 additions & 2 deletions src/Levenshtypo/Levenshtypo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
<Product>Levenshtypo</Product>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<IsAotCompatible>True</IsAotCompatible>
<PropertyGroup>
<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 65c368b

Please sign in to comment.