Skip to content

Commit 5665476

Browse files
authored
Add isAotCompatible build flag (#658)
1 parent d159e74 commit 5665476

File tree

7 files changed

+31
-14
lines changed

7 files changed

+31
-14
lines changed

src/NATS.Client.Core/NATS.Client.Core.csproj

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
</PropertyGroup>
2323

2424
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0'">
25-
<Trimmable>true</Trimmable>
25+
<IsTrimmable>true</IsTrimmable>
26+
</PropertyGroup>
27+
28+
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
29+
<isAotCompatible>true</isAotCompatible>
2630
</PropertyGroup>
2731

2832
<!-- Dependencies for all -->

src/NATS.Client.Hosting/NATS.Client.Hosting.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<IsTrimmable>true</IsTrimmable>
1717
</PropertyGroup>
1818

19+
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
20+
<isAotCompatible>true</isAotCompatible>
21+
</PropertyGroup>
22+
1923
<ItemGroup Condition="'$(TargetFramework)' != 'net8.0'">
2024
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0"/>
2125
</ItemGroup>

src/NATS.Client.JetStream/NATS.Client.JetStream.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<IsTrimmable>true</IsTrimmable>
1717
</PropertyGroup>
1818

19+
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
20+
<isAotCompatible>true</isAotCompatible>
21+
</PropertyGroup>
22+
1923
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
2024
<NoWarn>$(NoWarn);CS8774</NoWarn>
2125
</PropertyGroup>

src/NATS.Client.KeyValueStore/NATS.Client.KeyValueStore.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<IsTrimmable>true</IsTrimmable>
1717
</PropertyGroup>
1818

19+
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
20+
<isAotCompatible>true</isAotCompatible>
21+
</PropertyGroup>
22+
1923
<ItemGroup>
2024
<ProjectReference Include="..\NATS.Client.JetStream\NATS.Client.JetStream.csproj"/>
2125
<InternalsVisibleTo Include="$(AssemblyName).Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db7da1f2f89089327b47d26d69666fad20861f24e9acdb13965fb6c64dfee8da589b495df37a75e934ddbacb0752a42c40f3dbc79614eec9bb2a0b6741f9e2ad2876f95e74d54c23eef0063eb4efb1e7d824ee8a695b647c113c92834f04a3a83fb60f435814ddf5c4e5f66a168139c4c1b1a50a3e60c164d180e265b1f000cd"/>

src/NATS.Client.ObjectStore/NATS.Client.ObjectStore.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<IsTrimmable>true</IsTrimmable>
1717
</PropertyGroup>
1818

19+
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
20+
<isAotCompatible>true</isAotCompatible>
21+
</PropertyGroup>
22+
1923
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
2024
<NoWarn>$(NoWarn);CS8604</NoWarn>
2125
</PropertyGroup>

src/NATS.Client.Services/NATS.Client.Services.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<IsTrimmable>true</IsTrimmable>
1717
</PropertyGroup>
1818

19+
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
20+
<isAotCompatible>true</isAotCompatible>
21+
</PropertyGroup>
22+
1923
<ItemGroup>
2024
<ProjectReference Include="..\NATS.Client.Core\NATS.Client.Core.csproj"/>
2125
<InternalsVisibleTo Include="$(AssemblyName).Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100db7da1f2f89089327b47d26d69666fad20861f24e9acdb13965fb6c64dfee8da589b495df37a75e934ddbacb0752a42c40f3dbc79614eec9bb2a0b6741f9e2ad2876f95e74d54c23eef0063eb4efb1e7d824ee8a695b647c113c92834f04a3a83fb60f435814ddf5c4e5f66a168139c4c1b1a50a3e60c164d180e265b1f000cd"/>

tests/NATS.Client.CheckNativeAot/NATS.Client.CheckNativeAot.csproj

+6-13
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,12 @@
2323
<ProjectReference Include="..\..\src\NATS.Client.ObjectStore\NATS.Client.ObjectStore.csproj" />
2424
<ProjectReference Include="..\..\src\NATS.Client.Services\NATS.Client.Services.csproj" />
2525
<ProjectReference Include="..\NATS.Client.TestUtilities\NATS.Client.TestUtilities.csproj" />
26-
</ItemGroup>
27-
28-
<ItemGroup>
29-
<None Remove="dist\testhost.exe" />
30-
<None Remove="dist\testhost.dll" />
31-
<None Remove="dist\NATS.Client.TestUtilities.runtimeconfig.json" />
32-
<None Remove="dist\NATS.Client.Services.xml" />
33-
<None Remove="dist\NATS.Client.ObjectStore.xml" />
34-
<None Remove="dist\NATS.Client.KeyValueStore.xml" />
35-
<None Remove="dist\NATS.Client.JetStream.xml" />
36-
<None Remove="dist\NATS.Client.Hosting.xml" />
37-
<None Remove="dist\NATS.Client.Core.xml" />
38-
<None Remove="dist\NATS.Client.CheckNativeAot.exe" />
26+
<TrimmerRootAssembly Include="NATS.Client.Core" />
27+
<TrimmerRootAssembly Include="NATS.Client.Hosting" />
28+
<TrimmerRootAssembly Include="NATS.Client.JetStream" />
29+
<TrimmerRootAssembly Include="NATS.Client.KeyValueStore" />
30+
<TrimmerRootAssembly Include="NATS.Client.ObjectStore" />
31+
<TrimmerRootAssembly Include="NATS.Client.Services" />
3932
</ItemGroup>
4033

4134
</Project>

0 commit comments

Comments
 (0)