Skip to content

Commit

Permalink
Add isAotCompatible build flag (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmk authored Nov 12, 2024
1 parent d159e74 commit 5665476
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 14 deletions.
6 changes: 5 additions & 1 deletion src/NATS.Client.Core/NATS.Client.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0'">
<Trimmable>true</Trimmable>
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<isAotCompatible>true</isAotCompatible>
</PropertyGroup>

<!-- Dependencies for all -->
Expand Down
4 changes: 4 additions & 0 deletions src/NATS.Client.Hosting/NATS.Client.Hosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<isAotCompatible>true</isAotCompatible>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0"/>
</ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/NATS.Client.JetStream/NATS.Client.JetStream.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<isAotCompatible>true</isAotCompatible>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
<NoWarn>$(NoWarn);CS8774</NoWarn>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<isAotCompatible>true</isAotCompatible>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NATS.Client.JetStream\NATS.Client.JetStream.csproj"/>
<InternalsVisibleTo Include="$(AssemblyName).Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db7da1f2f89089327b47d26d69666fad20861f24e9acdb13965fb6c64dfee8da589b495df37a75e934ddbacb0752a42c40f3dbc79614eec9bb2a0b6741f9e2ad2876f95e74d54c23eef0063eb4efb1e7d824ee8a695b647c113c92834f04a3a83fb60f435814ddf5c4e5f66a168139c4c1b1a50a3e60c164d180e265b1f000cd"/>
Expand Down
4 changes: 4 additions & 0 deletions src/NATS.Client.ObjectStore/NATS.Client.ObjectStore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<isAotCompatible>true</isAotCompatible>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<NoWarn>$(NoWarn);CS8604</NoWarn>
</PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/NATS.Client.Services/NATS.Client.Services.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<isAotCompatible>true</isAotCompatible>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\NATS.Client.Core\NATS.Client.Core.csproj"/>
<InternalsVisibleTo Include="$(AssemblyName).Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db7da1f2f89089327b47d26d69666fad20861f24e9acdb13965fb6c64dfee8da589b495df37a75e934ddbacb0752a42c40f3dbc79614eec9bb2a0b6741f9e2ad2876f95e74d54c23eef0063eb4efb1e7d824ee8a695b647c113c92834f04a3a83fb60f435814ddf5c4e5f66a168139c4c1b1a50a3e60c164d180e265b1f000cd"/>
Expand Down
19 changes: 6 additions & 13 deletions tests/NATS.Client.CheckNativeAot/NATS.Client.CheckNativeAot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,12 @@
<ProjectReference Include="..\..\src\NATS.Client.ObjectStore\NATS.Client.ObjectStore.csproj" />
<ProjectReference Include="..\..\src\NATS.Client.Services\NATS.Client.Services.csproj" />
<ProjectReference Include="..\NATS.Client.TestUtilities\NATS.Client.TestUtilities.csproj" />
</ItemGroup>

<ItemGroup>
<None Remove="dist\testhost.exe" />
<None Remove="dist\testhost.dll" />
<None Remove="dist\NATS.Client.TestUtilities.runtimeconfig.json" />
<None Remove="dist\NATS.Client.Services.xml" />
<None Remove="dist\NATS.Client.ObjectStore.xml" />
<None Remove="dist\NATS.Client.KeyValueStore.xml" />
<None Remove="dist\NATS.Client.JetStream.xml" />
<None Remove="dist\NATS.Client.Hosting.xml" />
<None Remove="dist\NATS.Client.Core.xml" />
<None Remove="dist\NATS.Client.CheckNativeAot.exe" />
<TrimmerRootAssembly Include="NATS.Client.Core" />
<TrimmerRootAssembly Include="NATS.Client.Hosting" />
<TrimmerRootAssembly Include="NATS.Client.JetStream" />
<TrimmerRootAssembly Include="NATS.Client.KeyValueStore" />
<TrimmerRootAssembly Include="NATS.Client.ObjectStore" />
<TrimmerRootAssembly Include="NATS.Client.Services" />
</ItemGroup>

</Project>

0 comments on commit 5665476

Please sign in to comment.