Skip to content

Commit

Permalink
Add AOT target for Key Vault SDK (#38721)
Browse files Browse the repository at this point in the history
* Add AOT target for Key Vault SDK

Resolves #38500

* Rebase on main, resolve PR feedback
  • Loading branch information
heaths authored Sep 29, 2023
1 parent 3c35fbb commit fd46155
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
<PackageReference Update="Microsoft.Extensions.Configuration.Binder" Version="2.1.10" />
<PackageReference Update="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Update="Microsoft.Extensions.Logging.Configuration" Version="8.0.0-rc.1.23419.4" />
<PackageReference Update="Microsoft.Extensions.DependencyInjection" Version="3.1.32" />
<PackageReference Update="Microsoft.Extensions.PlatformAbstractions" Version="1.1.0" />
<PackageReference Update="Microsoft.Graph" Version="4.52.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<PublishAot>true</PublishAot>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<IsClientLibrary>false</IsClientLibrary>
<IsTestSupportProject>true</IsTestSupportProject>
</PropertyGroup>

<ItemGroup>
<TrimmerRootAssembly Include="Azure.Security.KeyVault.Secrets" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../../../core/Azure.Core/src/Azure.Core.csproj" />
<ProjectReference Include="../src/Azure.Security.KeyVault.Secrets.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project>

<PropertyGroup>
<TargetFrameworks Condition="'$(TargetFramework)' != ''">$(TargetFramework)</TargetFrameworks>
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.targets))\Directory.Build.targets"
Condition="'$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.targets))' != ''" />

<!-- Canonicalize NoWarn: https://github.com/dotnet/runtime/issues/91965 -->
<ItemGroup>
<_NoWarn Include="$(NoWarn)" />
</ItemGroup>
<PropertyGroup>
<NoWarn>@(_NoWarn)</NoWarn>
</PropertyGroup>

<!-- Disable targets not necessary for samples -->
<Target Name="ValidateTargetFrameworks" />
<Target Name="VerifyProjectReferencesReferences" />

</Project>
4 changes: 4 additions & 0 deletions sdk/keyvault/Azure.Security.KeyVault.Secrets/aot/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

System.Console.WriteLine("Hello, world!");

0 comments on commit fd46155

Please sign in to comment.