AzureMcp.Cli.csproj•3.64 kB
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CliName>azmcp</CliName>
<AssemblyName>$(CliName)</AssemblyName>
<AssemblyTitle>Azure MCP Server</AssemblyTitle>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- Publishing settings -->
<IsAotCompatible>true</IsAotCompatible>
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>false</SelfContained>
<PublishReadyToRun>false</PublishReadyToRun>
<PublishTrimmed>false</PublishTrimmed>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<DebugType>embedded</DebugType>
</PropertyGroup>
<!-- Enable Trim and AOT Analyzers -->
<PropertyGroup>
<EnableAotAnalyzer>true</EnableAotAnalyzer>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
<!-- Suppress IL3000 warning in Microsoft.Identity.Client.NativeInterop -->
<NoWarn>$(NoWarn);IL3000</NoWarn>
</PropertyGroup>
<!-- AOT native build flags -->
<PropertyGroup Condition="'$(BuildNative)' == 'true'">
<IsAotCompatible>true</IsAotCompatible>
<PublishAot>true</PublishAot>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>full</TrimMode>
<SelfContained>true</SelfContained>
<IlcOptimizationPreference>Size</IlcOptimizationPreference>
<IlcFoldIdenticalMethodBodies>true</IlcFoldIdenticalMethodBodies>
</PropertyGroup>
<!-- Debug configuration -->
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>false</SelfContained>
<DebugType>portable</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AzureMcp.Core\AzureMcp.Core.csproj" />
<ProjectReference Include="..\..\..\areas\*\src\**\AzureMcp.*.csproj" />
</ItemGroup>
<ItemGroup>
<!-- We need a package reference for Cosmos so we have a path to the native assets for exclusion later -->
<PackageReference Include="Microsoft.Azure.Cosmos" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="ModelContextProtocol" />
<PackageReference Include="System.CommandLine" />
</ItemGroup>
<!-- IMPORTANT: DO NOT ADD EXCLUSIONS HERE -->
<!-- If the "(Native AOT) Build module" stage fails in CI, follow the AOT compatibility guide:
https://github.com/Azure/azure-mcp/blob/main/docs/aot-compatibility.md
Do not add ProjectReference removals in this ItemGroup. -->
<ItemGroup Condition="'$(BuildNative)' == 'true'">
<ProjectReference Remove="..\..\..\areas\cosmos\src\AzureMcp.Cosmos\AzureMcp.Cosmos.csproj" />
<ProjectReference Remove="..\..\..\areas\azuremanagedlustre\src\AzureMcp.AzureManagedLustre\AzureMcp.AzureManagedLustre.csproj" />
<PackageReference Remove="Microsoft.Azure.Cosmos" />
</ItemGroup>
<!-- Remove Cosmos native files from the build output directory -->
<Target Name="RemoveCosmosNativeFiles" BeforeTargets="GetCopyToOutputDirectoryItems">
<ItemGroup>
<FilesToRemove Include="@(ContentWithTargetPath)" Condition="$([System.String]::new('%(FullPath)').Contains('$(PkgMicrosoft_Azure_Cosmos)'))" />
</ItemGroup>
<ItemGroup>
<ContentWithTargetPath Remove="@(FilesToRemove)" />
</ItemGroup>
</Target>
</Project>